Skip to content

(z3str3, rewriter.flat=false) Soundness bug on QF_S formula with str.in.re #4377

@muchang

Description

@muchang

Hi,
For this case, Z3 gives an incorrect answer:

[572] % z3release small.smt2
sat
[573] % z3release smt.string_solver=z3str3 small.smt2
sat
[574] % z3release smt.string_solver=z3str3 rewriter.flat=false small.smt2
unsat
[575] % 
[575] % cat small.smt2
(declare-fun a () String)
(declare-fun b () String)
(declare-fun c () String)
(declare-fun d () String)
(declare-fun e () String)
(declare-fun f () Bool)
(assert
 (ite f (str.in.re e (str.to.re ""))
 (and (= "" (str.++ (str.substr a (str.len b) (str.len d)) c))
  (distinct 0 (str.len (str.substr a (str.len b) (str.len d))))
  (not (str.in.re "" (re.inter (str.to.re "") (str.to.re "a")))))))
(check-sat)
[576] %

OS: Ubuntu 18.04
Commit: 1c760b0

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions