3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-22 16:45:31 +00:00

use simpler looking for loop

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2022-04-12 10:13:44 +02:00
parent d98a93bcc8
commit f2b9c27ed6

View file

@ -20,17 +20,12 @@ namespace polysat {
bool ve_reduction::perform(solver& s, pvar v, conflict& core) {
// without any further hints, we just do core reduction with the stronger premise "C contains a c' that evaluates to false",
// and kick out all other constraints.
auto pred = [&s, v](signed_constraint c) -> bool {
return !c->contains_var(v) && c.is_currently_false(s);
};
auto it = std::find_if(core.begin(), core.end(), pred);
if (it != core.end()) {
signed_constraint c = *it;
core.reset();
core.set(c);
// core.insert(c);
// core.set_needs_model(true);
return true;
for (signed_constraint c : core) {
if (!c->contains_var(v) && c.is_currently_false(s)) {
core.reset();
core.set(c);
return true;
}
}
return false;
}