Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

z3 incorrect answer on string formula #2618

Closed
muchang opened this issue Oct 6, 2019 · 0 comments
Closed

z3 incorrect answer on string formula #2618

muchang opened this issue Oct 6, 2019 · 0 comments

Comments

@muchang
Copy link

muchang commented Oct 6, 2019

Hi,
For this formula,

(declare-fun a () String)
(declare-fun b () String)
(declare-fun c () String)
(assert (str.in.re c (re.* (re.union (str.to.re "aa") (str.to.re "")))))
(assert (= 0 (str.to.int (str.replace a b (str.at a (str.len a))))))
(assert (= a (str.++ b c)))
(check-sat)
(get-model)

z3 will report sat and give the following model:

  (define-fun c () String
    "")
  (define-fun b () String
    "")
  (define-fun a () String
    "")

If I feed this model to the formula, z3 will report unsat.

z3-4.8.5 and 4.8.6 also report sat on this case.

OS: Ubuntu 18.04
Revision: f9b6e4e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant