File tree 3 files changed +14
-6
lines changed 3 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -35,8 +35,11 @@ class bdd_nodet
35
35
return Cudd_IsComplement (node) != 0 ;
36
36
}
37
37
38
+ // / Type of indexes of Boolean variables
39
+ using indext = int ;
40
+
38
41
// / Label on the node, corresponds to the index of a Boolean variable
39
- std:: size_t index () const
42
+ indext index () const
40
43
{
41
44
return Cudd_NodeReadIndex (node);
42
45
}
@@ -147,7 +150,7 @@ class bdd_managert
147
150
return bddt (cudd.bddZero ());
148
151
}
149
152
150
- bddt bdd_variable (std:: size_t index)
153
+ bddt bdd_variable (bdd_nodet::indext index)
151
154
{
152
155
return bddt (cudd.bddVar (index ));
153
156
}
Original file line number Diff line number Diff line change @@ -39,8 +39,11 @@ class bdd_nodet
39
39
return node->node_number == 0 ;
40
40
}
41
41
42
+ // / Type of indexes of Boolean variables
43
+ using indext = std::size_t ;
44
+
42
45
// / Label on the node, corresponds to the index of a Boolean variable
43
- std:: size_t index () const
46
+ indext index () const
44
47
{
45
48
return bdd_var_to_index.at (node->var );
46
49
}
@@ -158,7 +161,7 @@ class bdd_managert : private mini_bdd_mgrt
158
161
return bddt (False ());
159
162
}
160
163
161
- bddt bdd_variable (std:: size_t index)
164
+ bddt bdd_variable (bdd_nodet::indext index)
162
165
{
163
166
auto it = index_to_bdd.find (index );
164
167
if (it != index_to_bdd.end ())
Original file line number Diff line number Diff line change 11
11
12
12
#include " bdd_expr.h"
13
13
14
+ #include < util/arith_tools.h>
14
15
#include < util/expr_util.h>
15
16
#include < util/format_expr.h>
16
17
#include < util/invariant.h>
@@ -111,8 +112,9 @@ exprt bdd_exprt::as_expr(
111
112
return true_exprt ();
112
113
}
113
114
114
- INVARIANT (r.index () < node_map.size (), " Index should be in node_map" );
115
- const exprt &n_expr = node_map[r.index ()];
115
+ auto index = numeric_cast_v<std::size_t >(r.index ());
116
+ INVARIANT (index < node_map.size (), " Index should be in node_map" );
117
+ const exprt &n_expr = node_map[index ];
116
118
117
119
// Look-up cache for already computed value
118
120
auto insert_result = cache.emplace (r.id (), nil_exprt ());
You can’t perform that action at this time.
0 commit comments