@@ -29,9 +29,9 @@ Function: timeframe_identifier
29
29
\*******************************************************************/
30
30
31
31
std::string
32
- timeframe_identifier (std:: size_t timeframe, const irep_idt &identifier)
32
+ timeframe_identifier (const mp_integer & timeframe, const irep_idt &identifier)
33
33
{
34
- return id2string (identifier)+ " @" + std::to_string (timeframe);
34
+ return id2string (identifier) + " @" + integer2string (timeframe);
35
35
}
36
36
37
37
/* ******************************************************************\
@@ -46,7 +46,7 @@ Function: timeframe_symbol
46
46
47
47
\*******************************************************************/
48
48
49
- symbol_exprt timeframe_symbol (std:: size_t timeframe, symbol_exprt src)
49
+ symbol_exprt timeframe_symbol (const mp_integer & timeframe, symbol_exprt src)
50
50
{
51
51
auto result = std::move (src);
52
52
result.set_identifier (
@@ -69,23 +69,23 @@ symbol_exprt timeframe_symbol(std::size_t timeframe, symbol_exprt src)
69
69
class wl_instantiatet
70
70
{
71
71
public:
72
- wl_instantiatet (std:: size_t _no_timeframes, const namespacet &_ns)
72
+ wl_instantiatet (const mp_integer & _no_timeframes, const namespacet &_ns)
73
73
: no_timeframes(_no_timeframes), ns(_ns)
74
74
{
75
75
}
76
76
77
77
// / Instantiate the given expression for timeframe t
78
- [[nodiscard]] exprt operator ()(exprt expr, std:: size_t t) const
78
+ [[nodiscard]] exprt operator ()(exprt expr, const mp_integer & t) const
79
79
{
80
80
return instantiate_rec (std::move (expr), t);
81
81
}
82
82
83
83
protected:
84
- std:: size_t no_timeframes;
84
+ const mp_integer & no_timeframes;
85
85
const namespacet &ns;
86
86
87
- [[nodiscard]] exprt instantiate_rec (exprt, std:: size_t t) const ;
88
- [[nodiscard]] typet instantiate_rec (typet, std:: size_t t) const ;
87
+ [[nodiscard]] exprt instantiate_rec (exprt, const mp_integer & t) const ;
88
+ [[nodiscard]] typet instantiate_rec (typet, const mp_integer & t) const ;
89
89
};
90
90
91
91
/* ******************************************************************\
@@ -100,7 +100,7 @@ Function: wl_instantiatet::instantiate_rec
100
100
101
101
\*******************************************************************/
102
102
103
- exprt wl_instantiatet::instantiate_rec (exprt expr, const std:: size_t t) const
103
+ exprt wl_instantiatet::instantiate_rec (exprt expr, const mp_integer & t) const
104
104
{
105
105
expr.type () = instantiate_rec (expr.type (), t);
106
106
@@ -158,7 +158,7 @@ exprt wl_instantiatet::instantiate_rec(exprt expr, const std::size_t t) const
158
158
if (to_integer_non_constant (ternary_expr.op0 (), offset))
159
159
throw " failed to convert sva_cycle_delay offset" ;
160
160
161
- const auto u = t + offset. to_ulong () ;
161
+ const auto u = t + offset;
162
162
163
163
// Do we exceed the bound? Make it 'true'
164
164
if (u >= no_timeframes)
@@ -186,7 +186,7 @@ exprt wl_instantiatet::instantiate_rec(exprt expr, const std::size_t t) const
186
186
187
187
for (mp_integer offset=from; offset<to; ++offset)
188
188
{
189
- auto u = t + offset. to_ulong () ;
189
+ auto u = t + offset;
190
190
191
191
if (u >= no_timeframes)
192
192
{
@@ -219,7 +219,7 @@ exprt wl_instantiatet::instantiate_rec(exprt expr, const std::size_t t) const
219
219
220
220
exprt::operandst conjuncts;
221
221
222
- for (auto u = t; u < no_timeframes; u++ )
222
+ for (auto u = t; u < no_timeframes; ++u )
223
223
{
224
224
conjuncts.push_back (instantiate_rec (op, u));
225
225
}
@@ -261,11 +261,11 @@ exprt wl_instantiatet::instantiate_rec(exprt expr, const std::size_t t) const
261
261
exprt::operandst conjuncts = {};
262
262
const auto i = t;
263
263
264
- for (std:: size_t k = 0 ; k < i; k++ )
264
+ for (mp_integer k = 0 ; k < i; ++k )
265
265
{
266
266
exprt::operandst disjuncts = {not_exprt (lasso_symbol (k, i))};
267
267
268
- for (std:: size_t j = k; j <= i; j++ )
268
+ for (mp_integer j = k; j <= i; ++j )
269
269
{
270
270
disjuncts.push_back (instantiate_rec (p, j));
271
271
}
@@ -338,7 +338,7 @@ Function: wl_instantiatet::instantiate_rec
338
338
339
339
\*******************************************************************/
340
340
341
- typet wl_instantiatet::instantiate_rec (typet type, std:: size_t ) const
341
+ typet wl_instantiatet::instantiate_rec (typet type, const mp_integer & ) const
342
342
{
343
343
return type;
344
344
}
@@ -357,8 +357,8 @@ Function: instantiate
357
357
358
358
exprt instantiate (
359
359
const exprt &expr,
360
- std:: size_t t,
361
- std:: size_t no_timeframes,
360
+ const mp_integer & t,
361
+ const mp_integer & no_timeframes,
362
362
const namespacet &ns)
363
363
{
364
364
wl_instantiatet wl_instantiate (no_timeframes, ns);
0 commit comments