edu.toronto.cs.expr
Class ClosureExpr

java.lang.Object
  extended by edu.toronto.cs.expr.AbstractExpr
      extended by edu.toronto.cs.expr.ClosureExpr
All Implemented Interfaces:
Expr

public class ClosureExpr
extends AbstractExpr


Field Summary
static Operator CLOSURE
           
 
Fields inherited from interface edu.toronto.cs.expr.Expr
EMPTY_EXPR_ARRAY
 
Constructor Summary
ClosureExpr(Expr _body, Expr[] _params)
           
 
Method Summary
 Expr arg(int i)
          returns i'th argument constraint: 0 <= i < arity ()
 java.util.List args()
          The list of arguments
 int arity()
          True arity of this expression, i.e.
 Expr getBody()
           
 ExprFactory getFactory()
          Returns a factory for this expression
 Expr[] getParams()
           
 boolean isWellFormed()
          Checks if this expression is well formed
 Expr naryApply(Expr[] args)
          n-ary application
 Operator op()
          Operator of this expression
 Expr subst(java.util.Map subMap)
          Substitution of expressions by expressions
 Expr substOp(java.util.Map subMap)
          Substitutes operators in the expression
 
Methods inherited from class edu.toronto.cs.expr.AbstractExpr
binApply, contains, naryApply, unaryApply
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLOSURE

public static Operator CLOSURE
Constructor Detail

ClosureExpr

public ClosureExpr(Expr _body,
                   Expr[] _params)
Method Detail

getBody

public Expr getBody()

getParams

public Expr[] getParams()

op

public Operator op()
Description copied from interface: Expr
Operator of this expression

Returns:
an Operator value

naryApply

public Expr naryApply(Expr[] args)
Description copied from interface: Expr
n-ary application

Parameters:
args - an Expr[] value
Returns:
an Expr value

arity

public int arity()
Description copied from interface: Expr
True arity of this expression, i.e. number of top-level sub-expressions it has

Returns:
an int value

arg

public Expr arg(int i)
Description copied from interface: Expr
returns i'th argument constraint: 0 <= i < arity ()

Parameters:
i - an int value
Returns:
an Expr value

args

public java.util.List args()
Description copied from interface: Expr
The list of arguments

Returns:
a Collection value

isWellFormed

public boolean isWellFormed()
Description copied from interface: Expr
Checks if this expression is well formed

Returns:
a boolean value

subst

public Expr subst(java.util.Map subMap)
Description copied from interface: Expr
Substitution of expressions by expressions

Parameters:
subMap - a Map of type Expr -> Expr
Returns:
an Expr value

substOp

public Expr substOp(java.util.Map subMap)
Description copied from interface: Expr
Substitutes operators in the expression

Parameters:
subMap - a map of type Operator -> Expr mapping operators to be replaced by an expression
Returns:
an Expr value

getFactory

public ExprFactory getFactory()
Description copied from interface: Expr
Returns a factory for this expression

Returns:
an ExprFactory value