mirror of
https://github.com/Z3Prover/z3
synced 2025-04-16 05:48:44 +00:00
merge sat_tactic from csp
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
ee07008fb9
commit
b11ec3bfbf
|
@ -21,6 +21,7 @@ Notes:
|
||||||
#include "tactic/tactical.h"
|
#include "tactic/tactical.h"
|
||||||
#include "sat/tactic/goal2sat.h"
|
#include "sat/tactic/goal2sat.h"
|
||||||
#include "sat/sat_solver.h"
|
#include "sat/sat_solver.h"
|
||||||
|
#include "sat/sat_params.hpp"
|
||||||
|
|
||||||
class sat_tactic : public tactic {
|
class sat_tactic : public tactic {
|
||||||
|
|
||||||
|
@ -36,6 +37,7 @@ class sat_tactic : public tactic {
|
||||||
m_solver(p, m.limit()),
|
m_solver(p, m.limit()),
|
||||||
m_params(p) {
|
m_params(p) {
|
||||||
SASSERT(!m.proofs_enabled());
|
SASSERT(!m.proofs_enabled());
|
||||||
|
updt_params(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
void operator()(goal_ref const & g,
|
void operator()(goal_ref const & g,
|
||||||
|
@ -130,13 +132,20 @@ class sat_tactic : public tactic {
|
||||||
lit2asm.insert(kv.m_value.index(), kv.m_key);
|
lit2asm.insert(kv.m_value.index(), kv.m_key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void updt_params(params_ref const& p) {
|
||||||
|
m_solver.updt_params(p);
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
struct scoped_set_imp {
|
struct scoped_set_imp {
|
||||||
sat_tactic * m_owner;
|
sat_tactic * m_owner;
|
||||||
|
|
||||||
scoped_set_imp(sat_tactic * o, imp * i):m_owner(o) {
|
scoped_set_imp(sat_tactic * o, imp * i):m_owner(o) {
|
||||||
m_owner->m_imp = i;
|
m_owner->m_imp = i;
|
||||||
|
m_owner->updt_params(m_owner->m_params);
|
||||||
}
|
}
|
||||||
|
|
||||||
~scoped_set_imp() {
|
~scoped_set_imp() {
|
||||||
|
@ -152,6 +161,8 @@ public:
|
||||||
sat_tactic(ast_manager & m, params_ref const & p):
|
sat_tactic(ast_manager & m, params_ref const & p):
|
||||||
m_imp(nullptr),
|
m_imp(nullptr),
|
||||||
m_params(p) {
|
m_params(p) {
|
||||||
|
sat_params p1(p);
|
||||||
|
m_params.set_bool("xor_solver", p1.xor_solver());
|
||||||
}
|
}
|
||||||
|
|
||||||
tactic * translate(ast_manager & m) override {
|
tactic * translate(ast_manager & m) override {
|
||||||
|
@ -164,6 +175,9 @@ public:
|
||||||
|
|
||||||
void updt_params(params_ref const & p) override {
|
void updt_params(params_ref const & p) override {
|
||||||
m_params = p;
|
m_params = p;
|
||||||
|
sat_params p1(p);
|
||||||
|
m_params.set_bool("xor_solver", p1.xor_solver());
|
||||||
|
if (m_imp) m_imp->updt_params(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
void collect_param_descrs(param_descrs & r) override {
|
void collect_param_descrs(param_descrs & r) override {
|
||||||
|
|
Loading…
Reference in a new issue