@@ -4283,47 +4283,81 @@ class infinity_exprt : public nullary_exprt
4283
4283
};
4284
4284
4285
4285
// / \brief A let expression
4286
- class let_exprt : public ternary_exprt
4286
+ class let_exprt : public binary_exprt
4287
4287
{
4288
4288
public:
4289
4289
let_exprt (symbol_exprt symbol, exprt value, const exprt &where)
4290
- : ternary_exprt(
4290
+ : binary_exprt(
4291
+ multi_ary_exprt (
4292
+ ID_tuple,
4293
+ {std::move (symbol), std::move (value)},
4294
+ typet (ID_tuple)),
4295
+ ID_let,
4296
+ where,
4297
+ where.type())
4298
+ {
4299
+ }
4300
+
4301
+ using symbol_value_sequencet = std::vector<exprt>;
4302
+
4303
+ let_exprt (symbol_value_sequencet symbol_value_sequence, const exprt &where)
4304
+ : binary_exprt(
4305
+ multi_ary_exprt (
4306
+ ID_tuple,
4307
+ std::move (symbol_value_sequence),
4308
+ typet(ID_tuple)),
4291
4309
ID_let,
4292
- std::move (symbol),
4293
- std::move(value),
4294
4310
where,
4295
4311
where.type())
4296
4312
{
4297
4313
}
4298
4314
4315
+ symbol_value_sequencet &symbol_value_sequence ()
4316
+ {
4317
+ return (symbol_value_sequencet &)op0 ().operands ();
4318
+ }
4319
+
4320
+ const symbol_value_sequencet &symbol_value_sequence () const
4321
+ {
4322
+ return (symbol_value_sequencet &)op0 ().operands ();
4323
+ }
4324
+
4299
4325
symbol_exprt &symbol ()
4300
4326
{
4301
- return static_cast <symbol_exprt &>(op0 ());
4327
+ auto &sequence = symbol_value_sequence ();
4328
+ PRECONDITION (sequence.size () == 2 );
4329
+ return to_symbol_expr (sequence[0 ]);
4302
4330
}
4303
4331
4304
4332
const symbol_exprt &symbol () const
4305
4333
{
4306
- return static_cast <const symbol_exprt &>(op0 ());
4334
+ const auto &sequence = symbol_value_sequence ();
4335
+ PRECONDITION (sequence.size () == 2 );
4336
+ return to_symbol_expr (sequence[0 ]);
4307
4337
}
4308
4338
4309
4339
exprt &value ()
4310
4340
{
4311
- return op1 ();
4341
+ auto &sequence = symbol_value_sequence ();
4342
+ PRECONDITION (sequence.size () == 2 );
4343
+ return sequence[1 ];
4312
4344
}
4313
4345
4314
4346
const exprt &value () const
4315
4347
{
4316
- return op1 ();
4348
+ const auto &sequence = symbol_value_sequence ();
4349
+ PRECONDITION (sequence.size () == 2 );
4350
+ return sequence[1 ];
4317
4351
}
4318
4352
4319
4353
exprt &where ()
4320
4354
{
4321
- return op2 ();
4355
+ return op1 ();
4322
4356
}
4323
4357
4324
4358
const exprt &where () const
4325
4359
{
4326
- return op2 ();
4360
+ return op1 ();
4327
4361
}
4328
4362
};
4329
4363
0 commit comments