Skip to content

Commit cd52307

Browse files
committed
Add documentation to array_comprehension_exprt
1 parent 2fbe5e1 commit cd52307

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/util/std_expr.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4462,6 +4462,14 @@ inline cond_exprt &to_cond_expr(exprt &expr)
44624462

44634463
/// \brief Expression to define a mapping from an argument (index) to elements.
44644464
/// This enables constructing an array via an anonymous function.
4465+
/// Not all kinds of array comprehension can be expressed, only those of the
4466+
/// form `[f(x) | x in {0, 1, ... array_size-1}]`.
4467+
/// The LHS and RHS are the argument (`x`) and body (`f(x)`) of the anonymous
4468+
/// function, respectively. The range is given by the type of the expression,
4469+
/// which has to be an \ref array_typet (which includes a value for
4470+
/// `array_size`).
4471+
/// For legacy reasons, the ID of an array_comprehension_exprt is ID_lambda,
4472+
/// even though it cannot be used to represent arbitrary lambda functions.
44654473
class array_comprehension_exprt : public binary_exprt
44664474
{
44674475
public:

0 commit comments

Comments
 (0)