-
Notifications
You must be signed in to change notification settings - Fork 2
/
max4.sl
36 lines (28 loc) · 883 Bytes
/
max4.sl
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
(set-weight (w1 TROP) )
(set-logic LIA)
(synth-fun max4 ((x Int) (y Int) (z Int) (w Int)) Int
((Start Int (x y 0 1
(+ Start Start)
(- Start Start)
((ite StartBool Start Start) : 1)))
(StartBool Bool ((and StartBool StartBool)
(or StartBool StartBool)
(not StartBool)
(<= Start Start)
(= Start Start)
(>= Start Start)))))
(declare-var x Int)
(declare-var y Int)
(declare-var z Int)
(declare-var w Int)
(constraint (>= (max4 x y z w) x))
(constraint (>= (max4 x y z w) y))
(constraint (>= (max4 x y z w) z))
(constraint (>= (max4 x y z w) w))
(constraint (or (= x (max4 x y z w))
(or (= y (max4 x y z w))
(or (= z (max4 x y z w))
(= w (max4 x y z w))))))
(weight-constraint (<= w1 2))
(optimize w1)
(check-synth)