3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-12 20:18:18 +00:00

enable qe-lite for UFNIA benchmarks

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2016-03-22 15:41:21 -07:00
parent 4badc52dc3
commit fd6fe87c5d
4 changed files with 62 additions and 37 deletions

View file

@ -1168,6 +1168,7 @@ namespace qe {
pred_abs m_pred_abs; pred_abs m_pred_abs;
qe::mbp m_mbp; qe::mbp m_mbp;
kernel m_kernel; kernel m_kernel;
vector<app_ref_vector> m_vars;
imp(ast_manager& m): imp(ast_manager& m):
m(m), m(m),
@ -1180,14 +1181,36 @@ namespace qe {
m_fmls.push_back(e); m_fmls.push_back(e);
} }
lbool check(svector<bool> const& is_max, func_decl_ref_vector const& vars, app* t) { lbool check(svector<bool> const& is_max, app_ref_vector const& vars, app* t) {
// Assume this is the only call to check. // Assume this is the only call to check.
expr_ref_vector defs(m); expr_ref_vector defs(m);
app_ref_vector free_vars(m), vars1(m);
expr_ref fml = mk_and(m_fmls); expr_ref fml = mk_and(m_fmls);
m_pred_abs.get_free_vars(fml, free_vars);
m_pred_abs.abstract_atoms(fml, defs); m_pred_abs.abstract_atoms(fml, defs);
fml = m_pred_abs.mk_abstract(fml); fml = m_pred_abs.mk_abstract(fml);
m_kernel.assert_expr(mk_and(defs)); m_kernel.assert_expr(mk_and(defs));
m_kernel.assert_expr(fml); m_kernel.assert_expr(fml);
obj_hashtable<app> var_set;
for (unsigned i = 0; i < vars.size(); ++i) {
var_set.insert(vars[i]);
}
for (unsigned i = 0; i < free_vars.size(); ++i) {
app* v = free_vars[i].get();
if (!var_set.contains(v)) {
vars1.push_back(v);
}
}
bool is_m = is_max[0];
for (unsigned i = 0; i < vars.size(); ++i) {
if (is_m != is_max[i]) {
m_vars.push_back(vars1);
vars1.reset();
is_m = is_max[i];
}
vars1.push_back(vars[i]);
}
// TBD // TBD
return l_undef; return l_undef;
@ -1212,7 +1235,7 @@ namespace qe {
} }
} }
lbool min_max_opt::check(svector<bool> const& is_max, func_decl_ref_vector const& vars, app* t) { lbool min_max_opt::check(svector<bool> const& is_max, app_ref_vector const& vars, app* t) {
return m_imp->check(is_max, vars, t); return m_imp->check(is_max, vars, t);
} }

View file

@ -121,7 +121,7 @@ namespace qe {
~min_max_opt(); ~min_max_opt();
void add(expr* e); void add(expr* e);
void add(expr_ref_vector const& fmls); void add(expr_ref_vector const& fmls);
lbool check(svector<bool> const& is_max, func_decl_ref_vector const& vars, app* t); lbool check(svector<bool> const& is_max, app_ref_vector const& vars, app* t);
}; };

View file

@ -1308,7 +1308,7 @@ namespace smt {
if (!gcd_test()) if (!gcd_test())
return FC_CONTINUE; return FC_CONTINUE;
if (m_params.m_arith_euclidean_solver) if (m_params.m_arith_euclidean_solver || (0 == (1 + m_branch_cut_counter) % 80))
apply_euclidean_solver(); apply_euclidean_solver();
if (get_context().inconsistent()) if (get_context().inconsistent())

View file

@ -22,6 +22,7 @@ Revision History:
#include"solve_eqs_tactic.h" #include"solve_eqs_tactic.h"
#include"elim_uncnstr_tactic.h" #include"elim_uncnstr_tactic.h"
#include"qe_tactic.h" #include"qe_tactic.h"
#include"qe_lite.h"
#include"qsat.h" #include"qsat.h"
#include"nlqsat.h" #include"nlqsat.h"
#include"ctx_simplify_tactic.h" #include"ctx_simplify_tactic.h"
@ -61,6 +62,7 @@ static tactic * mk_no_solve_eq_preprocessor(ast_manager & m) {
tactic * mk_ufnia_tactic(ast_manager & m, params_ref const & p) { tactic * mk_ufnia_tactic(ast_manager & m, params_ref const & p) {
tactic * st = and_then(mk_no_solve_eq_preprocessor(m), tactic * st = and_then(mk_no_solve_eq_preprocessor(m),
mk_qe_lite_tactic(m, p),
mk_smt_tactic()); mk_smt_tactic());
st->updt_params(p); st->updt_params(p);
return st; return st;