3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-27 10:55:50 +00:00

add outline for ule constraints, change bit to var constraints

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2021-04-16 12:31:11 -07:00
parent 5706c7a93b
commit 9df7e9a029
12 changed files with 224 additions and 113 deletions

View file

@ -138,13 +138,24 @@ namespace polysat {
}
void solver::add_diseq(pdd const& p, unsigned dep) {
#if 0
// Basically:
auto slack = add_var(p.size());
p = p + var(slack);
add_eq(p, dep);
m_viable[slack] &= slack != 0;
#endif
if (p.is_val()) {
if (!p.is_zero())
return;
// set conflict.
NOT_IMPLEMENTED_YET();
return;
}
unsigned sz = size(p.var());
auto slack = add_var(size(p.var()));
auto q = p + var(slack);
add_eq(q, dep);
bdd non_zero = m_bdd.mk_false();
for (unsigned i = 0; i < sz; ++i)
non_zero |= m_bdd.mk_var(i);
p_dependency_ref d(mk_dep(dep), m_dm);
constraint* c = constraint::viable(m_level, slack, non_zero, d);
m_constraints.push_back(c);
c->narrow(*this);
}
void solver::add_ule(pdd const& p, pdd const& q, unsigned dep) {
@ -352,8 +363,6 @@ namespace polysat {
* 6. Otherwise, add accumulated constraints to explanation for the next viable solution, prune
* viable solutions by excluding the previous guess.
*
* todos: replace accumulation of sub by something more incremental.
*
*/
void solver::resolve_conflict() {
LOG_H2("Resolve conflict");