mirror of
https://github.com/Z3Prover/z3
synced 2025-07-31 08:23:17 +00:00
adding soft-assertions
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
e50e02e656
commit
552cbd840f
8 changed files with 30 additions and 5 deletions
|
@ -110,6 +110,7 @@ namespace sat {
|
|||
m_minimize_core = p.minimize_core();
|
||||
m_minimize_core_partial = p.minimize_core_partial();
|
||||
m_optimize_model = p.optimize_model();
|
||||
m_soft_assumptions = p.soft_assumptions();
|
||||
m_bcd = p.bcd();
|
||||
m_dyn_sub_res = p.dyn_sub_res();
|
||||
}
|
||||
|
|
|
@ -72,6 +72,7 @@ namespace sat {
|
|||
bool m_minimize_core;
|
||||
bool m_minimize_core_partial;
|
||||
bool m_optimize_model;
|
||||
bool m_soft_assumptions;
|
||||
bool m_bcd;
|
||||
|
||||
|
||||
|
|
|
@ -22,5 +22,6 @@ def_module_params('sat',
|
|||
('minimize_core', BOOL, False, 'minimize computed core'),
|
||||
('minimize_core_partial', BOOL, False, 'apply partial (cheap) core minimization'),
|
||||
('optimize_model', BOOL, False, 'enable optimization of soft constraints'),
|
||||
('soft_assumptions', BOOL, False, 'disable assumptions that are forced during unit propagation'),
|
||||
('bcd', BOOL, False, 'enable blocked clause decomposition for equality extraction'),
|
||||
('dimacs.core', BOOL, False, 'extract core from DIMACS benchmarks')))
|
||||
|
|
|
@ -914,17 +914,26 @@ namespace sat {
|
|||
|
||||
for (unsigned i = 0; !inconsistent() && i < m_user_scope_literals.size(); ++i) {
|
||||
literal nlit = ~m_user_scope_literals[i];
|
||||
assign(nlit, justification());
|
||||
// propagate(false);
|
||||
assign(nlit, justification());
|
||||
}
|
||||
|
||||
for (unsigned i = 0; !inconsistent() && i < num_lits; ++i) {
|
||||
literal lit = lits[i];
|
||||
SASSERT(is_external((lit).var()));
|
||||
m_assumption_set.insert(lit);
|
||||
m_assumptions.push_back(lit);
|
||||
assign(lit, justification());
|
||||
// propagate(false);
|
||||
|
||||
if (m_config.soft_assumptions) {
|
||||
if (value(lit) == l_undef) {
|
||||
m_assumptions.push_back(lit);
|
||||
assign(lit, justification());
|
||||
}
|
||||
propagate(false);
|
||||
}
|
||||
else {
|
||||
m_assumptions.push_back(lit);
|
||||
assign(lit, justification());
|
||||
// propagate(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue