| 1 |
; COMMAND-LINE: --sygus-out=status |
| 2 |
; EXPECT: feasible |
| 3 |
(set-logic BV) |
| 4 |
(set-option :produce-models true) |
| 5 |
|
| 6 |
(define-sort Byte () (_ BitVec 8)) |
| 7 |
(define-sort Bit () (_ BitVec 1)) |
| 8 |
|
| 9 |
(define-fun bit-setter ((bitno (_ BitVec 3)) (y Bit) (x Byte)) Byte |
| 10 |
(ite (= bitno #b111) |
| 11 |
(concat y ((_ extract 6 0) x)) |
| 12 |
(concat ((_ extract 7 7) x) y ((_ extract 5 0) x)))) |
| 13 |
|
| 14 |
(synth-fun tbd ((x Byte) (y Bit)) Byte |
| 15 |
((Start Byte) (bitno (_ BitVec 3))) |
| 16 |
((Start Byte ( |
| 17 |
x |
| 18 |
(bit-setter bitno y x) |
| 19 |
)) |
| 20 |
(bitno (_ BitVec 3) ((Constant (_ BitVec 3)))) |
| 21 |
)) |
| 22 |
|
| 23 |
(declare-var x Byte) |
| 24 |
(declare-var y Bit) |
| 25 |
|
| 26 |
(constraint |
| 27 |
(let ((result (tbd x y))) |
| 28 |
(and |
| 29 |
(= ((_ extract 7 7) result) y) |
| 30 |
(= ((_ extract 6 0) result) ((_ extract 6 0) x)) |
| 31 |
))) |
| 32 |
|
| 33 |
(check-synth) |