@@ -158,8 +158,7 @@ Function: property_obligations_rec
158
158
static obligationst property_obligations_rec (
159
159
const exprt &property_expr,
160
160
const mp_integer ¤t,
161
- const mp_integer &no_timeframes,
162
- const namespacet &ns)
161
+ const mp_integer &no_timeframes)
163
162
{
164
163
PRECONDITION (current >= 0 && current < no_timeframes);
165
164
@@ -183,7 +182,7 @@ static obligationst property_obligations_rec(
183
182
184
183
for (mp_integer c = current; c < no_timeframes; ++c)
185
184
{
186
- obligations.add (property_obligations_rec (phi, c, no_timeframes, ns ));
185
+ obligations.add (property_obligations_rec (phi, c, no_timeframes));
187
186
}
188
187
189
188
return obligations;
@@ -212,7 +211,7 @@ static obligationst property_obligations_rec(
212
211
213
212
for (mp_integer u = current + lower; u <= current + upper; ++u)
214
213
{
215
- auto obligations_rec = property_obligations_rec (op, u, no_timeframes, ns );
214
+ auto obligations_rec = property_obligations_rec (op, u, no_timeframes);
216
215
disjuncts.push_back (obligations_rec.conjunction ().second );
217
216
}
218
217
@@ -244,7 +243,7 @@ static obligationst property_obligations_rec(
244
243
245
244
for (mp_integer j = current; j <= k; ++j)
246
245
{
247
- auto tmp = property_obligations_rec (phi, j, no_timeframes, ns );
246
+ auto tmp = property_obligations_rec (phi, j, no_timeframes);
248
247
disjuncts.push_back (tmp.conjunction ().second );
249
248
}
250
249
@@ -289,8 +288,7 @@ static obligationst property_obligations_rec(
289
288
290
289
for (mp_integer c = from; c <= to; ++c)
291
290
{
292
- auto tmp =
293
- property_obligations_rec (phi, c, no_timeframes, ns).conjunction ();
291
+ auto tmp = property_obligations_rec (phi, c, no_timeframes).conjunction ();
294
292
time = std::max (time, tmp.first );
295
293
disjuncts.push_back (tmp.second );
296
294
}
@@ -338,7 +336,7 @@ static obligationst property_obligations_rec(
338
336
339
337
for (mp_integer c = from; c <= to; ++c)
340
338
{
341
- obligations.add (property_obligations_rec (phi, c, no_timeframes, ns ));
339
+ obligations.add (property_obligations_rec (phi, c, no_timeframes));
342
340
}
343
341
344
342
return obligations;
@@ -363,7 +361,7 @@ static obligationst property_obligations_rec(
363
361
364
362
if (next < no_timeframes)
365
363
{
366
- return property_obligations_rec (phi, next, no_timeframes, ns );
364
+ return property_obligations_rec (phi, next, no_timeframes);
367
365
}
368
366
else
369
367
{
@@ -379,7 +377,7 @@ static obligationst property_obligations_rec(
379
377
// p U q ≡ Fq ∧ (p W q)
380
378
exprt tmp = and_exprt{F_exprt{q}, weak_U_exprt{p, q}};
381
379
382
- return property_obligations_rec (tmp, current, no_timeframes, ns );
380
+ return property_obligations_rec (tmp, current, no_timeframes);
383
381
}
384
382
else if (property_expr.id () == ID_sva_until || property_expr.id () == ID_weak_U)
385
383
{
@@ -392,7 +390,7 @@ static obligationst property_obligations_rec(
392
390
q,
393
391
(current + 1 ) < no_timeframes ? and_exprt{p, X_exprt{property_expr}} : p};
394
392
395
- return property_obligations_rec (tmp, current, no_timeframes, ns );
393
+ return property_obligations_rec (tmp, current, no_timeframes);
396
394
}
397
395
else if (property_expr.id () == ID_R)
398
396
{
@@ -407,7 +405,7 @@ static obligationst property_obligations_rec(
407
405
? and_exprt{q, or_exprt{p, X_exprt{property_expr}}}
408
406
: q;
409
407
410
- return property_obligations_rec (expansion, current, no_timeframes, ns );
408
+ return property_obligations_rec (expansion, current, no_timeframes);
411
409
}
412
410
else if (property_expr.id () == ID_strong_R)
413
411
{
@@ -417,23 +415,23 @@ static obligationst property_obligations_rec(
417
415
// p strongR q ≡ Fp ∧ (p R q)
418
416
exprt tmp = and_exprt{F_exprt{q}, weak_U_exprt{p, q}};
419
417
420
- return property_obligations_rec (tmp, current, no_timeframes, ns );
418
+ return property_obligations_rec (tmp, current, no_timeframes);
421
419
}
422
420
else if (property_expr.id () == ID_sva_until_with)
423
421
{
424
422
// Rewrite to LTL (weak) R.
425
423
// Note that lhs and rhs are flipped.
426
424
auto &until_with = to_sva_until_with_expr (property_expr);
427
425
auto R = R_exprt{until_with.rhs (), until_with.lhs ()};
428
- return property_obligations_rec (R, current, no_timeframes, ns );
426
+ return property_obligations_rec (R, current, no_timeframes);
429
427
}
430
428
else if (property_expr.id () == ID_sva_s_until_with)
431
429
{
432
430
// Rewrite to LTL (strong) R.
433
431
// Note that lhs and rhs are flipped.
434
432
auto &s_until_with = to_sva_s_until_with_expr (property_expr);
435
433
auto strong_R = strong_R_exprt{s_until_with.rhs (), s_until_with.lhs ()};
436
- return property_obligations_rec (strong_R, current, no_timeframes, ns );
434
+ return property_obligations_rec (strong_R, current, no_timeframes);
437
435
}
438
436
else if (property_expr.id () == ID_and)
439
437
{
@@ -443,7 +441,7 @@ static obligationst property_obligations_rec(
443
441
444
442
for (auto &op : to_and_expr (property_expr).operands ())
445
443
{
446
- obligations.add (property_obligations_rec (op, current, no_timeframes, ns ));
444
+ obligations.add (property_obligations_rec (op, current, no_timeframes));
447
445
}
448
446
449
447
return obligations;
@@ -458,8 +456,7 @@ static obligationst property_obligations_rec(
458
456
459
457
for (auto &op : to_or_expr (property_expr).operands ())
460
458
{
461
- auto obligations =
462
- property_obligations_rec (op, current, no_timeframes, ns);
459
+ auto obligations = property_obligations_rec (op, current, no_timeframes);
463
460
auto conjunction = obligations.conjunction ();
464
461
t = std::max (t, conjunction.first );
465
462
disjuncts.push_back (conjunction.second );
@@ -476,14 +473,14 @@ static obligationst property_obligations_rec(
476
473
auto tmp = and_exprt{
477
474
implies_exprt{equal_expr.lhs (), equal_expr.rhs ()},
478
475
implies_exprt{equal_expr.rhs (), equal_expr.lhs ()}};
479
- return property_obligations_rec (tmp, current, no_timeframes, ns );
476
+ return property_obligations_rec (tmp, current, no_timeframes);
480
477
}
481
478
else if (property_expr.id () == ID_implies)
482
479
{
483
480
// we rely on NNF
484
481
auto &implies_expr = to_implies_expr (property_expr);
485
482
auto tmp = or_exprt{not_exprt{implies_expr.lhs ()}, implies_expr.rhs ()};
486
- return property_obligations_rec (tmp, current, no_timeframes, ns );
483
+ return property_obligations_rec (tmp, current, no_timeframes);
487
484
}
488
485
else if (property_expr.id () == ID_if)
489
486
{
@@ -492,10 +489,10 @@ static obligationst property_obligations_rec(
492
489
auto cond =
493
490
instantiate_property (if_expr.cond (), current, no_timeframes).second ;
494
491
auto obligations_true =
495
- property_obligations_rec (if_expr.true_case (), current, no_timeframes, ns )
492
+ property_obligations_rec (if_expr.true_case (), current, no_timeframes)
496
493
.conjunction ();
497
494
auto obligations_false =
498
- property_obligations_rec (if_expr.false_case (), current, no_timeframes, ns )
495
+ property_obligations_rec (if_expr.false_case (), current, no_timeframes)
499
496
.conjunction ();
500
497
return obligationst{
501
498
std::max (obligations_true.first , obligations_false.first ),
@@ -507,7 +504,7 @@ static obligationst property_obligations_rec(
507
504
{
508
505
// drop reduntant type casts
509
506
return property_obligations_rec (
510
- to_typecast_expr (property_expr).op (), current, no_timeframes, ns );
507
+ to_typecast_expr (property_expr).op (), current, no_timeframes);
511
508
}
512
509
else if (property_expr.id () == ID_not)
513
510
{
@@ -519,78 +516,78 @@ static obligationst property_obligations_rec(
519
516
// ¬(φ U ψ) ≡ (¬φ R ¬ψ)
520
517
auto &U = to_U_expr (op);
521
518
auto R = R_exprt{not_exprt{U.lhs ()}, not_exprt{U.rhs ()}};
522
- return property_obligations_rec (R, current, no_timeframes, ns );
519
+ return property_obligations_rec (R, current, no_timeframes);
523
520
}
524
521
else if (op.id () == ID_R)
525
522
{
526
523
// ¬(φ R ψ) ≡ (¬φ U ¬ψ)
527
524
auto &R = to_R_expr (op);
528
525
auto U = U_exprt{not_exprt{R.lhs ()}, not_exprt{R.rhs ()}};
529
- return property_obligations_rec (U, current, no_timeframes, ns );
526
+ return property_obligations_rec (U, current, no_timeframes);
530
527
}
531
528
else if (op.id () == ID_G)
532
529
{
533
530
// ¬G φ ≡ F ¬φ
534
531
auto &G = to_G_expr (op);
535
532
auto F = F_exprt{not_exprt{G.op ()}};
536
- return property_obligations_rec (F, current, no_timeframes, ns );
533
+ return property_obligations_rec (F, current, no_timeframes);
537
534
}
538
535
else if (op.id () == ID_F)
539
536
{
540
537
// ¬F φ ≡ G ¬φ
541
538
auto &F = to_F_expr (op);
542
539
auto G = G_exprt{not_exprt{F.op ()}};
543
- return property_obligations_rec (G, current, no_timeframes, ns );
540
+ return property_obligations_rec (G, current, no_timeframes);
544
541
}
545
542
else if (op.id () == ID_X)
546
543
{
547
544
// ¬X φ ≡ X ¬φ
548
545
auto &X = to_X_expr (op);
549
546
auto negX = X_exprt{not_exprt{X.op ()}};
550
- return property_obligations_rec (negX, current, no_timeframes, ns );
547
+ return property_obligations_rec (negX, current, no_timeframes);
551
548
}
552
549
else if (op.id () == ID_implies)
553
550
{
554
551
// ¬(a->b) --> a && ¬b
555
552
auto &implies_expr = to_implies_expr (op);
556
553
auto and_expr =
557
554
and_exprt{implies_expr.lhs (), not_exprt{implies_expr.rhs ()}};
558
- return property_obligations_rec (and_expr, current, no_timeframes, ns );
555
+ return property_obligations_rec (and_expr, current, no_timeframes);
559
556
}
560
557
else if (op.id () == ID_and)
561
558
{
562
559
auto operands = op.operands ();
563
560
for (auto &op : operands)
564
561
op = not_exprt{op};
565
562
auto or_expr = or_exprt{std::move (operands)};
566
- return property_obligations_rec (or_expr, current, no_timeframes, ns );
563
+ return property_obligations_rec (or_expr, current, no_timeframes);
567
564
}
568
565
else if (op.id () == ID_or)
569
566
{
570
567
auto operands = op.operands ();
571
568
for (auto &op : operands)
572
569
op = not_exprt{op};
573
570
auto and_expr = and_exprt{std::move (operands)};
574
- return property_obligations_rec (and_expr, current, no_timeframes, ns );
571
+ return property_obligations_rec (and_expr, current, no_timeframes);
575
572
}
576
573
else if (op.id () == ID_not)
577
574
{
578
575
return property_obligations_rec (
579
- to_not_expr (op).op (), current, no_timeframes, ns );
576
+ to_not_expr (op).op (), current, no_timeframes);
580
577
}
581
578
else if (op.id () == ID_sva_until)
582
579
{
583
580
// ¬(φ W ψ) ≡ (¬φ strongR ¬ψ)
584
581
auto &W = to_sva_until_expr (op);
585
582
auto strong_R = strong_R_exprt{not_exprt{W.lhs ()}, not_exprt{W.rhs ()}};
586
- return property_obligations_rec (strong_R, current, no_timeframes, ns );
583
+ return property_obligations_rec (strong_R, current, no_timeframes);
587
584
}
588
585
else if (op.id () == ID_sva_s_until)
589
586
{
590
587
// ¬(φ U ψ) ≡ (¬φ R ¬ψ)
591
588
auto &U = to_sva_s_until_expr (op);
592
589
auto R = R_exprt{not_exprt{U.lhs ()}, not_exprt{U.rhs ()}};
593
- return property_obligations_rec (R, current, no_timeframes, ns );
590
+ return property_obligations_rec (R, current, no_timeframes);
594
591
}
595
592
else if (op.id () == ID_sva_until_with)
596
593
{
@@ -599,7 +596,7 @@ static obligationst property_obligations_rec(
599
596
auto &until_with = to_sva_until_with_expr (op);
600
597
auto R = R_exprt{until_with.rhs (), until_with.lhs ()};
601
598
auto U = sva_until_exprt{not_exprt{R.lhs ()}, not_exprt{R.rhs ()}};
602
- return property_obligations_rec (U, current, no_timeframes, ns );
599
+ return property_obligations_rec (U, current, no_timeframes);
603
600
}
604
601
else if (op.id () == ID_sva_s_until_with)
605
602
{
@@ -609,7 +606,7 @@ static obligationst property_obligations_rec(
609
606
auto strong_R = strong_R_exprt{s_until_with.rhs (), s_until_with.lhs ()};
610
607
auto W =
611
608
weak_U_exprt{not_exprt{strong_R.lhs ()}, not_exprt{strong_R.rhs ()}};
612
- return property_obligations_rec (W, current, no_timeframes, ns );
609
+ return property_obligations_rec (W, current, no_timeframes);
613
610
}
614
611
else
615
612
return obligationst{
@@ -636,10 +633,9 @@ Function: property_obligations
636
633
637
634
obligationst property_obligations (
638
635
const exprt &property_expr,
639
- const mp_integer &no_timeframes,
640
- const namespacet &ns)
636
+ const mp_integer &no_timeframes)
641
637
{
642
- return property_obligations_rec (property_expr, 0 , no_timeframes, ns );
638
+ return property_obligations_rec (property_expr, 0 , no_timeframes);
643
639
}
644
640
645
641
/* ******************************************************************\
@@ -660,12 +656,12 @@ void property(
660
656
message_handlert &message_handler,
661
657
decision_proceduret &solver,
662
658
std::size_t no_timeframes,
663
- const namespacet &ns )
659
+ const namespacet &)
664
660
{
665
661
// The first element of the pair is the length of the
666
662
// counterexample, and the second is the condition that
667
663
// must be valid for the property to hold.
668
- auto obligations = property_obligations (property_expr, no_timeframes, ns );
664
+ auto obligations = property_obligations (property_expr, no_timeframes);
669
665
670
666
// Map obligations onto timeframes.
671
667
prop_handles.resize (no_timeframes, true_exprt ());
0 commit comments