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:
parent
d98a93bcc8
commit
f2b9c27ed6
1 changed files with 6 additions and 11 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue