Skip to content

Soundness bug (Z3 incorrectly reports sat) on QF_S formula with str.contains, str.replace, str.prefixof #4014

@muchang

Description

@muchang

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

[517] % z3 model_validate=true small.smt2
sat
(error "line 4 column 10: an invalid model was generated")
[518] % 
[518] % cvc4 --strings-exp -q small.smt2
unsat
[519] % 
[519] % cat small.smt2
(declare-fun a () String)
(declare-fun b () String)
(assert (distinct (str.contains (str.replace "B" a b) b) (str.prefixof a (str.replace "B" b a))))
(check-sat)
[520] %

OS: Ubuntu 18.04
Commit: bcbe802

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions