* Lambdas, applications, substitutions.

This commit is contained in:
Eelco Dolstra 2003-06-18 12:36:12 +00:00
parent bc57eb3c8a
commit 94cf1f86bb
3 changed files with 71 additions and 4 deletions

View file

@ -60,6 +60,12 @@ using namespace std;
makeArg(Arg(Str(nm), (Bool(True), _))) => (nm, "1")
makeArg(Arg(Str(nm), (Bool(False), _))) => (nm, undef)
subst(x, e1, e2) is defined as a generic topdown term
traversal of e2, replacing each `Var(x)' with e1, and not
descending into `Lam(x, _)'.
Note: all stored expressions must be closed. !!! ugly
getFile :: Hash -> FileName
loadExpr :: Hash -> FileName
hashExpr :: Expr -> Hash
@ -76,6 +82,9 @@ Expr evalValue(Expr e);
/* Return a canonical textual representation of an expression. */
string printExpr(Expr e);
/* Perform variable substitution. */
Expr substExpr(string x, Expr rep, Expr e);
/* Hash an expression. */
Hash hashExpr(Expr e);