3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-29 11:55:51 +00:00

updates to solver interface and adding some saturation rules

This commit is contained in:
Nikolaj Bjorner 2023-12-17 18:16:47 -08:00
parent 172d0ea685
commit 21791f12bf
9 changed files with 178 additions and 206 deletions

View file

@ -278,7 +278,7 @@ namespace polysat {
return ctx.get_trail_stack();
}
void solver::add_polysat_clause(char const* name, core_vector cs, bool is_redundant) {
bool solver::add_polysat_clause(char const* name, core_vector cs, bool is_redundant) {
sat::literal_vector lits;
for (auto e : cs) {
if (std::holds_alternative<dependency>(e)) {
@ -297,7 +297,11 @@ namespace polysat {
else if (std::holds_alternative<signed_constraint>(e))
lits.push_back(ctx.mk_literal(constraint2expr(*std::get_if<signed_constraint>(&e))));
}
for (auto lit : lits)
if (s().value(lit) == l_true)
return false;
s().add_clause(lits.size(), lits.data(), sat::status::th(is_redundant, get_id(), nullptr));
return true;
}
void solver::get_antecedents(literal l, sat::ext_justification_idx idx, literal_vector& r, bool probing) {