@@ -54,6 +54,13 @@ class smv_parse_treet
54
54
FAIRNESS
55
55
};
56
56
57
+ itemt (item_typet __item_type, exprt __expr, source_locationt __location)
58
+ : item_type(__item_type),
59
+ expr (std::move(__expr)),
60
+ location(std::move(__location))
61
+ {
62
+ }
63
+
57
64
friend std::string to_string (item_typet i);
58
65
59
66
item_typet item_type;
@@ -118,100 +125,106 @@ class smv_parse_treet
118
125
typedef std::list<itemt> item_listt;
119
126
item_listt items;
120
127
121
- void add_item (
122
- itemt::item_typet item_type,
123
- const exprt &expr,
124
- const source_locationt &location)
128
+ void add_assign_current (exprt lhs, exprt rhs)
125
129
{
126
- items.push_back ( itemt ());
127
- items. back (). item_type =item_type;
128
- items. back (). expr =expr;
129
- items. back (). location =location ;
130
+ items.emplace_back (
131
+ itemt::ASSIGN_CURRENT,
132
+ binary_exprt{ std::move (lhs), ID_equal, std::move (rhs)},
133
+ source_locationt::nil ()) ;
130
134
}
131
135
132
- void add_assign_current ( const equal_exprt &expr )
136
+ void add_assign_init (exprt lhs, exprt rhs )
133
137
{
134
- add_item (itemt::ASSIGN_CURRENT, expr, source_locationt::nil ());
138
+ items.emplace_back (
139
+ itemt::ASSIGN_INIT,
140
+ binary_exprt{std::move (lhs), ID_equal, std::move (rhs)},
141
+ source_locationt::nil ());
135
142
}
136
143
137
- void add_assign_init ( const equal_exprt &expr )
144
+ void add_assign_next (exprt lhs, exprt rhs )
138
145
{
139
- add_item (itemt::ASSIGN_INIT, expr, source_locationt::nil ());
146
+ items.emplace_back (
147
+ itemt::ASSIGN_NEXT,
148
+ binary_exprt{std::move (lhs), ID_equal, std::move (rhs)},
149
+ source_locationt::nil ());
140
150
}
141
151
142
- void add_assign_next ( const equal_exprt & expr)
152
+ void add_invar (exprt expr)
143
153
{
144
- add_item (itemt::ASSIGN_NEXT, expr, source_locationt::nil ());
154
+ items.emplace_back (
155
+ itemt::INVAR, std::move (expr), source_locationt::nil ());
145
156
}
146
157
147
- void add_invar ( const exprt & expr)
158
+ void add_ctlspec ( exprt expr)
148
159
{
149
- add_item (itemt::INVAR, expr, source_locationt::nil ());
160
+ items.emplace_back (
161
+ itemt::CTLSPEC, std::move (expr), source_locationt::nil ());
150
162
}
151
163
152
- void add_ctlspec ( const exprt & expr)
164
+ void add_ltlspec ( exprt expr)
153
165
{
154
- add_item (itemt::CTLSPEC, expr, source_locationt::nil ());
166
+ items.emplace_back (
167
+ itemt::LTLSPEC, std::move (expr), source_locationt::nil ());
155
168
}
156
169
157
- void add_ltlspec ( const exprt &expr )
170
+ void add_define (exprt lhs, exprt rhs )
158
171
{
159
- add_item (itemt::LTLSPEC, expr, source_locationt::nil ());
172
+ items.emplace_back (
173
+ itemt::DEFINE,
174
+ binary_exprt{std::move (lhs), ID_equal, std::move (rhs)},
175
+ source_locationt::nil ());
160
176
}
161
177
162
- void add_define (const equal_exprt &expr)
163
- {
164
- add_item (itemt::DEFINE, expr, source_locationt::nil ());
165
- }
166
-
167
- void add_fairness (const exprt &expr)
178
+ void add_fairness (exprt expr)
168
179
{
169
- add_item (itemt::FAIRNESS, expr, source_locationt::nil ());
180
+ items.emplace_back (
181
+ itemt::FAIRNESS, std::move (expr), source_locationt::nil ());
170
182
}
171
-
172
- void add_init (const exprt & expr)
183
+
184
+ void add_init (exprt expr)
173
185
{
174
- add_item (itemt::INIT, expr, source_locationt::nil ());
186
+ items. emplace_back (itemt::INIT, std::move ( expr) , source_locationt::nil ());
175
187
}
176
-
177
- void add_trans (const exprt & expr)
188
+
189
+ void add_trans (exprt expr)
178
190
{
179
- add_item (itemt::TRANS, expr, source_locationt::nil ());
191
+ items.emplace_back (
192
+ itemt::TRANS, std::move (expr), source_locationt::nil ());
180
193
}
181
-
182
- void add_invar (const exprt & expr, const source_locationt & location)
194
+
195
+ void add_invar (exprt expr, source_locationt location)
183
196
{
184
- add_item (itemt::INVAR, expr, location);
197
+ items. emplace_back (itemt::INVAR, std::move ( expr) , location);
185
198
}
186
199
187
- void add_ctlspec (const exprt & expr, const source_locationt & location)
200
+ void add_ctlspec (exprt expr, source_locationt location)
188
201
{
189
- add_item (itemt::CTLSPEC, expr, location);
202
+ items. emplace_back (itemt::CTLSPEC, std::move ( expr), std::move ( location) );
190
203
}
191
204
192
- void add_ltlspec (const exprt & expr, const source_locationt & location)
205
+ void add_ltlspec (exprt expr, source_locationt location)
193
206
{
194
- add_item (itemt::LTLSPEC, expr, location);
207
+ items. emplace_back (itemt::LTLSPEC, std::move ( expr) , location);
195
208
}
196
-
197
- void add_define (const exprt & expr, const source_locationt & location)
209
+
210
+ void add_define (exprt expr, source_locationt location)
198
211
{
199
- add_item (itemt::DEFINE, expr, location);
212
+ items. emplace_back (itemt::DEFINE, std::move ( expr), std::move ( location) );
200
213
}
201
-
202
- void add_fairness (const exprt & expr, const source_locationt & location)
214
+
215
+ void add_fairness (exprt expr, source_locationt location)
203
216
{
204
- add_item (itemt::FAIRNESS, expr, location);
217
+ items. emplace_back (itemt::FAIRNESS, std::move ( expr), std::move ( location) );
205
218
}
206
-
207
- void add_init (const exprt & expr, const source_locationt & location)
219
+
220
+ void add_init (exprt expr, source_locationt location)
208
221
{
209
- add_item (itemt::INIT, expr, location);
222
+ items. emplace_back (itemt::INIT, std::move ( expr), std::move ( location) );
210
223
}
211
-
212
- void add_trans (const exprt & expr, const source_locationt & location)
224
+
225
+ void add_trans (exprt expr, source_locationt location)
213
226
{
214
- add_item (itemt::TRANS, expr, location);
227
+ items. emplace_back (itemt::TRANS, std::move ( expr), std::move ( location) );
215
228
}
216
229
217
230
mc_varst vars;
0 commit comments