Debian Codegraph @

test/regress/cli/regress1/sygus/stopwatch-bt.sy

raw
1 ; EXPECT: feasible
2 ; COMMAND-LINE: --lang=sygus2 --sygus-inv-templ=post --sygus-out=status
3 (set-logic LIA)
4
5 (define-fun
6 __node_init_previous_0 (
7 (previous.usr.x@0 Int)
8 (previous.usr.y@0 Int)
9 (previous.res.init_flag@0 Bool)
10 ) Bool
11
12 (and (= previous.usr.y@0 0) previous.res.init_flag@0)
13 )
14
15 (define-fun
16 __node_trans_previous_0 (
17 (previous.usr.x@1 Int)
18 (previous.usr.y@1 Int)
19 (previous.res.init_flag@1 Bool)
20 (previous.usr.x@0 Int)
21 (previous.usr.y@0 Int)
22 (previous.res.init_flag@0 Bool)
23 ) Bool
24
25 (and (= previous.usr.y@1 previous.usr.x@0) (not previous.res.init_flag@1))
26 )
27
28 (define-fun
29 __node_init_stopwatch_0 (
30 (stopwatch.usr.toggle@0 Bool)
31 (stopwatch.usr.reset@0 Bool)
32 (stopwatch.usr.count@0 Int)
33 (stopwatch.res.init_flag@0 Bool)
34 (stopwatch.res.abs_0@0 Bool)
35 (stopwatch.impl.usr.running@0 Bool)
36 (stopwatch.res.abs_1@0 Int)
37 (stopwatch.res.inst_0@0 Bool)
38 ) Bool
39
40 (and
41 (= stopwatch.impl.usr.running@0 (not (not stopwatch.usr.toggle@0)))
42 (=
43 stopwatch.usr.count@0
44 (ite
45 stopwatch.usr.reset@0
46 0
47 (ite
48 stopwatch.impl.usr.running@0
49 (+ stopwatch.res.abs_1@0 1)
50 stopwatch.res.abs_1@0)))
51 (= stopwatch.res.abs_0@0 (>= stopwatch.usr.count@0 0))
52 (__node_init_previous_0
53 stopwatch.usr.count@0
54 stopwatch.res.abs_1@0
55 stopwatch.res.inst_0@0)
56 stopwatch.res.init_flag@0
57 true)
58 )
59
60 (define-fun
61 __node_trans_stopwatch_0 (
62 (stopwatch.usr.toggle@1 Bool)
63 (stopwatch.usr.reset@1 Bool)
64 (stopwatch.usr.count@1 Int)
65 (stopwatch.res.init_flag@1 Bool)
66 (stopwatch.res.abs_0@1 Bool)
67 (stopwatch.impl.usr.running@1 Bool)
68 (stopwatch.res.abs_1@1 Int)
69 (stopwatch.res.inst_0@1 Bool)
70 (stopwatch.usr.toggle@0 Bool)
71 (stopwatch.usr.reset@0 Bool)
72 (stopwatch.usr.count@0 Int)
73 (stopwatch.res.init_flag@0 Bool)
74 (stopwatch.res.abs_0@0 Bool)
75 (stopwatch.impl.usr.running@0 Bool)
76 (stopwatch.res.abs_1@0 Int)
77 (stopwatch.res.inst_0@0 Bool)
78 ) Bool
79
80 (and
81 (=
82 stopwatch.impl.usr.running@1
83 (not (= stopwatch.impl.usr.running@0 stopwatch.usr.toggle@1)))
84 (=
85 stopwatch.usr.count@1
86 (ite
87 stopwatch.usr.reset@1
88 0
89 (ite
90 stopwatch.impl.usr.running@1
91 (+ stopwatch.res.abs_1@1 1)
92 stopwatch.res.abs_1@1)))
93 (= stopwatch.res.abs_0@1 (>= stopwatch.usr.count@1 0))
94 (__node_trans_previous_0
95 stopwatch.usr.count@1
96 stopwatch.res.abs_1@1
97 stopwatch.res.inst_0@1
98 stopwatch.usr.count@0
99 stopwatch.res.abs_1@0
100 stopwatch.res.inst_0@0)
101 (not stopwatch.res.init_flag@1)
102 true)
103 )
104
105
106
107 (synth-inv str_invariant(
108 (stopwatch.usr.toggle Bool)
109 (stopwatch.usr.reset Bool)
110 (stopwatch.usr.count Int)
111 (stopwatch.res.init_flag Bool)
112 (stopwatch.res.abs_0 Bool)
113 (stopwatch.impl.usr.running Bool)
114 (stopwatch.res.abs_1 Int)
115 (stopwatch.res.inst_0 Bool)
116 ))
117
118
119
120 (define-fun
121 init (
122 (stopwatch.usr.toggle Bool)
123 (stopwatch.usr.reset Bool)
124 (stopwatch.usr.count Int)
125 (stopwatch.res.init_flag Bool)
126 (stopwatch.res.abs_0 Bool)
127 (stopwatch.impl.usr.running Bool)
128 (stopwatch.res.abs_1 Int)
129 (stopwatch.res.inst_0 Bool)
130 ) Bool
131
132 (and
133 (= stopwatch.impl.usr.running (not (not stopwatch.usr.toggle)))
134 (=
135 stopwatch.usr.count
136 (ite
137 stopwatch.usr.reset
138 0
139 (ite
140 stopwatch.impl.usr.running
141 (+ stopwatch.res.abs_1 1)
142 stopwatch.res.abs_1)))
143 (= stopwatch.res.abs_0 (>= stopwatch.usr.count 0))
144 (__node_init_previous_0
145 stopwatch.usr.count
146 stopwatch.res.abs_1
147 stopwatch.res.inst_0)
148 stopwatch.res.init_flag
149 true)
150 )
151
152 (define-fun
153 trans (
154
155 ;; Constants.
156
157
158 ;; Current state.
159 (stopwatch.usr.toggle Bool)
160 (stopwatch.usr.reset Bool)
161 (stopwatch.usr.count Int)
162 (stopwatch.res.init_flag Bool)
163 (stopwatch.res.abs_0 Bool)
164 (stopwatch.impl.usr.running Bool)
165 (stopwatch.res.abs_1 Int)
166 (stopwatch.res.inst_0 Bool)
167
168 ;; Next state.
169 (stopwatch.usr.toggle! Bool)
170 (stopwatch.usr.reset! Bool)
171 (stopwatch.usr.count! Int)
172 (stopwatch.res.init_flag! Bool)
173 (stopwatch.res.abs_0! Bool)
174 (stopwatch.impl.usr.running! Bool)
175 (stopwatch.res.abs_1! Int)
176 (stopwatch.res.inst_0! Bool)
177
178 ) Bool
179
180 (and
181 (=
182 stopwatch.impl.usr.running!
183 (not (= stopwatch.impl.usr.running stopwatch.usr.toggle!)))
184 (=
185 stopwatch.usr.count!
186 (ite
187 stopwatch.usr.reset!
188 0
189 (ite
190 stopwatch.impl.usr.running!
191 (+ stopwatch.res.abs_1! 1)
192 stopwatch.res.abs_1!)))
193 (= stopwatch.res.abs_0! (>= stopwatch.usr.count! 0))
194 (__node_trans_previous_0
195 stopwatch.usr.count!
196 stopwatch.res.abs_1!
197 stopwatch.res.inst_0!
198 stopwatch.usr.count
199 stopwatch.res.abs_1
200 stopwatch.res.inst_0)
201 (not stopwatch.res.init_flag!)
202 true)
203 )
204
205 (define-fun
206 prop (
207 (stopwatch.usr.toggle Bool)
208 (stopwatch.usr.reset Bool)
209 (stopwatch.usr.count Int)
210 (stopwatch.res.init_flag Bool)
211 (stopwatch.res.abs_0 Bool)
212 (stopwatch.impl.usr.running Bool)
213 (stopwatch.res.abs_1 Int)
214 (stopwatch.res.inst_0 Bool)
215 ) Bool
216
217 stopwatch.res.abs_0
218 )
219
220 (inv-constraint str_invariant init trans prop)
221
222 (check-synth)