3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-02 21:37:02 +00:00

fix #2387, add ite-hoist rewriting, allow assumptions to be compound expressions

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2019-07-09 07:40:20 +01:00
parent cd93cdd819
commit 88aa689a70
6 changed files with 118 additions and 33 deletions

View file

@ -2579,36 +2579,9 @@ namespace smt2 {
void parse_assumptions() {
while (!curr_is_rparen()) {
bool sign;
expr_ref t_ref(m());
if (curr_is_lparen()) {
next();
check_id_next(m_not, "invalid check-sat command, 'not' expected, assumptions must be Boolean literals");
check_identifier("invalid check-sat command, literal expected");
sign = true;
}
else {
check_identifier("invalid check-sat command, literal or ')' expected");
sign = false;
}
symbol n = curr_id();
next();
m_ctx.mk_const(n, t_ref);
if (!m().is_bool(t_ref))
parse_expr();
if (!m().is_bool(expr_stack().back()))
throw parser_exception("invalid check-sat command, argument must be a Boolean literal");
if (sign) {
if (!is_uninterp_const(t_ref))
throw parser_exception("invalid check-sat command, argument must be a Boolean literal");
t_ref = m().mk_not(t_ref.get());
}
else {
expr * arg;
if (!is_uninterp_const(t_ref) && !(m().is_not(t_ref, arg) && is_uninterp_const(arg)))
throw parser_exception("invalid check-sat command, argument must be a Boolean literal");
}
expr_stack().push_back(t_ref.get());
if (sign)
check_rparen_next("invalid check-sat command, ')' expected");
}
}