mirror of
https://github.com/Z3Prover/z3
synced 2025-06-27 08:28:44 +00:00
Step by step derivation of second int.to.str axiom
This commit is contained in:
parent
900e707619
commit
574051df1b
1 changed files with 8 additions and 5 deletions
|
@ -1881,12 +1881,15 @@ namespace smt {
|
||||||
assert_axiom(axiom1);
|
assert_axiom(axiom1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// axiom 2: (str.from-int N) should not result in a string with leading zeros.
|
// axiom 2: The only (str.from-int N) that starts with a "0" is "0".
|
||||||
expr_ref zero(mk_string("0"), m);
|
expr_ref zero(mk_string("0"), m);
|
||||||
expr_ref pref(u.str.mk_prefix(zero, ex), m);
|
// let (the result starts with a "0") be p
|
||||||
// The result does not start with a "0" (~p) xor the result is "0" (q)
|
expr_ref p(u.str.mk_prefix(zero, ex), m);
|
||||||
// ~p xor q == (p or q) and (~p or ~q)
|
// let (the result is "0") be q
|
||||||
assert_axiom(m.mk_and(m.mk_or(pref, ctx.mk_eq_atom(ex, zero)), m.mk_or(mk_not(m, pref), mk_not(m, ctx.mk_eq_atom(ex, zero)))));
|
expr_ref q(ctx.mk_eq_atom(ex, zero), m);
|
||||||
|
// encoding: the result does NOT start with a "0" (~p) xor the result is "0" (q)
|
||||||
|
// ~p xor q == (~p or q) and (p or ~q)
|
||||||
|
assert_axiom(m.mk_and(m.mk_or(mk_not(m, p), q), m.mk_or(p, mk_not(m, q))));
|
||||||
}
|
}
|
||||||
|
|
||||||
expr * theory_str::mk_RegexIn(expr * str, expr * regexp) {
|
expr * theory_str::mk_RegexIn(expr * str, expr * regexp) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue