Debian Codegraph @

test/regress/cli/regress1/sygus/list_recursor.sy

raw
1 ; EXPECT: feasible
2 ; COMMAND-LINE: --sygus-out=status --lang=sygus2
3
4 (set-logic HO_ALL)
5
6 (declare-datatype List ((cons (head Int) (tail List)) (nil)))
7
8 (define-fun-rec List_rec ((x Int) (y (-> Int List Int Int)) (l List)) Int
9 (ite ((_ is nil) l) x
10 (y (head l) (tail l) (List_rec x y (tail l)))))
11
12 (synth-fun f () Int
13 ((I Int))
14 ((I Int (0 1 (+ I I)))))
15
16 (synth-fun g ((x Int) (y List) (z Int)) Int
17 ((I Int) (L List))
18 ((I Int (x z (+ I I) (head L) 0 1))
19 (L List (y (tail y)))))
20
21
22 (constraint (= (List_rec f g (cons 0 (cons 1 nil))) 2))
23 (constraint (= (List_rec f g (cons 0 (cons 0 nil))) 2))
24 (constraint (= (List_rec f g (cons 5 (cons 3 (cons 3 (cons 0 nil))))) 4))
25 (constraint (= (List_rec f g nil) 0))
26 (check-synth)