mirror of
https://github.com/Z3Prover/z3
synced 2025-07-25 13:47:01 +00:00
fix learned annotation on ternary
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
5a2b072ddf
commit
ede12553f2
6 changed files with 56 additions and 19 deletions
|
@ -52,7 +52,7 @@ namespace sat {
|
|||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
void erase_binary_watch(watch_list& wlist, literal l) {
|
||||
watch_list::iterator it = wlist.begin(), end = wlist.end();
|
||||
watch_list::iterator it2 = it;
|
||||
|
@ -70,6 +70,30 @@ namespace sat {
|
|||
VERIFY(found);
|
||||
}
|
||||
|
||||
void erase_ternary_watch(watch_list& wlist, literal l1, literal l2) {
|
||||
watch_list::iterator it = wlist.begin(), end = wlist.end();
|
||||
watch_list::iterator it2 = it;
|
||||
bool found = false;
|
||||
for (; it != end; ++it) {
|
||||
if (it->is_ternary_clause() && it->get_literal1() == l1 && it->get_literal2() == l2) {
|
||||
found = true;
|
||||
continue;
|
||||
}
|
||||
*it2 = *it;
|
||||
++it2;
|
||||
}
|
||||
wlist.set_end(it2);
|
||||
VERIFY(found);
|
||||
}
|
||||
|
||||
void set_ternary_learned(watch_list& wlist, literal l1, literal l2, bool learned) {
|
||||
for (watched& w : wlist) {
|
||||
if (w.is_ternary_clause() && w.get_literal1() == l1 && w.get_literal2() == l2) {
|
||||
w.set_learned(learned);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void conflict_cleanup(watch_list::iterator it, watch_list::iterator it2, watch_list& wlist) {
|
||||
watch_list::iterator end = wlist.end();
|
||||
for (; it != end; ++it, ++it2)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue