mirror of
https://github.com/Z3Prover/z3
synced 2025-08-23 11:37:54 +00:00
merge with master
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
commit
c513f3ca09
883 changed files with 13979 additions and 16480 deletions
|
@ -24,7 +24,6 @@ Notes:
|
|||
#include "tactic/core/solve_eqs_tactic.h"
|
||||
#include "tactic/core/elim_uncnstr_tactic.h"
|
||||
#include "smt/tactic/smt_tactic.h"
|
||||
// include"mip_tactic.h"
|
||||
#include "tactic/arith/add_bounds_tactic.h"
|
||||
#include "tactic/arith/pb2bv_tactic.h"
|
||||
#include "tactic/arith/lia2pb_tactic.h"
|
||||
|
@ -37,15 +36,12 @@ Notes:
|
|||
#include "tactic/arith/probe_arith.h"
|
||||
|
||||
struct quasi_pb_probe : public probe {
|
||||
virtual result operator()(goal const & g) {
|
||||
result operator()(goal const & g) override {
|
||||
bool found_non_01 = false;
|
||||
bound_manager bm(g.m());
|
||||
bm(g);
|
||||
rational l, u; bool st;
|
||||
bound_manager::iterator it = bm.begin();
|
||||
bound_manager::iterator end = bm.end();
|
||||
for (; it != end; ++it) {
|
||||
expr * t = *it;
|
||||
for (expr * t : bm) {
|
||||
if (bm.has_lower(t, l, st) && bm.has_upper(t, u, st) && (l.is_zero() || l.is_one()) && (u.is_zero() || u.is_one()))
|
||||
continue;
|
||||
if (found_non_01)
|
||||
|
|
|
@ -26,8 +26,10 @@ Notes:
|
|||
#include "tactic/bv/max_bv_sharing_tactic.h"
|
||||
#include "sat/tactic/sat_tactic.h"
|
||||
#include "tactic/arith/nla2bv_tactic.h"
|
||||
#include "tactic/arith/lia2card_tactic.h"
|
||||
#include "tactic/core/ctx_simplify_tactic.h"
|
||||
#include "tactic/core/cofactor_term_ite_tactic.h"
|
||||
#include "nlsat/tactic/qfnra_nlsat_tactic.h"
|
||||
|
||||
static tactic * mk_qfnia_bv_solver(ast_manager & m, params_ref const & p_ref) {
|
||||
params_ref p = p_ref;
|
||||
|
@ -61,8 +63,6 @@ static tactic * mk_qfnia_premable(ast_manager & m, params_ref const & p_ref) {
|
|||
ctx_simp_p.set_uint("max_depth", 30);
|
||||
ctx_simp_p.set_uint("max_steps", 5000000);
|
||||
|
||||
params_ref simp_p = p_ref;
|
||||
simp_p.set_bool("hoist_mul", true);
|
||||
|
||||
params_ref elim_p = p_ref;
|
||||
elim_p.set_uint("max_memory",20);
|
||||
|
@ -73,21 +73,46 @@ static tactic * mk_qfnia_premable(ast_manager & m, params_ref const & p_ref) {
|
|||
using_params(mk_ctx_simplify_tactic(m), ctx_simp_p),
|
||||
using_params(mk_simplify_tactic(m), pull_ite_p),
|
||||
mk_elim_uncnstr_tactic(m),
|
||||
skip_if_failed(using_params(mk_cofactor_term_ite_tactic(m), elim_p)),
|
||||
using_params(mk_simplify_tactic(m), simp_p));
|
||||
mk_lia2card_tactic(m),
|
||||
skip_if_failed(using_params(mk_cofactor_term_ite_tactic(m), elim_p)));
|
||||
}
|
||||
|
||||
static tactic * mk_qfnia_sat_solver(ast_manager & m, params_ref const & p) {
|
||||
params_ref nia2sat_p = p;
|
||||
nia2sat_p.set_uint("nla2bv_max_bv_size", 64);
|
||||
nia2sat_p.set_uint("nla2bv_max_bv_size", 64);
|
||||
params_ref simp_p = p;
|
||||
simp_p.set_bool("hoist_mul", true); // hoist multipliers to create smaller circuits.
|
||||
|
||||
return and_then(mk_nla2bv_tactic(m, nia2sat_p),
|
||||
return and_then(using_params(mk_simplify_tactic(m), simp_p),
|
||||
mk_nla2bv_tactic(m, nia2sat_p),
|
||||
mk_qfnia_bv_solver(m, p),
|
||||
mk_fail_if_undecided_tactic());
|
||||
}
|
||||
|
||||
static tactic * mk_qfnia_nlsat_solver(ast_manager & m, params_ref const & p) {
|
||||
params_ref nia2sat_p = p;
|
||||
nia2sat_p.set_uint("nla2bv_max_bv_size", 64);
|
||||
params_ref simp_p = p;
|
||||
simp_p.set_bool("som", true); // expand into sums of monomials
|
||||
simp_p.set_bool("factor", false);
|
||||
|
||||
|
||||
return and_then(using_params(mk_simplify_tactic(m), simp_p),
|
||||
try_for(mk_qfnra_nlsat_tactic(m, simp_p), 3000),
|
||||
mk_fail_if_undecided_tactic());
|
||||
}
|
||||
|
||||
static tactic * mk_qfnia_smt_solver(ast_manager& m, params_ref const& p) {
|
||||
params_ref simp_p = p;
|
||||
simp_p.set_bool("som", true); // expand into sums of monomials
|
||||
return and_then(using_params(mk_simplify_tactic(m), simp_p), mk_smt_tactic());
|
||||
}
|
||||
|
||||
tactic * mk_qfnia_tactic(ast_manager & m, params_ref const & p) {
|
||||
|
||||
return and_then(mk_qfnia_premable(m, p),
|
||||
or_else(mk_qfnia_sat_solver(m, p),
|
||||
mk_smt_tactic()));
|
||||
try_for(mk_qfnia_smt_solver(m, p), 2000),
|
||||
mk_qfnia_nlsat_solver(m, p),
|
||||
mk_qfnia_smt_solver(m, p)));
|
||||
}
|
||||
|
|
|
@ -33,7 +33,9 @@ static tactic * mk_qfnra_sat_solver(ast_manager& m, params_ref const& p, unsigne
|
|||
}
|
||||
|
||||
tactic * mk_qfnra_tactic(ast_manager & m, params_ref const& p) {
|
||||
params_ref p1 = p;
|
||||
params_ref p0 = p;
|
||||
p0.set_bool("inline_vars", true);
|
||||
params_ref p1 = p;
|
||||
p1.set_uint("seed", 11);
|
||||
p1.set_bool("factor", false);
|
||||
params_ref p2 = p;
|
||||
|
@ -42,7 +44,7 @@ tactic * mk_qfnra_tactic(ast_manager & m, params_ref const& p) {
|
|||
|
||||
return and_then(mk_simplify_tactic(m, p),
|
||||
mk_propagate_values_tactic(m, p),
|
||||
or_else(try_for(mk_qfnra_nlsat_tactic(m, p), 5000),
|
||||
or_else(try_for(mk_qfnra_nlsat_tactic(m, p0), 5000),
|
||||
try_for(mk_qfnra_nlsat_tactic(m, p1), 10000),
|
||||
mk_qfnra_sat_solver(m, p, 4),
|
||||
and_then(try_for(mk_smt_tactic(), 5000), mk_fail_if_undecided_tactic()),
|
||||
|
|
|
@ -51,10 +51,9 @@ public:
|
|||
, m_inc_use_sat(false)
|
||||
{}
|
||||
|
||||
virtual ~qfufbv_ackr_tactic() { }
|
||||
~qfufbv_ackr_tactic() override { }
|
||||
|
||||
virtual void operator()(goal_ref const & g,
|
||||
goal_ref_buffer & result) {
|
||||
void operator()(goal_ref const & g, goal_ref_buffer & result) override {
|
||||
ast_manager& m(g->m());
|
||||
tactic_report report("qfufbv_ackr", *g);
|
||||
fail_if_unsat_core_generation("qfufbv_ackr", g);
|
||||
|
@ -66,8 +65,8 @@ public:
|
|||
const unsigned sz = g->size();
|
||||
for (unsigned i = 0; i < sz; i++) flas.push_back(g->form(i));
|
||||
scoped_ptr<solver> uffree_solver = setup_sat();
|
||||
scoped_ptr<lackr> imp = alloc(lackr, m, m_p, m_st, flas, uffree_solver.get());
|
||||
const lbool o = imp->operator()();
|
||||
lackr imp(m, m_p, m_st, flas, uffree_solver.get());
|
||||
const lbool o = imp.operator()();
|
||||
flas.reset();
|
||||
// report result
|
||||
goal_ref resg(alloc(goal, *g, true));
|
||||
|
@ -75,28 +74,28 @@ public:
|
|||
if (o != l_undef) result.push_back(resg.get());
|
||||
// report model
|
||||
if (g->models_enabled() && (o == l_true)) {
|
||||
model_ref abstr_model = imp->get_model();
|
||||
g->add(mk_qfufbv_ackr_model_converter(m, imp->get_info(), abstr_model));
|
||||
model_ref abstr_model = imp.get_model();
|
||||
g->add(mk_qfufbv_ackr_model_converter(m, imp.get_info(), abstr_model));
|
||||
}
|
||||
}
|
||||
|
||||
void updt_params(params_ref const & _p) {
|
||||
void updt_params(params_ref const & _p) override {
|
||||
qfufbv_tactic_params p(_p);
|
||||
m_use_sat = p.sat_backend();
|
||||
m_inc_use_sat = p.inc_sat_backend();
|
||||
}
|
||||
|
||||
virtual void collect_statistics(statistics & st) const {
|
||||
void collect_statistics(statistics & st) const override {
|
||||
ackermannization_params p(m_p);
|
||||
if (!p.eager()) st.update("lackr-its", m_st.m_it);
|
||||
st.update("ackr-constraints", m_st.m_ackrs_sz);
|
||||
}
|
||||
|
||||
virtual void reset_statistics() { m_st.reset(); }
|
||||
void reset_statistics() override { m_st.reset(); }
|
||||
|
||||
virtual void cleanup() { }
|
||||
void cleanup() override { }
|
||||
|
||||
virtual tactic* translate(ast_manager& m) {
|
||||
tactic* translate(ast_manager& m) override {
|
||||
return alloc(qfufbv_ackr_tactic, m, m_p);
|
||||
}
|
||||
private:
|
||||
|
@ -107,7 +106,7 @@ private:
|
|||
bool m_inc_use_sat;
|
||||
|
||||
solver* setup_sat() {
|
||||
solver * sat(NULL);
|
||||
solver * sat(nullptr);
|
||||
if (m_use_sat) {
|
||||
if (m_inc_use_sat) {
|
||||
sat = mk_inc_sat_solver(m_m, m_p);
|
||||
|
|
|
@ -24,7 +24,6 @@ Revision History:
|
|||
#include "qe/qe_tactic.h"
|
||||
#include "qe/qe_lite.h"
|
||||
#include "qe/qsat.h"
|
||||
#include "qe/nlqsat.h"
|
||||
#include "tactic/core/ctx_simplify_tactic.h"
|
||||
#include "smt/tactic/smt_tactic.h"
|
||||
#include "tactic/core/elim_term_ite_tactic.h"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue