mirror of
https://github.com/Z3Prover/z3
synced 2025-06-07 14:43:23 +00:00
Merge pull request #4490 from mtrberzi/issue4486
z3str3: construct proper cex for str.at model construction
This commit is contained in:
commit
99f20c59e4
1 changed files with 4 additions and 1 deletions
|
@ -725,7 +725,10 @@ namespace smt {
|
||||||
v.init(&get_context());
|
v.init(&get_context());
|
||||||
rational pos_value;
|
rational pos_value;
|
||||||
bool pos_exists = v.get_value(pos, pos_value);
|
bool pos_exists = v.get_value(pos, pos_value);
|
||||||
ENSURE(pos_exists);
|
if (!pos_exists) {
|
||||||
|
cex = m.mk_or(m_autil.mk_ge(pos, mk_int(0)), m_autil.mk_le(pos, mk_int(0)));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
TRACE("str_fl", tout << "reduce str.at: base=" << mk_pp(base, m) << ", pos=" << pos_value.to_string() << std::endl;);
|
TRACE("str_fl", tout << "reduce str.at: base=" << mk_pp(base, m) << ", pos=" << pos_value.to_string() << std::endl;);
|
||||||
if (pos_value.is_neg() || pos_value >= rational(base_chars.size())) {
|
if (pos_value.is_neg() || pos_value >= rational(base_chars.size())) {
|
||||||
// return the empty string
|
// return the empty string
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue