mirror of
https://github.com/Z3Prover/z3
synced 2025-10-22 07:10:34 +00:00
n/a
This commit is contained in:
parent
4cadf6d9f2
commit
06ebf9a02a
6 changed files with 272 additions and 107 deletions
|
@ -256,6 +256,32 @@ namespace polysat {
|
|||
|
||||
void solver::add_polysat_clause(char const* name, core_vector cs, bool is_redundant) {
|
||||
sat::literal_vector lits;
|
||||
signed_constraint sc;
|
||||
unsigned constraint_count = 0;
|
||||
for (auto e : cs) {
|
||||
if (std::holds_alternative<signed_constraint>(e)) {
|
||||
sc = *std::get_if<signed_constraint>(&e);
|
||||
constraint_count++;
|
||||
}
|
||||
}
|
||||
if (constraint_count == 1) {
|
||||
auto lit = ctx.mk_literal(constraint2expr(sc));
|
||||
svector<euf::enode_pair> eqs;
|
||||
for (auto e : cs) {
|
||||
if (std::holds_alternative<dependency>(e)) {
|
||||
auto d = *std::get_if<dependency>(&e);
|
||||
if (d.is_literal())
|
||||
lits.push_back(d.literal());
|
||||
else if (d.is_eq()) {
|
||||
auto [v1, v2] = d.eq();
|
||||
eqs.push_back({ var2enode(v1), var2enode(v2) });
|
||||
}
|
||||
}
|
||||
}
|
||||
ctx.propagate(lit, euf::th_explain::propagate(*this, lits, eqs, lit, nullptr));
|
||||
return;
|
||||
}
|
||||
|
||||
for (auto e : cs) {
|
||||
if (std::holds_alternative<dependency>(e)) {
|
||||
auto d = *std::get_if<dependency>(&e);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue