@@ -140,6 +140,32 @@ bool bmc_supports_property(const exprt &expr)
140
140
141
141
/* ******************************************************************\
142
142
143
+ Function: sva_sequence_semantics
144
+
145
+ Inputs:
146
+
147
+ Outputs:
148
+
149
+ Purpose:
150
+
151
+ \*******************************************************************/
152
+
153
+ static sva_sequence_semanticst sva_sequence_semantics (irep_idt id)
154
+ {
155
+ if (id == ID_sva_strong)
156
+ return sva_sequence_semanticst::STRONG;
157
+ else if (id == ID_sva_weak)
158
+ return sva_sequence_semanticst::WEAK;
159
+ else if (id == ID_sva_implicit_strong)
160
+ return sva_sequence_semanticst::STRONG;
161
+ else if (id == ID_sva_implicit_weak)
162
+ return sva_sequence_semanticst::WEAK;
163
+ else
164
+ PRECONDITION (false );
165
+ }
166
+
167
+ /* ******************************************************************\
168
+
143
169
Function: property_obligations_rec
144
170
145
171
Inputs:
@@ -527,16 +553,17 @@ static obligationst property_obligations_rec(
527
553
op.id () == ID_sva_strong || op.id () == ID_sva_weak ||
528
554
op.id () == ID_sva_implicit_strong || op.id () == ID_sva_implicit_weak)
529
555
{
530
- // The sequence must not match.
531
556
auto &sequence = to_sva_sequence_property_expr_base (op).sequence ();
557
+ auto semantics = sva_sequence_semantics (op.id ());
532
558
533
559
const auto matches =
534
- instantiate_sequence (sequence, current, no_timeframes);
560
+ instantiate_sequence (sequence, semantics, current, no_timeframes);
535
561
536
562
obligationst obligations;
537
563
538
564
for (auto &match : matches)
539
565
{
566
+ // The sequence must not match.
540
567
obligations.add (match.end_time , not_exprt{match.condition });
541
568
}
542
569
@@ -577,10 +604,13 @@ static obligationst property_obligations_rec(
577
604
auto &implication = to_binary_expr (property_expr);
578
605
579
606
// The LHS is a sequence, the RHS is a property.
580
- // The implication must hold for _all_ matches on the LHS,
607
+ // The implication must hold for _all_ (strong) matches on the LHS,
581
608
// i.e., each pair of LHS match and RHS obligation yields an obligation.
582
- const auto lhs_match_points =
583
- instantiate_sequence (implication.lhs (), current, no_timeframes);
609
+ const auto lhs_match_points = instantiate_sequence (
610
+ implication.lhs (),
611
+ sva_sequence_semanticst::STRONG,
612
+ current,
613
+ no_timeframes);
584
614
585
615
obligationst result;
586
616
@@ -620,9 +650,12 @@ static obligationst property_obligations_rec(
620
650
// the result is a property expression.
621
651
auto &followed_by = to_sva_followed_by_expr (property_expr);
622
652
623
- // get match points for LHS sequence
624
- auto matches =
625
- instantiate_sequence (followed_by.antecedent (), current, no_timeframes);
653
+ // get (proper) match points for LHS sequence
654
+ auto matches = instantiate_sequence (
655
+ followed_by.antecedent (),
656
+ sva_sequence_semanticst::STRONG,
657
+ current,
658
+ no_timeframes);
626
659
627
660
exprt::operandst disjuncts;
628
661
mp_integer t = current;
@@ -660,12 +693,14 @@ static obligationst property_obligations_rec(
660
693
property_expr.id () == ID_sva_implicit_strong ||
661
694
property_expr.id () == ID_sva_implicit_weak)
662
695
{
696
+ // sequence expressions -- these may have multiple potential
697
+ // match points, and evaluate to true if any of them matches
663
698
auto &sequence =
664
699
to_sva_sequence_property_expr_base (property_expr).sequence ();
700
+ auto semantics = sva_sequence_semantics (property_expr.id ());
665
701
666
- // sequence expressions -- these may have multiple potential
667
- // match points, and evaluate to true if any of them matches
668
- const auto matches = instantiate_sequence (sequence, current, no_timeframes);
702
+ const auto matches =
703
+ instantiate_sequence (sequence, semantics, current, no_timeframes);
669
704
exprt::operandst disjuncts;
670
705
disjuncts.reserve (matches.size ());
671
706
mp_integer max = current;
0 commit comments