z3 icon indicating copy to clipboard operation
z3 copied to clipboard

z3str3 invalid model on QF_S formula with distinct str.replace

Open muchang opened this issue 6 years ago • 2 comments

Hi, For this formula:

(declare-fun x () String)
(declare-fun y () String)
(assert (distinct (str.replace (str.replace x y x) x y) x))
(check-sat)
(get-model)

Z3 smt.string_solver=z3str3 gives an invalid model:

(model 
  (define-fun y () String
    "")
  (define-fun x () String
    "\x00")
)

if I feed this model to the formula, Z3 reports unsat.

OS: Ubuntu 18.04 Commit: c71da17

muchang avatar Feb 23 '20 12:02 muchang

This now times out as of the latest patch. Do you know what the correct answer to this case is? If it is UNSAT, a timeout here may be expected.

mtrberzi avatar Feb 28 '20 17:02 mtrberzi

It should be satisfiable. Below is the model from z3:

(model 
  (define-fun y () String
    "\x00\x00")
  (define-fun x () String
    "\x00")
)

zhendongsu avatar Feb 28 '20 17:02 zhendongsu