mirror of
https://github.com/Z3Prover/z3
synced 2025-08-11 21:50:52 +00:00
remove symbol -> zstring -> symbol round-trips
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
5cb0bac41d
commit
20a67e47ca
13 changed files with 68 additions and 62 deletions
|
@ -682,7 +682,7 @@ namespace seq {
|
|||
// itos(n) does not start with "0" when n > 0
|
||||
// n = 0 or at(itos(n),0) != "0"
|
||||
// alternative: n >= 0 => itos(stoi(itos(n))) = itos(n)
|
||||
expr_ref zs(seq.str.mk_string(symbol("0")), m);
|
||||
expr_ref zs(seq.str.mk_string("0"), m);
|
||||
m_rewrite(zs);
|
||||
expr_ref eq0 = mk_eq(n, zero);
|
||||
expr_ref at0 = mk_eq(seq.str.mk_at(e, zero), zs);
|
||||
|
|
|
@ -2159,7 +2159,7 @@ br_status seq_rewriter::mk_str_from_code(expr* a, expr_ref& result) {
|
|||
rational r;
|
||||
if (m_autil.is_numeral(a, r)) {
|
||||
if (r.is_neg() || r > u().max_char()) {
|
||||
result = str().mk_string(symbol(""));
|
||||
result = str().mk_string(zstring());
|
||||
}
|
||||
else {
|
||||
unsigned num = r.get_unsigned();
|
||||
|
@ -2207,10 +2207,10 @@ br_status seq_rewriter::mk_str_itos(expr* a, expr_ref& result) {
|
|||
rational r;
|
||||
if (m_autil.is_numeral(a, r)) {
|
||||
if (r.is_int() && !r.is_neg()) {
|
||||
result = str().mk_string(symbol(r.to_string()));
|
||||
result = str().mk_string(zstring(r));
|
||||
}
|
||||
else {
|
||||
result = str().mk_string(symbol(""));
|
||||
result = str().mk_string(zstring());
|
||||
}
|
||||
return BR_DONE;
|
||||
}
|
||||
|
@ -2225,7 +2225,7 @@ br_status seq_rewriter::mk_str_itos(expr* a, expr_ref& result) {
|
|||
eqs.push_back(m().mk_eq(b, str().mk_string(s)));
|
||||
}
|
||||
result = m().mk_or(eqs);
|
||||
result = m().mk_ite(result, b, str().mk_string(symbol("")));
|
||||
result = m().mk_ite(result, b, str().mk_string(zstring()));
|
||||
return BR_REWRITE2;
|
||||
}
|
||||
return BR_FAILED;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue