Skip to content

Incorrect model QF_S, distinct, str++, str.len #2750

@wintered

Description

@wintered

Hi,

consider the following formula.

(declare-fun x () String)
(declare-fun y () String)
(assert (distinct (str.++ x y) (str.++ y x)))
(assert (= (str.len x) 17))
(check-sat)
(get-model)

Z3 gives the following incorrect model:

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

OS: Ubuntu 18.04
Revision: a257ec0

Metadata

Metadata

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