3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-03-02 11:46:55 +00:00

clause_builder should not fail on always-true literals

Otherwise, e.g. when adding axioms, the caller would have to check each literal before adding it.
This commit is contained in:
Jakob Rath 2022-01-18 10:22:24 +01:00
parent ebc4df1ece
commit e005838129
5 changed files with 21 additions and 4 deletions

View file

@ -674,6 +674,7 @@ namespace polysat {
SASSERT(std::find(reason_builder.begin(), reason_builder.end(), ~lit));
clause_ref reason = reason_builder.build();
SASSERT(reason);
if (reason->empty()) {
report_unsat();
@ -788,8 +789,10 @@ namespace polysat {
cb.push(c);
}
clause_ref clause = cb.build();
clause->set_redundant(is_redundant);
add_clause(*clause);
if (clause) {
clause->set_redundant(is_redundant);
add_clause(*clause);
}
}
void solver::add_clause(signed_constraint c1, signed_constraint c2, bool is_redundant) {