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

@ -0,0 +1,47 @@
/*++
Copyright (c) 2021 Microsoft Corporation
Module Name:
polysat search state
Author:
Nikolaj Bjorner (nbjorner) 2021-03-19
Jakob Rath 2021-04-6
--*/
#include "math/polysat/search_state.h"
namespace polysat {
std::ostream& search_item::display(std::ostream& out) const {
switch (kind()) {
case search_item_k::assignment:
return out << "assignment(v" << var() << ")";
case search_item_k::boolean:
return out << "boolean(" << lit() << ")";
}
UNREACHABLE();
return out;
}
void search_state::push_assignment(pvar p, rational const& r) {
m_items.push_back(search_item::assignment(p));
m_assignment.push_back({p, r});
}
void search_state::push_boolean(sat::literal lit) {
m_items.push_back(search_item::boolean(lit));
}
void search_state::pop() {
auto const& item = m_items.back();
if (item.is_assignment()) {
m_assignment.pop_back();
}
m_items.pop_back();
}
}