@@ -42,30 +42,35 @@ sequence_matchest instantiate_sequence(
42
42
return instantiate_sequence (
43
43
sva_cycle_delay_expr.op (), u, no_timeframes);
44
44
}
45
- else
45
+ else // a range
46
46
{
47
- mp_integer to;
47
+ auto lower = t + from;
48
+ mp_integer upper;
48
49
49
50
if (sva_cycle_delay_expr.to ().id () == ID_infinity)
50
51
{
51
52
DATA_INVARIANT (no_timeframes != 0 , " must have timeframe" );
52
- to = no_timeframes - 1 ;
53
+ upper = no_timeframes;
54
+ }
55
+ else
56
+ {
57
+ mp_integer to;
58
+ if (to_integer_non_constant (sva_cycle_delay_expr.to (), to))
59
+ throw " failed to convert sva_cycle_delay offsets" ;
60
+ upper = t + to;
53
61
}
54
- else if (to_integer_non_constant (sva_cycle_delay_expr.to (), to))
55
- throw " failed to convert sva_cycle_delay offsets" ;
56
62
57
- auto lower = t + from;
58
- auto upper = t + to;
63
+ sequence_matchest matches;
59
64
60
- // Do we exceed the bound? Make it 'true'
65
+ // Do we exceed the bound? Add an unconditional match.
61
66
if (upper >= no_timeframes)
62
67
{
63
68
DATA_INVARIANT (no_timeframes != 0 , " must have timeframe" );
64
- return {{no_timeframes - 1 , true_exprt ()}};
69
+ matches.emplace_back (no_timeframes - 1 , true_exprt ());
70
+ upper = no_timeframes - 1 ;
65
71
}
66
72
67
- sequence_matchest matches;
68
-
73
+ // Add a potential match for each timeframe in the range
69
74
for (mp_integer u = lower; u <= upper; ++u)
70
75
{
71
76
auto sub_result =
@@ -77,6 +82,16 @@ sequence_matchest instantiate_sequence(
77
82
return matches;
78
83
}
79
84
}
85
+ else if (expr.id () == ID_sva_cycle_delay_star) // ##[*] something
86
+ {
87
+ auto &cycle_delay_star = to_sva_cycle_delay_star_expr (expr);
88
+ return instantiate_sequence (cycle_delay_star.lower (), t, no_timeframes);
89
+ }
90
+ else if (expr.id () == ID_sva_cycle_delay_plus) // ##[+] something
91
+ {
92
+ auto &cycle_delay_plus = to_sva_cycle_delay_plus_expr (expr);
93
+ return instantiate_sequence (cycle_delay_plus.lower (), t, no_timeframes);
94
+ }
80
95
else if (expr.id () == ID_sva_sequence_concatenation)
81
96
{
82
97
auto &implication = to_binary_expr (expr);
@@ -378,8 +393,7 @@ sequence_matchest instantiate_sequence(
378
393
else
379
394
{
380
395
// not a sequence, evaluate as state predicate
381
- auto obligations = property_obligations (expr, t, no_timeframes);
382
- auto conjunction = obligations.conjunction ();
383
- return {{conjunction.first , conjunction.second }};
396
+ auto instantiated = instantiate_property (expr, t, no_timeframes);
397
+ return {{instantiated.first , instantiated.second }};
384
398
}
385
399
}
0 commit comments