mirror of
https://github.com/Z3Prover/z3
synced 2025-08-23 03:27:52 +00:00
This commit is contained in:
parent
6c0a790576
commit
d3194bb8a8
3 changed files with 23 additions and 12 deletions
|
@ -54,6 +54,11 @@ namespace q {
|
|||
ctx.add_root(~l, lit);
|
||||
}
|
||||
}
|
||||
else if (is_ground(q->get_expr())) {
|
||||
auto lit = ctx.internalize(q->get_expr(), l.sign(), false, false);
|
||||
add_clause(~l, lit);
|
||||
ctx.add_root(~l, lit);
|
||||
}
|
||||
else {
|
||||
ctx.push_vec(m_universal, l);
|
||||
if (ctx.get_config().m_ematching)
|
||||
|
@ -78,8 +83,7 @@ namespace q {
|
|||
}
|
||||
|
||||
std::ostream& solver::display(std::ostream& out) const {
|
||||
m_ematch.display(out);
|
||||
return out;
|
||||
return m_ematch.display(out);
|
||||
}
|
||||
|
||||
std::ostream& solver::display_constraint(std::ostream& out, sat::ext_constraint_idx idx) const {
|
||||
|
|
|
@ -93,14 +93,19 @@ namespace sat {
|
|||
|
||||
void dual_solver::add_root(unsigned sz, literal const* clause) {
|
||||
flush();
|
||||
if (sz == 1) {
|
||||
if (false && sz == 1) {
|
||||
TRACE("dual", tout << "unit: " << clause[0] << "\n";);
|
||||
m_units.push_back(clause[0]);
|
||||
return;
|
||||
}
|
||||
literal root(m_solver.mk_var(), false);
|
||||
for (unsigned i = 0; i < sz; ++i)
|
||||
m_solver.mk_clause(root, ~ext2lit(clause[i]), status::input());
|
||||
literal root;
|
||||
if (sz == 1)
|
||||
root = ext2lit(clause[0]);
|
||||
else {
|
||||
root = literal(m_solver.mk_var(), false);
|
||||
for (unsigned i = 0; i < sz; ++i)
|
||||
m_solver.mk_clause(root, ~ext2lit(clause[i]), status::input());
|
||||
}
|
||||
m_roots.push_back(~root);
|
||||
TRACE("dual", tout << "root: " << ~root << " => " << literal_vector(sz, clause) << "\n";);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue