edu.toronto.cs.expr
Interface Expr

All Known Implementing Classes:
AbstractExpr, ClosureExpr

public interface Expr


Field Summary
static Expr[] EMPTY_EXPR_ARRAY
           
 
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 binApply(Expr expr1, Expr expr2)
          Binary application
 boolean contains(Expr e)
          Returns true if this contains e, false otherwise.
 ExprFactory getFactory()
          Returns a factory for this expression
 boolean isWellFormed()
          Checks if this expression is well formed
 Expr naryApply(Expr[] expr)
          n-ary application
 Expr naryApply(java.util.List expr)
           
 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
 Expr unaryApply(Expr expr)
          Unary application
 

Field Detail

EMPTY_EXPR_ARRAY

static final Expr[] EMPTY_EXPR_ARRAY
Method Detail

op

Operator op()
Operator of this expression

Returns:
an Operator value

unaryApply

Expr unaryApply(Expr expr)
Unary application

Parameters:
expr - an Expr value
Returns:
an Expr value

binApply

Expr binApply(Expr expr1,
              Expr expr2)
Binary application

Parameters:
expr - an Expr value
expr - an Expr value
Returns:
an Expr value

naryApply

Expr naryApply(Expr[] expr)
n-ary application

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

naryApply

Expr naryApply(java.util.List expr)

arity

int arity()
True arity of this expression, i.e. number of top-level sub-expressions it has

Returns:
an int value

arg

Expr arg(int i)
returns i'th argument constraint: 0 <= i < arity ()

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

args

java.util.List args()
The list of arguments

Returns:
a Collection value

isWellFormed

boolean isWellFormed()
Checks if this expression is well formed

Returns:
a boolean value

subst

Expr subst(java.util.Map subMap)
Substitution of expressions by expressions

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

substOp

Expr substOp(java.util.Map subMap)
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

ExprFactory getFactory()
Returns a factory for this expression

Returns:
an ExprFactory value

contains

boolean contains(Expr e)
Returns true if this contains e, false otherwise.

Parameters:
e -
Returns: