Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

seq.indexof is producing incorrect values #4076

Closed
LeventErkok opened this issue Apr 24, 2020 · 0 comments
Closed

seq.indexof is producing incorrect values #4076

LeventErkok opened this issue Apr 24, 2020 · 0 comments

Comments

@LeventErkok
Copy link

Fresh compile of z3 out of github.

(set-option :produce-models true)
(set-logic ALL)
(define-fun s0 () (Seq Int) (seq.++ (seq.unit 1) (seq.unit 2) (seq.unit 3)))
(define-fun s1 () (Seq Int) (seq.unit 2))
(declare-fun s2 () Int)
(assert (= s2 (seq.indexof s0 s1 0)))
(check-sat)
(get-value (s2))

z3 says:

sat
((s2 0))

Correct answer should be 1.

It appears that it correctly identifies non-occurences by assigning the value. -1, but for anything that's actually present, it simply returns 0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant