|
11 | 11 | #include <util/arith_tools.h>
|
12 | 12 | #include <util/ebmc_util.h>
|
13 | 13 |
|
| 14 | +#include <temporal-logic/temporal_logic.h> |
14 | 15 | #include <verilog/sva_expr.h>
|
15 | 16 |
|
| 17 | +#include "instantiate_word_level.h" |
16 | 18 | #include "obligations.h"
|
17 | 19 | #include "property.h"
|
18 | 20 |
|
@@ -240,6 +242,36 @@ std::vector<std::pair<mp_integer, exprt>> instantiate_sequence(
|
240 | 242 | auto &repetition = to_sva_sequence_consecutive_repetition_expr(expr);
|
241 | 243 | return instantiate_sequence(repetition.lower(), t, no_timeframes);
|
242 | 244 | }
|
| 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 | + } |
243 | 275 | else
|
244 | 276 | {
|
245 | 277 | // not a sequence, evaluate as state predicate
|
|
0 commit comments