summaryrefslogtreecommitdiff
path: root/test/regress/regress1/sygus/abv.sy
blob: d9a8a019c899a0e142733fb29e8fbbf139637e46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
; EXPECT: unsat
; COMMAND-LINE: --sygus-out=status
(set-logic ABV)

(define-sort AddrSort () (BitVec 32))
(define-sort ValSort () (BitVec 8))
(define-sort MemSort () (Array AddrSort ValSort))

; Write the value y to index x
(define-fun WriteArr 
	; Args
	((x AddrSort) (y ValSort) (arrIn MemSort)) 
	
	; Return value
	MemSort
	
	; Function Body
	(store arrIn x y)
)

; Read from index x
(define-fun ReadArr 
	; Args
	((x AddrSort) (arrIn MemSort)) 
	
	; Return value
	ValSort
	
	; Function Body
	(select arrIn x)
)

(define-fun letf ((m MemSort) (v1 AddrSort) (v2 AddrSort)) ValSort
  (bvadd 
    (ReadArr v1 m) 
    (ReadArr v2 m)))

(synth-fun f 
	; Args
	((x0 ValSort) (x1 ValSort) (idx0 AddrSort) (idx1 AddrSort) (mem MemSort))
	
	; Return value
	ValSort
    
    	; Grammar
    	(
	(StartArray MemSort (
		(WriteArr (Variable AddrSort) (Variable ValSort) StartArray)
		(WriteArr (Variable AddrSort) (Variable ValSort) mem)))

	(Start ValSort (
		(letf StartArray (Variable AddrSort) (Variable AddrSort))))
))

(declare-var a (BitVec 8))
(declare-var b (BitVec 8))
(declare-var c (BitVec 32))
(declare-var d (BitVec 32))
(declare-var e (Array (BitVec 32) (BitVec 8)))
(constraint (=> (not (= c d)) (= (bvadd a b) (f a b c d e))))
(check-synth)
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback