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

smt.bv.enable_int2bv=false soundness bug on QF_BV formula #3546

Closed
muchang opened this issue Mar 30, 2020 · 1 comment
Closed

smt.bv.enable_int2bv=false soundness bug on QF_BV formula #3546

muchang opened this issue Mar 30, 2020 · 1 comment

Comments

@muchang
Copy link

muchang commented Mar 30, 2020

Hi,
For this formula:

(declare-fun a () Int)
(assert
 (and (distinct a 0)
 (= ((_ extract 0 0) (bvashr ((_ int2bv 3) a) ((_ int2bv 3) 1))) (_ bv0 1))
 (= 0 (bv2nat ((_ int2bv 3) (bv2nat (bvor ((_ int2bv 3) (bv2nat (bvashr ((_ int2bv 3) a) ((_ int2bv 3) 7)))))))))
 (= a (bv2nat ((_ int2bv 3) a)))
 (= ((_ extract 0 0) (bvor ((_ int2bv 3) a))) (_ bv0 1))))
(check-sat)

Z3 smt.bv.enable_int2bv=false gives an incorrect answer:

[593] % z3 small.smt2
unsat
[594] % z3 smt.bv.enable_int2bv=false small.smt2
sat
[595] % 
[595] % cat small.smt2
(declare-fun a () Int)
(assert
 (and (distinct a 0)
 (= ((_ extract 0 0) (bvashr ((_ int2bv 3) a) ((_ int2bv 3) 1))) (_ bv0 1))
 (= 0 (bv2nat ((_ int2bv 3) (bv2nat (bvor ((_ int2bv 3) (bv2nat (bvashr ((_ int2bv 3) a) ((_ int2bv 3) 7)))))))))
 (= a (bv2nat ((_ int2bv 3) a)))
 (= ((_ extract 0 0) (bvor ((_ int2bv 3) a))) (_ bv0 1))))
(check-sat)

OS: Ubuntu 18.04
Commit: 9be7bda

@NikolajBjorner
Copy link
Contributor

sure, int2bv/bv2int are treated as uninterpreted if you disable handling them.

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

2 participants