3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-05 23:05:46 +00:00

Polysat disjunctive lemmas (WIP) (#5275)

* Extend search state by boolean literals

* Only resolve against positive equality

* mk_dep_ref

* Make clause non-owning

* scoped_clause

* Use scoped_clause

* minor

* scoped_ptr move assignment

* WIP: internal handling of disjunctive constraints

* leaf_value

* disjunctive constraints continued

* Fix bool_lit

* Actually add constraints to storage

* Some fixes

* more fixes

* constraint should have a bool_lit instead of a bool_var

* propagate(bool_lit)

* updates

* interface changes

* small fixes

* Make sat::dimacs_lit's constructor explicit

(otherwise, calling operator<< with sat::literal is ambiguous)

* Use sat::literal

* Print test name at the beginning

* Convention: constraint corresponds to the positive boolean literal

* Make constraint ownership more explicit

* clause stores literals
This commit is contained in:
Jakob Rath 2021-05-21 22:50:25 +02:00 committed by GitHub
parent 49e9782238
commit 28996429df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 1196 additions and 360 deletions

View file

@ -114,6 +114,7 @@ namespace polysat {
m_trail.push_back(trail_i::set_bound_i);
m_rows.push_back(std::make_pair(v, sz));
rational z(0), o(1);
SASSERT(!c.is_undef());
if (c.is_positive())
fp.set_bounds(v, z, z);
else
@ -168,6 +169,7 @@ namespace polysat {
}
void linear_solver::activate_constraint(constraint& c) {
SASSERT(!c.is_undef());
switch (c.kind()) {
case ckind_t::eq_t:
assert_eq(c.to_eq());
@ -199,7 +201,7 @@ namespace polysat {
if (m_mono2var.find(m, m1))
return m1.var;
m.vars = static_cast<unsigned*>(m_alloc.allocate(var.size()*sizeof(unsigned)));
for (unsigned i = 0; i < var.size(); var.data())
for (unsigned i = 0; i < var.size(); ++i)
m.vars[i] = var[i];
m.var = fresh_var(sz);
m_mono2var.insert(m);