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

Z3 reports incorrect sat on unsat NRA formula without / #2450

Closed
muchang opened this issue Jul 30, 2019 · 0 comments
Closed

Z3 reports incorrect sat on unsat NRA formula without / #2450

muchang opened this issue Jul 30, 2019 · 0 comments

Comments

@muchang
Copy link

muchang commented Jul 30, 2019

Hi,
For this formula:

(declare-fun a () Real) 
(declare-fun b () Real) 
(declare-fun c () Real) 
(declare-fun d () Real) 
(declare-fun e () Real) 
(declare-fun f () Real) 
(declare-fun g () Real)
(declare-fun j () Real) 
(declare-fun k () Real) 
(assert (or
    (not                  ;false
        (=>               
            (and            
                (= k 1.0)
                (= k 0.0) 
                (<= 1.0 f)) 
            (<= a (+ g b)))) 
    (and                    ;false
        (forall ((?d Real)) ;false
            (and                      
                (or                  
                    (<= 0.0 (+ (- b) ?d)) 
                    (= (- b f) 0.0))      
                (and 
                    (not (= d 0)) 
                    (not (= d 1.0)))))
        (and 
            (exists ((?h Real)) 
                (forall ((?d Real)) 
                    (exists ((?e Real)) 
                        (and 
                            (or 
                                (= j 0) 
                                (not (= (+ (- ?h) (- b f)) 0.0))) 
                            (or 
                                (and (< 0.0 ?h) (= ?e 0)) 
                                (or (<= (- b f) 0.0) (= (- b f) 0))) 
                            (and 
                                (<= 0.0 (+ ?e (* 2.0 ?d) (* (- 2.0) ?h))) 
                                (<= (+ ?d (* (- 2.0) ?h)) 0.00))))))
            (exists ((?h Real))
                (or 
                    (forall ((?e Real))
                        (or 
                            (<= ?h 0.0) 
                            (= (+ ?e f) 0.0)))
                    (and 
                        (or 
                            (not (= (+ (* (- 1.0) ?h) (* 2.0 j)) (- 1.0)))
                            (not (= (+ (* (- 2.0) ?h) (* (- 2.0) j)) 2.0)))
                        (forall ((?d Real)) 
                            (=  (* 2.0 ?d) ?h)))))))))
(assert (= b (+ j f)))  
(assert (= c (* e g)))  

(check-sat)
(get-model)

Z3 will report sat on this unsat formula and with the invalid model, while cvc4 reports unsat:

(model
  (define-fun g () Real
    (- 1.0))
  (define-fun e () Real
    (- (/ 1.0 8.0)))
  (define-fun c () Real
    (/ 1.0 8.0))
  (define-fun f () Real
    (/ 2.0 3.0))
  (define-fun j () Real
    (- (/ 2.0 3.0)))
  (define-fun b () Real
    0.0)
  (define-fun d () Real
    (/ 1.0 2.0))
  (define-fun a () Real
    0.0)
  (define-fun k () Real
    2.0)
)

If I feed this model to the formula, z3 will report unsat. z3-4.8.5 also reports unsat.

OS: Ubuntu 18.04
Revision: e1fd167

@muchang muchang changed the title Z3 incorrect sat on unsat NRA formula without / Z3 reports incorrect sat on unsat NRA formula without / Jul 30, 2019
NikolajBjorner added a commit that referenced this issue Aug 2, 2019
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
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