mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 09:35:32 +00:00
add option to bypass model converter during constraint addition. Simplify model definitions that come from blocked clauses
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
1101c927c9
commit
fbae881ece
5 changed files with 65 additions and 13 deletions
|
@ -178,24 +178,37 @@ bool solver::is_literal(ast_manager& m, expr* e) {
|
|||
|
||||
void solver::assert_expr(expr* f) {
|
||||
expr_ref fml(f, get_manager());
|
||||
model_converter_ref mc = get_model_converter();
|
||||
mc = concat(mc0(), mc.get());
|
||||
if (mc) {
|
||||
(*mc)(fml);
|
||||
if (m_enforce_model_conversion) {
|
||||
model_converter_ref mc = get_model_converter();
|
||||
mc = concat(mc0(), mc.get());
|
||||
if (mc) {
|
||||
(*mc)(fml);
|
||||
}
|
||||
}
|
||||
assert_expr_core(fml);
|
||||
}
|
||||
|
||||
void solver::assert_expr(expr* f, expr* t) {
|
||||
ast_manager& m = get_manager();
|
||||
expr_ref fml(f, m);
|
||||
expr_ref fml(f, m);
|
||||
expr_ref a(t, m);
|
||||
model_converter_ref mc = get_model_converter();
|
||||
mc = concat(mc0(), mc.get());
|
||||
if (mc) {
|
||||
(*mc)(fml);
|
||||
// (*mc)(a);
|
||||
if (m_enforce_model_conversion) {
|
||||
model_converter_ref mc = get_model_converter();
|
||||
mc = concat(mc0(), mc.get());
|
||||
if (mc) {
|
||||
(*mc)(fml);
|
||||
// (*mc)(a);
|
||||
}
|
||||
}
|
||||
assert_expr_core(fml, a);
|
||||
}
|
||||
|
||||
void solver::collect_param_descrs(param_descrs & r) {
|
||||
r.insert("solver.enforce_model_conversion", CPK_BOOL, "(default: true) enforce model conversion when asserting formulas");
|
||||
}
|
||||
|
||||
void solver::updt_params(params_ref const & p) {
|
||||
m_params.copy(p);
|
||||
m_enforce_model_conversion = m_params.get_bool("solver.enforce_model_conversion", true);
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,9 @@ public:
|
|||
*/
|
||||
class solver : public check_sat_result {
|
||||
params_ref m_params;
|
||||
bool m_enforce_model_conversion;
|
||||
public:
|
||||
solver(): m_enforce_model_conversion(true) {}
|
||||
virtual ~solver() {}
|
||||
|
||||
/**
|
||||
|
@ -56,7 +58,7 @@ public:
|
|||
/**
|
||||
\brief Update the solver internal settings.
|
||||
*/
|
||||
virtual void updt_params(params_ref const & p) { m_params.copy(p); }
|
||||
virtual void updt_params(params_ref const & p);
|
||||
|
||||
/**
|
||||
\brief Retrieve set of parameters set on solver.
|
||||
|
@ -67,7 +69,7 @@ public:
|
|||
\brief Store in \c r a description of the configuration
|
||||
parameters available in this solver.
|
||||
*/
|
||||
virtual void collect_param_descrs(param_descrs & r) {}
|
||||
virtual void collect_param_descrs(param_descrs & r);
|
||||
|
||||
/**
|
||||
\brief Enable/Disable model generation for this solver object.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue