Debian Codegraph @

test/regress/cli/regress1/sygus/planning-unif.sy

raw
1 ; EXPECT: feasible
2 ; COMMAND-LINE: --lang=sygus2 --sygus-unif-pi=complete --sygus-out=status
3 (set-logic LIA)
4
5 (define-fun get-y ((currPoint Int)) Int
6 (ite (< currPoint 10) 0 (ite (< currPoint 20) 1 (ite (< currPoint 30) 2 (ite (< currPoint 40) 3 (ite (< currPoint 50) 4 (ite (< currPoint 60) 5 (ite (< currPoint 70) 6 (ite (< currPoint 80) 7 (ite (< currPoint 90) 8 9))))))))))
7
8 (define-fun get-x ((currPoint Int)) Int
9 (- currPoint (* (get-y currPoint) 10)))
10 (define-fun interpret-move (( currPoint Int ) ( move Int)) Int
11 (ite (= move 0) currPoint
12 (ite (= move 1) (ite (or (< (+ (get-y currPoint) 1) 0) (>= (+ (get-y currPoint) 1) 10)) currPoint (+ currPoint 10))
13 (ite (= move 2) (ite (or (< (+ (get-x currPoint) 1) 0) (>= (+ (get-x currPoint) 1) 10)) currPoint (+ currPoint 1))
14 (ite (= move 3) (ite (or (< (+ (get-y currPoint)(- 1)) 0) (>= (+ (get-y currPoint)(- 1)) 10)) currPoint (+ currPoint (- 10)))
15 (ite (= move 4) (ite (or (< (+ (get-x currPoint)(- 1)) 0) (>= (+ (get-x currPoint)(- 1)) 10)) currPoint (+ currPoint (- 1)))
16 currPoint))))))
17
18 (define-fun interpret-move-obstacle-0 (( currPoint Int ) ( move Int)) Int
19 (ite (= move 0) (ite (or (< (+ (get-y currPoint) 1) 0) (>= (+ (get-y currPoint) 1) 10)) currPoint (+ currPoint 10))
20 (ite (= move 1) (ite (or (< (+ (get-y currPoint)(- 1)) 0) (>= (+ (get-y currPoint)(- 1)) 10)) currPoint (+ currPoint (- 10)))
21 currPoint)))
22
23 (define-fun interpret-move-obstacle-1 (( currPoint Int ) ( move Int)) Int
24 (ite (= move 0) (ite (or (< (+ (get-y currPoint) 1) 0) (>= (+ (get-y currPoint) 1) 10)) currPoint (+ currPoint 10))
25 (ite (= move 1) currPoint
26 (ite (= move 2) (ite (or (< (+ (get-y currPoint)(- 1)) 0) (>= (+ (get-y currPoint)(- 1)) 10)) currPoint (+ currPoint (- 10)))
27 currPoint))))
28
29 (define-fun allowable-move-obstacle-0 (( start Int ) ( end Int)) Bool
30 (or (= (interpret-move-obstacle-0 start 0) end)
31 (or (= (interpret-move-obstacle-0 start 1) end) false)))
32
33 (define-fun allowable-move-obstacle-1 (( start Int ) ( end Int)) Bool
34 (or (= (interpret-move-obstacle-1 start 0) end)
35 (or (= (interpret-move-obstacle-1 start 1) end)
36 (or (= (interpret-move-obstacle-1 start 2) end) false))))
37
38 (define-fun get-move-obstacle-0 (( start Int ) ( end Int)) Int
39 (ite (= (interpret-move-obstacle-0 start 0) end) 0
40 (ite (= (interpret-move-obstacle-0 start 1) end) 1 (- 1))))
41
42 (define-fun get-move-obstacle-1 (( start Int ) ( end Int)) Int
43 (ite (= (interpret-move-obstacle-1 start 0) end) 0
44 (ite (= (interpret-move-obstacle-1 start 1) end) 1
45 (ite (= (interpret-move-obstacle-1 start 2) end) 2 (- 1)))))
46
47 (define-fun no-overlap-one-move-combination-2-2 ((p0 Int) (p1 Int) (p2 Int) (p3 Int)) Bool
48 (and (not (= p0 p2)) (and (not (= p0 p3)) (and (not (= p1 p2)) (and (not (= p1 p3)) true)))))
49
50 (define-fun no-overlaps-0 (( currPoint Int ) ( move Int) (obstacleCurrPoint Int) (obstacleMove Int)) Bool
51 (= 1
52 (ite (= move 0)
53 (ite (= obstacleMove 0) (ite (no-overlap-one-move-combination-2-2 currPoint (+ (+ currPoint 0) 0) obstacleCurrPoint (+ (+ obstacleCurrPoint 0) 10)) 1 0)
54 (ite (= obstacleMove 1) (ite (no-overlap-one-move-combination-2-2 currPoint (+ (+ currPoint 0) 0) obstacleCurrPoint (+ (+ obstacleCurrPoint 0)(- 10))) 1 0) 0))
55 (ite (= move 1)
56 (ite (= obstacleMove 0) (ite (no-overlap-one-move-combination-2-2 currPoint (+ (+ currPoint 0) 10) obstacleCurrPoint (+ (+ obstacleCurrPoint 0) 10)) 1 0)
57 (ite (= obstacleMove 1) (ite (no-overlap-one-move-combination-2-2 currPoint (+ (+ currPoint 0) 10) obstacleCurrPoint (+ (+ obstacleCurrPoint 0)(- 10))) 1 0) 0))
58 (ite (= move 2)
59 (ite (= obstacleMove 0) (ite (no-overlap-one-move-combination-2-2 currPoint (+ (+ currPoint 1) 0) obstacleCurrPoint (+ (+ obstacleCurrPoint 0) 10)) 1 0)
60 (ite (= obstacleMove 1) (ite (no-overlap-one-move-combination-2-2 currPoint (+ (+ currPoint 1) 0) obstacleCurrPoint (+ (+ obstacleCurrPoint 0)(- 10))) 1 0) 0))
61 (ite (= move 3)
62 (ite (= obstacleMove 0) (ite (no-overlap-one-move-combination-2-2 currPoint (+ (+ currPoint 0)(- 10)) obstacleCurrPoint (+ (+ obstacleCurrPoint 0) 10)) 1 0)
63 (ite (= obstacleMove 1) (ite (no-overlap-one-move-combination-2-2 currPoint (+ (+ currPoint 0)(- 10)) obstacleCurrPoint (+ (+ obstacleCurrPoint 0)(- 10))) 1 0) 0))
64 (ite (= move 4)
65 (ite (= obstacleMove 0) (ite (no-overlap-one-move-combination-2-2 currPoint (+ (+ currPoint(- 1)) 0) obstacleCurrPoint (+ (+ obstacleCurrPoint 0) 10)) 1 0)
66 (ite (= obstacleMove 1) (ite (no-overlap-one-move-combination-2-2 currPoint (+ (+ currPoint(- 1)) 0) obstacleCurrPoint (+ (+ obstacleCurrPoint 0)(- 10))) 1 0) 0)) 0)))))))
67
68 (define-fun no-overlaps-1 (( currPoint Int ) ( move Int) (obstacleCurrPoint Int) (obstacleMove Int)) Bool
69 (= 1
70 (ite (= move 0)
71 (ite (= obstacleMove 0) (ite (no-overlap-one-move-combination-2-2 currPoint (+ (+ currPoint 0) 0) obstacleCurrPoint (+ (+ obstacleCurrPoint 0) 10)) 1 0)
72 (ite (= obstacleMove 1) (ite (no-overlap-one-move-combination-2-2 currPoint (+ (+ currPoint 0) 0) obstacleCurrPoint (+ (+ obstacleCurrPoint 0) 0)) 1 0)
73 (ite (= obstacleMove 2) (ite (no-overlap-one-move-combination-2-2 currPoint (+ (+ currPoint 0) 0) obstacleCurrPoint (+ (+ obstacleCurrPoint 0)(- 10))) 1 0) 0)))
74 (ite (= move 1)
75 (ite (= obstacleMove 0) (ite (no-overlap-one-move-combination-2-2 currPoint (+ (+ currPoint 0) 10) obstacleCurrPoint (+ (+ obstacleCurrPoint 0) 10)) 1 0)
76 (ite (= obstacleMove 1) (ite (no-overlap-one-move-combination-2-2 currPoint (+ (+ currPoint 0) 10) obstacleCurrPoint (+ (+ obstacleCurrPoint 0) 0)) 1 0)
77 (ite (= obstacleMove 2) (ite (no-overlap-one-move-combination-2-2 currPoint (+ (+ currPoint 0) 10) obstacleCurrPoint (+ (+ obstacleCurrPoint 0)(- 10))) 1 0) 0)))
78 (ite (= move 2)
79 (ite (= obstacleMove 0) (ite (no-overlap-one-move-combination-2-2 currPoint (+ (+ currPoint 1) 0) obstacleCurrPoint (+ (+ obstacleCurrPoint 0) 10)) 1 0)
80 (ite (= obstacleMove 1) (ite (no-overlap-one-move-combination-2-2 currPoint (+ (+ currPoint 1) 0) obstacleCurrPoint (+ (+ obstacleCurrPoint 0) 0)) 1 0)
81 (ite (= obstacleMove 2) (ite (no-overlap-one-move-combination-2-2 currPoint (+ (+ currPoint 1) 0) obstacleCurrPoint (+ (+ obstacleCurrPoint 0)(- 10))) 1 0) 0)))
82 (ite (= move 3)
83 (ite (= obstacleMove 0) (ite (no-overlap-one-move-combination-2-2 currPoint (+ (+ currPoint 0)(- 10)) obstacleCurrPoint (+ (+ obstacleCurrPoint 0) 10)) 1 0)
84 (ite (= obstacleMove 1) (ite (no-overlap-one-move-combination-2-2 currPoint (+ (+ currPoint 0)(- 10)) obstacleCurrPoint (+ (+ obstacleCurrPoint 0) 0)) 1 0)
85 (ite (= obstacleMove 2) (ite (no-overlap-one-move-combination-2-2 currPoint (+ (+ currPoint 0)(- 10)) obstacleCurrPoint (+ (+ obstacleCurrPoint 0)(- 10))) 1 0) 0)))
86 (ite (= move 4)
87 (ite (= obstacleMove 0) (ite (no-overlap-one-move-combination-2-2 currPoint (+ (+ currPoint(- 1)) 0) obstacleCurrPoint (+ (+ obstacleCurrPoint 0) 10)) 1 0)
88 (ite (= obstacleMove 1) (ite (no-overlap-one-move-combination-2-2 currPoint (+ (+ currPoint(- 1)) 0) obstacleCurrPoint (+ (+ obstacleCurrPoint 0) 0)) 1 0)
89 (ite (= obstacleMove 2) (ite (no-overlap-one-move-combination-2-2 currPoint (+ (+ currPoint(- 1)) 0) obstacleCurrPoint (+ (+ obstacleCurrPoint 0)(- 10))) 1 0) 0))) 0)))))))
90
91 (define-fun no-overlaps-one-step-helper ((currPoint Int) (move Int) (o0-t Int) (o0move Int) (o1-t Int) (o1move Int)) Bool
92 (and (no-overlaps-0 currPoint move o0-t o0move) (and (no-overlaps-1 currPoint move o1-t o1move) true)))
93
94 (define-fun no-overlaps-one-step ((currPoint Int) (move Int) (o0-0 Int) (o0-1 Int) (o1-0 Int) (o1-1 Int)) Bool
95 (no-overlaps-one-step-helper currPoint move o0-0 (get-move-obstacle-0 o0-0 o0-1) o1-0 (get-move-obstacle-1 o1-0 o1-1)))
96
97
98
99 (declare-var o0-1 Int)
100 (declare-var o0-2 Int)
101 (declare-var o0-3 Int)
102 (declare-var o1-1 Int)
103 (declare-var o1-2 Int)
104 (declare-var o1-3 Int)
105
106 (synth-fun move ((currPoint Int) (o0 Int) (o1 Int)) Int
107 ((Start Int) (MoveId Int) (CondInt Int) (StartBool Bool))
108 ((Start Int (
109 MoveId
110 (ite StartBool Start Start)))
111 (MoveId Int (0
112 1
113 2
114 3
115 4
116 ))
117 (CondInt Int (
118 (get-y currPoint) ;y coord
119 (get-x currPoint) ;x coord
120 (get-y o0)
121 (get-x o0)
122 (get-y o1)
123 (get-x o1)
124 (+ CondInt CondInt)
125 (- CondInt CondInt)
126 (- 1)
127 0
128 1
129 2
130 3
131 4
132 5
133 6
134 7
135 8
136 9
137 ))
138 (StartBool Bool ((and StartBool StartBool)
139 (or StartBool StartBool)
140 (not StartBool)
141 (<= CondInt CondInt)
142 (= CondInt CondInt)
143 (>= CondInt CondInt)))))
144
145 (constraint (or
146 (and
147 (= (interpret-move (interpret-move (interpret-move 0 (move 0 99 98)) (move (interpret-move 0 (move 0 99 98)) o0-1 o1-1)) (move (interpret-move (interpret-move 0 (move 0 99 98)) (move (interpret-move 0 (move 0 99 98)) o0-1 o1-1)) o0-2 o1-2)) 30)
148 (and (no-overlaps-one-step 0 (move 0 99 98) 99 o0-1 98 o1-1) (and (no-overlaps-one-step (interpret-move 0 (move 0 99 98)) (move (interpret-move 0 (move 0 99 98)) o0-1 o1-1) o0-1 o0-2 o1-1 o1-2) (and (no-overlaps-one-step (interpret-move (interpret-move 0 (move 0 99 98)) (move (interpret-move 0 (move 0 99 98)) o0-1 o1-1)) (move (interpret-move (interpret-move 0 (move 0 99 98)) (move (interpret-move 0 (move 0 99 98)) o0-1 o1-1)) o0-2 o1-2) o0-2 o0-3 o1-2 o1-3) true))))
149 (not (and (allowable-move-obstacle-0 99 o0-1) (and (allowable-move-obstacle-0 o0-1 o0-2) (and (allowable-move-obstacle-0 o0-2 o0-3) (and (allowable-move-obstacle-1 98 o1-1) (and (allowable-move-obstacle-1 o1-1 o1-2) (and (allowable-move-obstacle-1 o1-2 o1-3) true)))))))))
150 (check-synth)