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

first cut of fpa solver

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2020-10-01 07:18:36 -07:00
parent 4cb07a539b
commit 2087c01cac
7 changed files with 601 additions and 31 deletions

View file

@ -126,6 +126,14 @@ namespace euf {
return !was_true;
}
bool th_euf_solver::add_units(sat::literal_vector const& lits) {
bool is_new = false;
for (auto lit : lits)
if (add_unit(lit))
is_new = true;
return is_new;
}
bool th_euf_solver::add_clause(sat::literal a, sat::literal b) {
bool was_true = is_true(a, b);
sat::literal lits[2] = { a, b };
@ -155,6 +163,21 @@ namespace euf {
return !was_true;
}
void th_euf_solver::add_equiv(sat::literal a, sat::literal b) {
add_clause(~a, b);
add_clause(a, ~b);
}
void th_euf_solver::add_equiv_and(sat::literal a, sat::literal_vector const& bs) {
for (auto b : bs)
add_clause(~a, b);
sat::literal_vector _bs;
for (auto b : bs)
_bs.push_back(~b);
_bs.push_back(a);
add_clause(_bs);
}
bool th_euf_solver::is_true(sat::literal lit) {
return ctx.s().value(lit) == l_true;
}