3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-29 03:45:51 +00:00

refactor weighted theory solver into own file

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2014-03-29 16:54:12 -07:00
parent 8d23b2b813
commit d67f1f36c4
5 changed files with 511 additions and 490 deletions

View file

@ -41,7 +41,7 @@ namespace opt {
m_context(mgr, m_params),
m(mgr),
m_dump_benchmarks(false),
m_fm(m) {
m_fm(alloc(filter_model_converter, m)) {
m_logic = l;
if (m_logic != symbol::null)
m_context.set_logic(m_logic);
@ -231,20 +231,20 @@ namespace opt {
if (typeid(smt::theory_inf_arith) == typeid(opt)) {
smt::theory_inf_arith& th = dynamic_cast<smt::theory_inf_arith&>(opt);
return expr_ref(th.mk_ge(m_fm, v, val), m);
return expr_ref(th.mk_ge(mc(), v, val), m);
}
if (typeid(smt::theory_mi_arith) == typeid(opt)) {
smt::theory_mi_arith& th = dynamic_cast<smt::theory_mi_arith&>(opt);
SASSERT(val.is_finite());
return expr_ref(th.mk_ge(m_fm, v, val.get_numeral()), m);
return expr_ref(th.mk_ge(mc(), v, val.get_numeral()), m);
}
if (typeid(smt::theory_i_arith) == typeid(opt)) {
SASSERT(val.is_finite());
SASSERT(val.get_infinitesimal().is_zero());
smt::theory_i_arith& th = dynamic_cast<smt::theory_i_arith&>(opt);
return expr_ref(th.mk_ge(m_fm, v, val.get_rational()), m);
return expr_ref(th.mk_ge(mc(), v, val.get_rational()), m);
}
// difference logic?