mirror of
https://github.com/Z3Prover/z3
synced 2025-08-11 21:50:52 +00:00
pull unstable
Signed-off-by: Nikolaj Bjorner <nbjorner@hotmail.com>
This commit is contained in:
commit
52619b9dbb
337 changed files with 24943 additions and 30606 deletions
|
@ -198,11 +198,75 @@ struct is_non_qflira_functor {
|
|||
}
|
||||
};
|
||||
|
||||
struct is_non_qfauflira_functor {
|
||||
struct found {};
|
||||
ast_manager & m;
|
||||
arith_util m_arith_util;
|
||||
array_util m_array_util;
|
||||
bool m_int;
|
||||
bool m_real;
|
||||
|
||||
is_non_qfauflira_functor(ast_manager & _m, bool _int, bool _real) :
|
||||
m(_m), m_arith_util(_m), m_array_util(_m), m_int(_int), m_real(_real) {}
|
||||
|
||||
void operator()(var *) { throw found(); }
|
||||
|
||||
void operator()(quantifier *) { throw found(); }
|
||||
|
||||
bool compatible_sort(app * n) const {
|
||||
if (m.is_bool(n))
|
||||
return true;
|
||||
if (m_int && m_arith_util.is_int(n))
|
||||
return true;
|
||||
if (m_real && m_arith_util.is_real(n))
|
||||
return true;
|
||||
if (m_array_util.is_array(n))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
void operator()(app * n) {
|
||||
if (!compatible_sort(n))
|
||||
throw found();
|
||||
family_id fid = n->get_family_id();
|
||||
if (fid == m.get_basic_family_id())
|
||||
return;
|
||||
if (fid == m_arith_util.get_family_id()) {
|
||||
switch (n->get_decl_kind()) {
|
||||
case OP_LE: case OP_GE: case OP_LT: case OP_GT:
|
||||
case OP_ADD: case OP_NUM:
|
||||
return;
|
||||
case OP_MUL:
|
||||
if (n->get_num_args() != 2)
|
||||
throw found();
|
||||
if (!m_arith_util.is_numeral(n->get_arg(0)))
|
||||
throw found();
|
||||
return;
|
||||
case OP_TO_REAL:
|
||||
if (!m_real)
|
||||
throw found();
|
||||
break;
|
||||
default:
|
||||
throw found();
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (is_uninterp(n))
|
||||
return;
|
||||
throw found();
|
||||
}
|
||||
};
|
||||
|
||||
static bool is_qflia(goal const & g) {
|
||||
is_non_qflira_functor p(g.m(), true, false);
|
||||
return !test(g, p);
|
||||
}
|
||||
|
||||
static bool is_qfauflia(goal const & g) {
|
||||
is_non_qfauflira_functor p(g.m(), true, false);
|
||||
return !test(g, p);
|
||||
}
|
||||
|
||||
class is_qflia_probe : public probe {
|
||||
public:
|
||||
virtual result operator()(goal const & g) {
|
||||
|
@ -210,6 +274,13 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
class is_qfauflia_probe : public probe {
|
||||
public:
|
||||
virtual result operator()(goal const & g) {
|
||||
return is_qfauflia(g);
|
||||
}
|
||||
};
|
||||
|
||||
static bool is_qflra(goal const & g) {
|
||||
is_non_qflira_functor p(g.m(), false, true);
|
||||
return !test(g, p);
|
||||
|
@ -289,6 +360,10 @@ probe * mk_is_qflia_probe() {
|
|||
return alloc(is_qflia_probe);
|
||||
}
|
||||
|
||||
probe * mk_is_qfauflia_probe() {
|
||||
return alloc(is_qfauflia_probe);
|
||||
}
|
||||
|
||||
probe * mk_is_qflra_probe() {
|
||||
return alloc(is_qflra_probe);
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@ probe * mk_arith_max_degree_probe();
|
|||
*/
|
||||
|
||||
probe * mk_is_qflia_probe();
|
||||
probe * mk_is_qfauflia_probe();
|
||||
probe * mk_is_qflra_probe();
|
||||
probe * mk_is_qflira_probe();
|
||||
probe * mk_is_ilp_probe();
|
||||
|
@ -40,6 +41,7 @@ probe * mk_is_mip_probe();
|
|||
|
||||
/*
|
||||
ADD_PROBE("is-qflia", "true if the goal is in QF_LIA.", "mk_is_qflia_probe()")
|
||||
ADD_PROBE("is-qfauflia", "true if the goal is in QF_AUFLIA.", "mk_is_qfauflia_probe()")
|
||||
ADD_PROBE("is-qflra", "true if the goal is in QF_LRA.", "mk_is_qflra_probe()")
|
||||
ADD_PROBE("is-qflira", "true if the goal is in QF_LIRA.", "mk_is_qflira_probe()")
|
||||
ADD_PROBE("is-ilp", "true if the goal is ILP.", "mk_is_ilp_probe()")
|
||||
|
|
|
@ -115,6 +115,7 @@ struct propagate_ineqs_tactic::imp {
|
|||
out << "< oo";
|
||||
out << "\n";
|
||||
}
|
||||
nm.del(k);
|
||||
}
|
||||
|
||||
a_var mk_var(expr * t) {
|
||||
|
@ -234,6 +235,7 @@ struct propagate_ineqs_tactic::imp {
|
|||
SASSERT(k == GE);
|
||||
bp.assert_lower(x, c_prime, strict);
|
||||
}
|
||||
nm.del(c_prime);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -309,6 +311,8 @@ struct propagate_ineqs_tactic::imp {
|
|||
m_new_goal->assert_expr(m_util.mk_le(p, m_util.mk_numeral(rational(u), m_util.is_int(p))));
|
||||
}
|
||||
}
|
||||
nm.del(l);
|
||||
nm.del(u);
|
||||
}
|
||||
|
||||
bool is_x_minus_y_eq_0(expr * t, expr * & x, expr * & y) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue