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

Soundness bug with quantifies & recursion over BV arrays #5378

Closed
SaswatPadhi opened this issue Jun 29, 2021 · 1 comment
Closed

Soundness bug with quantifies & recursion over BV arrays #5378

SaswatPadhi opened this issue Jun 29, 2021 · 1 comment

Comments

@SaswatPadhi
Copy link

Z3 reports sat on the following formula, and unsat after a simple simplification (commented below):

(set-logic ALL)

(define-fun-rec is_histogram ( (src (Array (_ BitVec 64) (_ BitVec 8)))
                               (N (_ BitVec 64))
                               (N_MAX (_ BitVec 64))
                               (result (Array (_ BitVec 64) (_ BitVec 8))) )
                             (_ BitVec 8)
  (ite (bvsle N (_ bv0 64))
       (ite (forall ((k (_ BitVec 64))) (=> (= (_ bv0 64) k)
                                            ; `sat` with select `k`, `unsat` with select `(_ bv0 64)`
                                            (= (select result k) (_ bv0 8))))
            (_ bv1 8)
            (_ bv0 8))
       (_ bv0 8))
)

(define-const |is_histogram::N!0@1#1| (_ BitVec 64) #x0000000000000000)
(define-const |is_histogram::N_MAX!0@1#1| (_ BitVec 64) #x0000000000000001)
(define-const |symex_dynamic::dynamic_object1#1| (Array (_ BitVec 64) (_ BitVec 8)) ((as const (Array (_ BitVec 64) (_ BitVec 8))) #x00))
(define-const |symex_dynamic::dynamic_object2#1| (Array (_ BitVec 64) (_ BitVec 8)) (store ((as const (Array (_ BitVec 64) (_ BitVec 8))) #x10)
       #x0000000000000000
       #x00))
(assert (not (= (_ bv1 8)
     (is_histogram |symex_dynamic::dynamic_object1#1|
                   |is_histogram::N!0@1#1|
                   |is_histogram::N_MAX!0@1#1|
                   |symex_dynamic::dynamic_object2#1|))))

(check-sat)

CVC4 reports unsat: https://cvc4.github.io/app/#temp_8ab1106b-833c-49b6-b3ad-496ce0da6adb

(might be related to #5377)

@NikolajBjorner
Copy link
Contributor

won't be supported until sat.euf=true option is stable.

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