This repository has been archived by the owner on Oct 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 169
/
pals_floodmax.3_false-unreach-call.4.ufo.UNBOUNDED.pals.c
614 lines (587 loc) · 14.4 KB
/
pals_floodmax.3_false-unreach-call.4.ufo.UNBOUNDED.pals.c
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
extern void __VERIFIER_error() __attribute__ ((__noreturn__));
/**********************************************************************
Copyright (c) 2013 Carnegie Mellon University. All Rights Reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following acknowledgments and
disclaimers.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The names "Carnegie Mellon University," "SEI" and/or "Software
Engineering Institute" shall not be used to endorse or promote
products derived from this software without prior written
permission. For written permission, please contact
permission@sei.cmu.edu.
4. Products derived from this software may not be called "SEI" nor may
"SEI" appear in their names without prior written permission of
permission@sei.cmu.edu.
5. Redistributions of any form whatsoever must retain the following
acknowledgment:
This material is based upon work funded and supported by the
Department of Defense under Contract No. FA8721-05-C-0003 with
Carnegie Mellon University for the operation of the Software
Engineering Institute, a federally funded research and development
center.
Any opinions, findings and conclusions or recommendations expressed in
this material are those of the author(s) and do not necessarily
reflect the views of the United States Department of Defense.
NO WARRANTY. THIS CARNEGIE MELLON UNIVERSITY AND SOFTWARE ENGINEERING
INSTITUTE MATERIAL IS FURNISHEDON AN "AS-IS" BASIS. CARNEGIE MELLON
UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITHER EXPRESSED OR
IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF
FITNESS FOR PURPOSE OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS
OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT
MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT,
TRADEMARK, OR COPYRIGHT INFRINGEMENT.
This material has been approved for public release and unlimited
distribution.
DM-0000575
**********************************************************************/
/* Generated by CIL v. 1.6.0 */
/* print_CIL_Input is true */
char __VERIFIER_nondet_char(void) ;
unsigned char __VERIFIER_nondet_uchar(void) ;
_Bool __VERIFIER_nondet_bool(void) ;
void assert(_Bool arg ) ;
void __VERIFIER_assume(int arg ) ;
typedef char msg_t;
typedef int port_t;
extern void read(port_t p , msg_t m ) ;
extern void write(port_t p , msg_t m ) ;
msg_t nomsg = (msg_t )-1;
port_t p12 ;
char p12_old ;
char p12_new ;
_Bool ep12 ;
port_t p13 ;
char p13_old ;
char p13_new ;
_Bool ep13 ;
port_t p21 ;
char p21_old ;
char p21_new ;
_Bool ep21 ;
port_t p23 ;
char p23_old ;
char p23_new ;
_Bool ep23 ;
port_t p31 ;
char p31_old ;
char p31_new ;
_Bool ep31 ;
port_t p32 ;
char p32_old ;
char p32_new ;
_Bool ep32 ;
char id1 ;
unsigned char r1 ;
char st1 ;
char nl1 ;
char m1 ;
char max1 ;
_Bool mode1 ;
char id2 ;
unsigned char r2 ;
char st2 ;
char nl2 ;
char m2 ;
char max2 ;
_Bool mode2 ;
char id3 ;
unsigned char r3 ;
char st3 ;
char nl3 ;
char m3 ;
char max3 ;
_Bool mode3 ;
void node1(void)
{
{
if (mode1) {
if (r1 == 255) {
r1 = 2;
}
r1 = r1 + 1;
if (ep21) {
m1 = p21_old;
p21_old = nomsg;
if ((int )m1 > (int )max1) {
max1 = m1;
}
}
if (ep31) {
m1 = p31_old;
p31_old = nomsg;
if ((int )m1 > (int )max1) {
max1 = m1;
}
}
if ((int )r1 == 2) {
if ((int )max1 == (int )id1) {
st1 = (char)1;
} else {
nl1 = (char)1;
}
}
mode1 = (_Bool)0;
} else {
if ((int )r1 < 1) {
if (ep12) {
p12_new = max1 != nomsg && p12_new == nomsg ? max1 : p12_new;
}
if (ep13) {
p13_new = max1 != nomsg && p13_new == nomsg ? max1 : p13_new;
}
}
mode1 = (_Bool)1;
}
return;
}
}
void node2(void)
{
{
if (mode2) {
if (r2 == 255) {
r2 = 2;
}
r2 = r2 + 1;
if (ep12) {
m2 = p12_old;
p12_old = nomsg;
if ((int )m2 > (int )max2) {
max2 = m2;
}
}
if (ep32) {
m2 = p32_old;
p32_old = nomsg;
if ((int )m2 > (int )max2) {
max2 = m2;
}
}
if ((int )r2 == 2) {
if ((int )max2 == (int )id2) {
st2 = (char)1;
} else {
nl2 = (char)1;
}
}
mode2 = (_Bool)0;
} else {
if ((int )r2 < 2) {
if (ep21) {
p21_new = max2 != nomsg && p21_new == nomsg ? max2 : p21_new;
}
if (ep23) {
p23_new = max2 != nomsg && p23_new == nomsg ? max2 : p23_new;
}
}
mode2 = (_Bool)1;
}
return;
}
}
void node3(void)
{
{
if (mode3) {
if (r3 == 255) {
r3 = 2;
}
r3 = r3 + 1;
if (ep13) {
m3 = p13_old;
p13_old = nomsg;
if ((int )m3 > (int )max3) {
max3 = m3;
}
}
if (ep23) {
m3 = p23_old;
p23_old = nomsg;
if ((int )m3 > (int )max3) {
max3 = m3;
}
}
if ((int )r3 == 2) {
if ((int )max3 == (int )id3) {
st3 = (char)1;
} else {
nl3 = (char)1;
}
}
mode3 = (_Bool)0;
} else {
if ((int )r3 < 2) {
if (ep31) {
p31_new = max3 != nomsg && p31_new == nomsg ? max3 : p31_new;
}
if (ep32) {
p32_new = max3 != nomsg && p32_new == nomsg ? max3 : p32_new;
}
}
mode3 = (_Bool)1;
}
return;
}
}
void (*nodes[3])(void) = { & node1, & node2, & node3};
int init(void)
{
_Bool r121 ;
_Bool r131 ;
_Bool r211 ;
_Bool r231 ;
_Bool r311 ;
_Bool r321 ;
_Bool r122 ;
int tmp ;
_Bool r132 ;
int tmp___0 ;
_Bool r212 ;
int tmp___1 ;
_Bool r232 ;
int tmp___2 ;
_Bool r312 ;
int tmp___3 ;
_Bool r322 ;
int tmp___4 ;
int tmp___5 ;
{
r121 = ep12;
r131 = ep13;
r211 = ep21;
r231 = ep23;
r311 = ep31;
r321 = ep32;
if (r121) {
tmp = 1;
} else
if (r131) {
if (ep32) {
tmp = 1;
} else {
tmp = 0;
}
} else {
tmp = 0;
}
r122 = (_Bool )tmp;
if (r131) {
tmp___0 = 1;
} else
if (r121) {
if (ep23) {
tmp___0 = 1;
} else {
tmp___0 = 0;
}
} else {
tmp___0 = 0;
}
r132 = (_Bool )tmp___0;
if (r211) {
tmp___1 = 1;
} else
if (r231) {
if (ep31) {
tmp___1 = 1;
} else {
tmp___1 = 0;
}
} else {
tmp___1 = 0;
}
r212 = (_Bool )tmp___1;
if (r231) {
tmp___2 = 1;
} else
if (r211) {
if (ep13) {
tmp___2 = 1;
} else {
tmp___2 = 0;
}
} else {
tmp___2 = 0;
}
r232 = (_Bool )tmp___2;
if (r311) {
tmp___3 = 1;
} else
if (r321) {
if (ep21) {
tmp___3 = 1;
} else {
tmp___3 = 0;
}
} else {
tmp___3 = 0;
}
r312 = (_Bool )tmp___3;
if (r321) {
tmp___4 = 1;
} else
if (r311) {
if (ep12) {
tmp___4 = 1;
} else {
tmp___4 = 0;
}
} else {
tmp___4 = 0;
}
r322 = (_Bool )tmp___4;
if ((int )id1 != (int )id2) {
if ((int )id1 != (int )id3) {
if ((int )id2 != (int )id3) {
if ((int )id1 >= 0) {
if ((int )id2 >= 0) {
if ((int )id3 >= 0) {
if ((int )r1 == 0) {
if ((int )r2 == 0) {
if ((int )r3 == 0) {
if (r122) {
if (r132) {
if (r212) {
if (r232) {
if (r312) {
if (r322) {
if ((int )max1 == (int )id1) {
if ((int )max2 == (int )id2) {
if ((int )max3 == (int )id3) {
if ((int )st1 == 0) {
if ((int )st2 == 0) {
if ((int )st3 == 0) {
if ((int )nl1 == 0) {
if ((int )nl2 == 0) {
if ((int )nl3 == 0) {
if ((int )mode1 == 0) {
if ((int )mode2 == 0) {
if ((int )mode3 == 0) {
tmp___5 = 1;
} else {
tmp___5 = 0;
}
} else {
tmp___5 = 0;
}
} else {
tmp___5 = 0;
}
} else {
tmp___5 = 0;
}
} else {
tmp___5 = 0;
}
} else {
tmp___5 = 0;
}
} else {
tmp___5 = 0;
}
} else {
tmp___5 = 0;
}
} else {
tmp___5 = 0;
}
} else {
tmp___5 = 0;
}
} else {
tmp___5 = 0;
}
} else {
tmp___5 = 0;
}
} else {
tmp___5 = 0;
}
} else {
tmp___5 = 0;
}
} else {
tmp___5 = 0;
}
} else {
tmp___5 = 0;
}
} else {
tmp___5 = 0;
}
} else {
tmp___5 = 0;
}
} else {
tmp___5 = 0;
}
} else {
tmp___5 = 0;
}
} else {
tmp___5 = 0;
}
} else {
tmp___5 = 0;
}
} else {
tmp___5 = 0;
}
} else {
tmp___5 = 0;
}
} else {
tmp___5 = 0;
}
} else {
tmp___5 = 0;
}
} else {
tmp___5 = 0;
}
return (tmp___5);
}
}
int check(void)
{
int tmp ;
{
if (((int )st1 + (int )st2) + (int )st3 <= 1) {
if ((int )st1 + (int )nl1 <= 1) {
if ((int )st2 + (int )nl2 <= 1) {
if ((int )st3 + (int )nl3 <= 1) {
if ((int )r1 >= 2) {
goto _L___1;
} else
if (((int )st1 + (int )st2) + (int )st3 == 0) {
_L___1: /* CIL Label */
if ((int )r1 < 2) {
goto _L___0;
} else
if (((int )st1 + (int )st2) + (int )st3 == 1) {
_L___0: /* CIL Label */
if ((int )r1 >= 2) {
goto _L;
} else
if (((int )nl1 + (int )nl2) + (int )nl3 == 0) {
_L: /* CIL Label */
if ((int )r1 < 2) {
tmp = 1;
} else
if (((int )nl1 + (int )nl2) + (int )nl3 == 2) {
tmp = 1;
} else {
tmp = 0;
}
} else {
tmp = 0;
}
} else {
tmp = 0;
}
} else {
tmp = 0;
}
} else {
tmp = 0;
}
} else {
tmp = 0;
}
} else {
tmp = 0;
}
} else {
tmp = 0;
}
return (tmp);
}
}
int main(void)
{
int c1 ;
int i2 ;
{
c1 = 0;
ep12 = __VERIFIER_nondet_bool();
ep13 = __VERIFIER_nondet_bool();
ep21 = __VERIFIER_nondet_bool();
ep23 = __VERIFIER_nondet_bool();
ep31 = __VERIFIER_nondet_bool();
ep32 = __VERIFIER_nondet_bool();
id1 = __VERIFIER_nondet_char();
r1 = __VERIFIER_nondet_uchar();
st1 = __VERIFIER_nondet_char();
nl1 = __VERIFIER_nondet_char();
m1 = __VERIFIER_nondet_char();
max1 = __VERIFIER_nondet_char();
mode1 = __VERIFIER_nondet_bool();
id2 = __VERIFIER_nondet_char();
r2 = __VERIFIER_nondet_uchar();
st2 = __VERIFIER_nondet_char();
nl2 = __VERIFIER_nondet_char();
m2 = __VERIFIER_nondet_char();
max2 = __VERIFIER_nondet_char();
mode2 = __VERIFIER_nondet_bool();
id3 = __VERIFIER_nondet_char();
r3 = __VERIFIER_nondet_uchar();
st3 = __VERIFIER_nondet_char();
nl3 = __VERIFIER_nondet_char();
m3 = __VERIFIER_nondet_char();
max3 = __VERIFIER_nondet_char();
mode3 = __VERIFIER_nondet_bool();
i2 = init();
__VERIFIER_assume(i2);
p12_old = nomsg;
p12_new = nomsg;
p13_old = nomsg;
p13_new = nomsg;
p21_old = nomsg;
p21_new = nomsg;
p23_old = nomsg;
p23_new = nomsg;
p31_old = nomsg;
p31_new = nomsg;
p32_old = nomsg;
p32_new = nomsg;
i2 = 0;
while (1) {
{
node1();
node2();
node3();
p12_old = p12_new;
p12_new = nomsg;
p13_old = p13_new;
p13_new = nomsg;
p21_old = p21_new;
p21_new = nomsg;
p23_old = p23_new;
p23_new = nomsg;
p31_old = p31_new;
p31_new = nomsg;
p32_old = p32_new;
p32_new = nomsg;
c1 = check();
assert(c1);
}
}
}
return 0;
}
void assert(_Bool arg )
{
{
if (! arg) {
{
ERROR: __VERIFIER_error();
}
}
}
}