Module dev.civl.mc

Interface LambdaExpression

All Superinterfaces:
Expression, Sourceable

public interface LambdaExpression extends Expression
A CIVL-C quanti, bound variable declaration list, (optional) restriction and expression. It has the following syntax:
 array-lambda: 
   $lambda ( variable-decl-list | restrict? ) expression ;
 
 variable-decl-list:
   variable-decl-sub-list (; variable-decl-sub-list)* ;
   
 variable-decl-sub-list:
   type ID (, ID)* (: domain)?
 
 
e.g.,
 (int[n]) $lambda (int i) i*4
 
  • Method Details

    • freeVariable

      Variable freeVariable()
      TODO: shouldn't this be called the "bound variable"? It is the opposite of free.
      Returns:
      The free variable in this lambda expression
    • lambdaFunction

      Expression lambdaFunction()
      The expression e(x).
    • getExpressionType

      CIVLFunctionType getExpressionType()
      Specified by:
      getExpressionType in interface Expression
      Returns:
      The type of this expression. For a primitive or variable, this is the type of the primitive or variable. For a cast expression it is the cast type. For operations it is the type of the operation result.