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

Invalid model for QF_FP formula #4841

Closed
rainoftime opened this issue Dec 1, 2020 · 3 comments · Fixed by #6968
Closed

Invalid model for QF_FP formula #4841

rainoftime opened this issue Dec 1, 2020 · 3 comments · Fixed by #6968
Assignees
Labels

Comments

@rainoftime
Copy link
Contributor

rainoftime commented Dec 1, 2020

Hi, for the following formula,
z3 3bca1fb

(declare-fun X () (_ FloatingPoint 2 6))
(declare-fun Y () (_ FloatingPoint 2 6))
(declare-fun Z () (_ FloatingPoint 2 6))
(assert (and (= X (fp.add RTZ Y Z)) (= X (fp.div RTZ Y Z)) (= X (fp.roundToIntegral RTZ Y)) (not (= Y Z))))
(check-sat)
(get-model)
./z3 model_validate=true ../delta.out.smt2 
sat
(error "line 5 column 10: an invalid model was generated")
(
  (define-fun Z () (_ FloatingPoint 2 6)
    (fp #b0 #b00 #b00001))
  (define-fun X () (_ FloatingPoint 2 6)
    (fp #b1 #b01 #b00000))
  (define-fun Y () (_ FloatingPoint 2 6)
    (fp #b1 #b01 #b00001))
)
@rainoftime rainoftime changed the title Invalid model for QF_FP formulas Invalid model for QF_FP formula Dec 1, 2020
@rainoftime
Copy link
Contributor Author

rainoftime commented Dec 1, 2020

note: instances from #2381 use fp.rem, while the formula above does not mention fp.rem

@wintersteiger
Copy link
Contributor

Sorry, I'm confused, what is related? fp.rem is known to be buggy as witnessed by the fact that there's an open issue for it. This bug report doesn't mention fp.rem though.

@rainoftime
Copy link
Contributor Author

(set-logic QF_FP)
(declare-fun X () (_ FloatingPoint 11 53))
(declare-fun Y () (_ FloatingPoint 9 53))
(assert (fp.lt X (fp #b0 #b10011111111 #x0000000000000)))
(assert (= Y ((_ to_fp 9 53) RNE X)))
(assert (not (distinct Y (_ +oo 9 53))))
(check-sat)

wintersteiger pushed a commit to wintersteiger/z3 that referenced this issue Sep 15, 2021
wintersteiger pushed a commit to wintersteiger/z3 that referenced this issue Sep 15, 2021
wintersteiger pushed a commit to wintersteiger/z3 that referenced this issue Oct 12, 2021
wintersteiger pushed a commit to wintersteiger/z3 that referenced this issue Oct 12, 2021
wintersteiger pushed a commit to wintersteiger/z3 that referenced this issue Oct 12, 2021
 but doesn't quite fix it."

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

Successfully merging a pull request may close this issue.

3 participants