diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2003-06-18T12·36+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2003-06-18T12·36+0000 |
commit | 94cf1f86bb5d8516583f0d39ad22dbc853019798 (patch) | |
tree | 1796f2c1494510f07bacb1fb0538e3f7a63a5b48 /src/eval.hh | |
parent | bc57eb3c8a54df819bad9c300ff5569762f15c28 (diff) |
* Lambdas, applications, substitutions.
Diffstat (limited to 'src/eval.hh')
-rw-r--r-- | src/eval.hh | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/eval.hh b/src/eval.hh index 719edb143354..2e764b1bd595 100644 --- a/src/eval.hh +++ b/src/eval.hh @@ -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); |