3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-24 17:45:32 +00:00
z3/src/math/polysat/constraint.cpp
Jakob Rath 9e505d60f0
Separate constraint creation from activation; add sign/polarity to constraints (#5217)
* Separate constraint creation from activation

* Basic recursive handling of disjunctive lemmas for unit tests

* Set learned constraint to true immediately

* Preliminary support for negated constraints
2021-04-26 09:55:58 -07:00

44 lines
1.2 KiB
C++

/*++
Copyright (c) 2021 Microsoft Corporation
Module Name:
polysat constraints
Author:
Nikolaj Bjorner (nbjorner) 2021-03-19
Jakob Rath 2021-04-6
--*/
#include "math/polysat/constraint.h"
#include "math/polysat/solver.h"
#include "math/polysat/log.h"
#include "math/polysat/var_constraint.h"
#include "math/polysat/eq_constraint.h"
#include "math/polysat/ule_constraint.h"
namespace polysat {
eq_constraint& constraint::to_eq() {
return *dynamic_cast<eq_constraint*>(this);
}
eq_constraint const& constraint::to_eq() const {
return *dynamic_cast<eq_constraint const*>(this);
}
constraint* constraint::eq(unsigned lvl, bool_var bvar, csign_t sign, pdd const& p, p_dependency_ref& d) {
return alloc(eq_constraint, lvl, bvar, sign, p, d);
}
constraint* constraint::viable(unsigned lvl, bool_var bvar, csign_t sign, pvar v, bdd const& b, p_dependency_ref& d) {
return alloc(var_constraint, lvl, bvar, sign, v, b, d);
}
constraint* constraint::ule(unsigned lvl, bool_var bvar, csign_t sign, pdd const& a, pdd const& b, p_dependency_ref& d) {
return alloc(ule_constraint, lvl, bvar, sign, a, b, d);
}
}