@@ -42,30 +42,35 @@ sequence_matchest instantiate_sequence(
4242 return instantiate_sequence (
4343 sva_cycle_delay_expr.op (), u, no_timeframes);
4444 }
45- else
45+ else // a range
4646 {
47- mp_integer to;
47+ auto lower = t + from;
48+ mp_integer upper;
4849
4950 if (sva_cycle_delay_expr.to ().id () == ID_infinity)
5051 {
5152 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;
5361 }
54- else if (to_integer_non_constant (sva_cycle_delay_expr.to (), to))
55- throw " failed to convert sva_cycle_delay offsets" ;
5662
57- auto lower = t + from;
58- auto upper = t + to;
63+ sequence_matchest matches;
5964
60- // Do we exceed the bound? Make it 'true'
65+ // Do we exceed the bound? Add an unconditional match.
6166 if (upper >= no_timeframes)
6267 {
6368 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 ;
6571 }
6672
67- sequence_matchest matches;
68-
73+ // Add a potential match for each timeframe in the range
6974 for (mp_integer u = lower; u <= upper; ++u)
7075 {
7176 auto sub_result =
@@ -77,6 +82,16 @@ sequence_matchest instantiate_sequence(
7782 return matches;
7883 }
7984 }
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+ }
8095 else if (expr.id () == ID_sva_sequence_concatenation)
8196 {
8297 auto &implication = to_binary_expr (expr);
@@ -378,8 +393,7 @@ sequence_matchest instantiate_sequence(
378393 else
379394 {
380395 // 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 }};
384398 }
385399}
0 commit comments