@@ -11,8 +11,10 @@ Author: Daniel Kroening, kroening@kroening.com
1111#include < util/arith_tools.h>
1212#include < util/ebmc_util.h>
1313
14+ #include < temporal-logic/temporal_logic.h>
1415#include < verilog/sva_expr.h>
1516
17+ #include " instantiate_word_level.h"
1618#include " obligations.h"
1719#include " property.h"
1820
@@ -240,6 +242,36 @@ std::vector<std::pair<mp_integer, exprt>> instantiate_sequence(
240242 auto &repetition = to_sva_sequence_consecutive_repetition_expr (expr);
241243 return instantiate_sequence (repetition.lower (), t, no_timeframes);
242244 }
245+ else if (
246+ expr.id () == ID_sva_sequence_repetition_plus ||
247+ expr.id () == ID_sva_sequence_repetition_star)
248+ {
249+ // x[+] and x[*]
250+ auto &op = to_unary_expr (expr).op ();
251+
252+ // Is x a sequence or a state predicate?
253+ if (is_SVA_sequence_operator (op))
254+ PRECONDITION (false ); // no support
255+
256+ std::vector<std::pair<mp_integer, exprt>> result;
257+
258+ // we incrementally add conjuncts to the condition
259+ exprt::operandst conjuncts;
260+
261+ for (mp_integer u = t; u < no_timeframes; ++u)
262+ {
263+ // does x hold in state u?
264+ auto cond_u = instantiate (op, u, no_timeframes);
265+ conjuncts.push_back (cond_u);
266+ result.push_back ({u, conjunction (conjuncts)});
267+ }
268+
269+ // In addition to the above, x[*] allows an empty match.
270+ if (expr.id () == ID_sva_sequence_repetition_star)
271+ result.push_back ({t, true_exprt{}});
272+
273+ return result;
274+ }
243275 else
244276 {
245277 // not a sequence, evaluate as state predicate
0 commit comments