| 1 |
; EXPECT: feasible |
| 2 |
; COMMAND-LINE: --lang=sygus2 --sygus-si=all --sygus-si-abort --decision=internal --sygus-si-rcons=try --sygus-out=status |
| 3 |
|
| 4 |
(set-logic BV) |
| 5 |
|
| 6 |
(define-fun parity ((a Bool) (b Bool) (c Bool) (d Bool)) Bool |
| 7 |
(xor (not (xor a b)) (not (xor c d)))) |
| 8 |
|
| 9 |
(synth-fun NAND ((a Bool) (b Bool) (c Bool) (d Bool)) Bool |
| 10 |
((Start Bool) (StartAnd Bool) (Vars Bool) (Constants Bool)) |
| 11 |
((Start Bool ((not StartAnd) Vars Constants)) |
| 12 |
(StartAnd Bool ((and Start Start))) |
| 13 |
(Vars Bool (a b c d)) |
| 14 |
(Constants Bool (true false)))) |
| 15 |
|
| 16 |
(declare-var a Bool) |
| 17 |
(declare-var b Bool) |
| 18 |
(declare-var c Bool) |
| 19 |
(declare-var d Bool) |
| 20 |
|
| 21 |
(constraint |
| 22 |
(= (parity a b c d) |
| 23 |
(not (and (NAND a b c d) |
| 24 |
(not |
| 25 |
(and |
| 26 |
(not (and (not (and d (not (and d a)))) (not (and a (not (and d a)))))) |
| 27 |
(not (and (not (and (not (and true c)) (not (and true b)))) (not (and b c)))))))))) |
| 28 |
|
| 29 |
|
| 30 |
(check-synth) |
| 31 |
|
| 32 |
; Solution: |
| 33 |
;(define-fun NAND ((a Bool) (b Bool) (c Bool) (d Bool)) Bool |
| 34 |
;(not |
| 35 |
; (and |
| 36 |
; (not (and (not (and (not (and c true)) b)) (not (and (not (and b c)) c)))) |
| 37 |
; (not (and (not (and a d)) (not (and (not (and a true)) (not (and true d))))))))) |