Skip to content

(z3str3) Soundness bug on QF_SLIA formula with str.substr, str.replace, str.indexof #4391

@muchang

Description

@muchang

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

[580] % z3 small.smt2 
unsat
[581] % z3 smt.string_solver=z3str3 small.smt2 
sat
[582] % cat small.smt2 
(declare-fun a () String)
(declare-fun b () Int)
(assert (distinct (str.substr (str.replace "B" a "A") b b)
     (str.substr "B" 0 (str.indexof "A" a b))))
(check-sat)
[583] %

OS: Ubuntu 18.04
Commit: 0f8f886

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions