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

add systematic way to combine lia_move results

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2025-03-16 10:24:44 -07:00 committed by Lev Nachmanson
parent 00277ba3cf
commit ff5ae4d1ed
2 changed files with 40 additions and 26 deletions

View file

@ -53,6 +53,31 @@ namespace lp {
return "strange";
}
inline lia_move join(lia_move r1, lia_move r2) {
if (r1 == r2)
return r1;
if (r1 == lia_move::undef)
return r2;
if (r2 == lia_move::undef)
return r1;
if (r1 == lia_move::conflict || r2 == lia_move::conflict)
return lia_move::conflict;
if (r1 == lia_move::unsat || r2 == lia_move::unsat)
return lia_move::unsat;
if (r1 == lia_move::cancelled || r2 == lia_move::cancelled)
return lia_move::cancelled;
if (r1 == lia_move::sat || r2 == lia_move::sat)
return lia_move::sat;
if (r1 == lia_move::continue_with_check || r2 == lia_move::continue_with_check)
return lia_move::continue_with_check;
if (r1 == lia_move::cut || r2 == lia_move::cut)
return lia_move::cut;
if (r1 == lia_move::branch || r2 == lia_move::branch)
return lia_move::branch;
UNREACHABLE();
return r1;
}
inline std::ostream& operator<<(std::ostream& out, lia_move const& m) {
return out << lia_move_to_string(m);
}