mirror of
https://github.com/Z3Prover/z3
synced 2025-06-02 20:31:21 +00:00
fix negative contains bug (#6312)
This commit is contained in:
parent
e4ef1717e3
commit
9dca8d18ed
1 changed files with 13 additions and 6 deletions
|
@ -8436,6 +8436,14 @@ namespace smt {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool existNegativeContains = false;
|
||||||
|
expr_ref_vector assignments(m);
|
||||||
|
ctx.get_assignments(assignments);
|
||||||
|
for (expr * a : assignments) {
|
||||||
|
expr * subterm;
|
||||||
|
if (m.is_not(a, subterm) && u.str.is_contains(subterm)) existNegativeContains = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (!needToAssignFreeVars) {
|
if (!needToAssignFreeVars) {
|
||||||
|
|
||||||
// check string-int terms
|
// check string-int terms
|
||||||
|
@ -8506,9 +8514,11 @@ namespace smt {
|
||||||
// we're not done if some variable in a regex membership predicate was unassigned
|
// we're not done if some variable in a regex membership predicate was unassigned
|
||||||
if (regexOK) {
|
if (regexOK) {
|
||||||
if (unused_internal_variables.empty()) {
|
if (unused_internal_variables.empty()) {
|
||||||
TRACE("str", tout << "All variables are assigned. Done!" << std::endl;);
|
if (!existNegativeContains) {
|
||||||
m_stats.m_solved_by = 2;
|
TRACE("str", tout << "All variables are assigned. Done!" << std::endl;);
|
||||||
return FC_DONE;
|
m_stats.m_solved_by = 2;
|
||||||
|
return FC_DONE;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
TRACE("str", tout << "Assigning decoy values to free internal variables." << std::endl;);
|
TRACE("str", tout << "Assigning decoy values to free internal variables." << std::endl;);
|
||||||
for (auto const &var : unused_internal_variables) {
|
for (auto const &var : unused_internal_variables) {
|
||||||
|
@ -8561,9 +8571,6 @@ namespace smt {
|
||||||
}
|
}
|
||||||
TRACE("str", tout << "arithmetic solver done in final check" << std::endl;);
|
TRACE("str", tout << "arithmetic solver done in final check" << std::endl;);
|
||||||
|
|
||||||
expr_ref_vector assignments(m);
|
|
||||||
ctx.get_assignments(assignments);
|
|
||||||
|
|
||||||
expr_ref_vector precondition(m);
|
expr_ref_vector precondition(m);
|
||||||
expr_ref_vector cex(m);
|
expr_ref_vector cex(m);
|
||||||
lbool model_status = fixed_length_model_construction(assignments, precondition, free_variables, candidate_model, cex);
|
lbool model_status = fixed_length_model_construction(assignments, precondition, free_variables, candidate_model, cex);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue