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

finish is-fixed

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2022-01-19 16:28:34 +01:00
parent e5767bf2b8
commit c00591daaf
8 changed files with 35 additions and 4 deletions

View file

@ -762,6 +762,25 @@ namespace euf {
}
bool solver::is_fixed(euf::enode* n, expr_ref& val, sat::literal_vector& explain) {
if (n->bool_var() != sat::null_bool_var) {
switch (s().value(n->bool_var())) {
case l_true:
val = m.mk_true();
explain.push_back(sat::literal(n->bool_var()));
return true;
case l_false:
val = m.mk_false();
explain.push_back(~sat::literal(n->bool_var()));
return true;
default:
return false;
}
}
for (auto const& thv : enode_th_vars(n)) {
auto* th = m_id2solver.get(thv.get_id(), nullptr);
if (th && !th->is_fixed(thv.get_var(), val, explain))
return true;
}
return false;
}