summaryrefslogtreecommitdiff
path: root/examples/api/smtlib/sygus-fun.sy
blob: 171b3fe54f16e9af9f483ca54b5e5fdf72f3564a (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
; The printed output for this example should be equivalent to:
; (
;   (define-fun max ((x Int) (y Int)) Int (ite (<= x y) y x))
;   (define-fun min ((x Int) (y Int)) Int (ite (<= x y) x y))
; )

(set-logic LIA)
(synth-fun max ((x Int) (y Int)) Int
  ((Start Int) (StartBool Bool))
  ((Start Int (0 1 x y
               (+ Start Start)
               (- Start Start)
               (ite StartBool Start Start)))
   (StartBool Bool ((and StartBool StartBool)
                    (not StartBool)
                    (<= Start Start)))))
(synth-fun min ((x Int) (y Int)) Int)
(declare-var x Int)
(declare-var y Int)
(constraint (>= (max x y) x))
(constraint (>= (max x y) y))
(constraint (or (= x (max x y)) (= y (max x y))))
(constraint (= (+ (max x y) (min x y)) (+ x y)))
(check-synth)
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback