| 1 |
; REQUIRES: cocoa |
| 2 |
; EXPECT: sat |
| 3 |
; x, m, is_zero: field |
| 4 |
; The constraints mx - 1 + is_zero = 0 |
| 5 |
; is_zero*m = 0 ;; Note: this *should* be is_zero*x=0 |
| 6 |
; Imply that is_zero is zero or one and = (x == 0) |
| 7 |
(set-info :smt-lib-version 2.6) |
| 8 |
(set-info :category "crafted") |
| 9 |
(set-logic QF_FF) |
| 10 |
(define-sort F () (_ FiniteField 4002409555221667393417789825735904156556882819939007885332058136124031650490837864442687629129015664037894272559787)) |
| 11 |
(declare-fun x () F) |
| 12 |
(declare-fun m () F) |
| 13 |
(declare-fun is_zero () F) |
| 14 |
(assert (not (=> |
| 15 |
(and (= (as ff0 F) |
| 16 |
(ff.add (ff.mul m x) (ff.neg (as ff1 F)) is_zero)) |
| 17 |
(= (as ff0 F) (ff.mul is_zero m))) |
| 18 |
(and (or (= (as ff0 F) is_zero) (= (as ff1 F) is_zero)) |
| 19 |
(= (= (as ff1 F) is_zero) (= x (as ff0 F)))) |
| 20 |
))) |
| 21 |
(check-sat) |