File tree 1 file changed +11
-7
lines changed 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -3009,16 +3009,16 @@ inline cond_exprt &to_cond_expr(exprt &expr)
3009
3009
// / function, respectively. The range is given by the type of the expression,
3010
3010
// / which has to be an \ref array_typet (which includes a value for
3011
3011
// / `array_size`).
3012
- class array_comprehension_exprt : public binary_exprt
3012
+ class array_comprehension_exprt : public binding_exprt
3013
3013
{
3014
3014
public:
3015
3015
explicit array_comprehension_exprt (
3016
3016
symbol_exprt arg,
3017
3017
exprt body,
3018
3018
array_typet _type)
3019
- : binary_exprt(
3020
- std::move (arg),
3019
+ : binding_exprt(
3021
3020
ID_array_comprehension,
3021
+ {std::move (arg)},
3022
3022
std::move (body),
3023
3023
std::move(_type))
3024
3024
{
@@ -3036,22 +3036,26 @@ class array_comprehension_exprt : public binary_exprt
3036
3036
3037
3037
const symbol_exprt &arg () const
3038
3038
{
3039
- return static_cast <const symbol_exprt &>(op0 ());
3039
+ auto &variables = this ->variables ();
3040
+ PRECONDITION (variables.size () == 1 );
3041
+ return variables[0 ];
3040
3042
}
3041
3043
3042
3044
symbol_exprt &arg ()
3043
3045
{
3044
- return static_cast <symbol_exprt &>(op0 ());
3046
+ auto &variables = this ->variables ();
3047
+ PRECONDITION (variables.size () == 1 );
3048
+ return variables[0 ];
3045
3049
}
3046
3050
3047
3051
const exprt &body () const
3048
3052
{
3049
- return op1 ();
3053
+ return where ();
3050
3054
}
3051
3055
3052
3056
exprt &body ()
3053
3057
{
3054
- return op1 ();
3058
+ return where ();
3055
3059
}
3056
3060
};
3057
3061
You can’t perform that action at this time.
0 commit comments