mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 00:55:31 +00:00
fix #4125
This commit is contained in:
parent
a0de244487
commit
1c2aa1076b
6 changed files with 41 additions and 13 deletions
|
@ -2464,6 +2464,27 @@ namespace qe {
|
|||
fml = tmp;
|
||||
}
|
||||
|
||||
bool has_quantified_uninterpreted(ast_manager& m, expr* fml) {
|
||||
struct found {};
|
||||
struct proc {
|
||||
ast_manager& m;
|
||||
proc(ast_manager& m):m(m) {}
|
||||
void operator()(quantifier* q) {
|
||||
if (has_uninterpreted(m, q->get_expr()))
|
||||
throw found();
|
||||
}
|
||||
void operator()(expr*) {}
|
||||
};
|
||||
|
||||
try {
|
||||
proc p(m);
|
||||
for_each_expr(p, fml);
|
||||
return false;
|
||||
}
|
||||
catch (found) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
class simplify_solver_context : public i_solver_context {
|
||||
ast_manager& m;
|
||||
|
|
|
@ -328,6 +328,8 @@ namespace qe {
|
|||
|
||||
void mk_exists(unsigned num_vars, app* const* vars, expr_ref& fml);
|
||||
|
||||
bool has_quantified_uninterpreted(ast_manager& m, expr* fml);
|
||||
|
||||
void get_nnf(expr_ref& fml, i_expr_pred& pred, i_nnf_atom& mk_atom, atom_set& pos, atom_set& neg);
|
||||
|
||||
class simplify_rewriter_cfg : public default_rewriter_cfg {
|
||||
|
|
|
@ -740,6 +740,9 @@ namespace qe {
|
|||
\brief create a quantifier prefix formula.
|
||||
*/
|
||||
void hoist(expr_ref& fml) {
|
||||
if (has_quantified_uninterpreted(m, fml)) {
|
||||
throw tactic_exception("formula contains uninterpreted functions");
|
||||
}
|
||||
proof_ref pr(m);
|
||||
label_rewriter rw(m);
|
||||
rw.remove_labels(fml, pr);
|
||||
|
@ -770,9 +773,6 @@ namespace qe {
|
|||
while (!vars.empty());
|
||||
SASSERT(m_vars.back().empty());
|
||||
initialize_levels();
|
||||
if (has_uninterpreted(m, fml))
|
||||
throw tactic_exception("formula contains uninterpreted functions");
|
||||
|
||||
TRACE("qe", tout << fml << "\n";);
|
||||
}
|
||||
|
||||
|
@ -834,8 +834,8 @@ namespace qe {
|
|||
expr_ref_vector core1(m), core2(m), dels(m);
|
||||
TRACE("qe", tout << core.size() << "\n";);
|
||||
mus mus(get_kernel(level).s());
|
||||
for (unsigned i = 0; i < core.size(); ++i) {
|
||||
app* a = to_app(core[i].get());
|
||||
for (expr* arg : core) {
|
||||
app* a = to_app(arg);
|
||||
max_level lvl = m_pred_abs.compute_level(a);
|
||||
if (lvl.max() + 2 <= level) {
|
||||
VERIFY(core1.size() == mus.add_soft(a));
|
||||
|
@ -1194,9 +1194,9 @@ namespace qe {
|
|||
return true;
|
||||
}
|
||||
for (unsigned i = 0; i < m_avars.size(); ++i) {
|
||||
contains_app cont(m, m_avars[i].get());
|
||||
contains_app cont(m, m_avars.get(i));
|
||||
if (cont(proj)) {
|
||||
TRACE("qe", tout << "Projection contains free variable: " << mk_pp(m_avars[i].get(), m) << "\n";);
|
||||
TRACE("qe", tout << "Projection contains free variable: " << mk_pp(m_avars.get(i), m) << "\n";);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue