(no commit message)
[lambda.git] / lambda-let.html
1 <html>
2 <head>
3 <title>Lambda evaluator with lets</title>
4 <script language=JavaScript src="code/lambda.js"></script>
5 </head>
6 <body>
7
8
9 Try clicking on the "Reduce" button: <center><form> 
10 <textarea cols="80" rows="20" name=input>
11 let true = (\x (\y x)) in
12 let false = (\x (\y y)) in
13 let and = (\l (\r ((l r) false))) in
14
15 (
16
17 ((((and false) false) yes) no)
18
19 ((((and false) true) yes) no)
20
21 ((((and true) false) yes) no)
22
23 ((((and true) true) yes) no)
24
25 )
26
27 </textarea>
28 <br>
29 <input type=button value="Reduce" onClick="mytry(this.form)"> 
30 <br>
31 <textarea cols="80" rows="10" name=result></textarea>
32 </form> </center> 
33
34 <p>
35 Notes: you have to fully specify parentheses and separate your lambdas. So for example, you can't write `(\x y. y)`; you have to write `(\x (\y y))`.
36 <p>
37 The parser treats symbols that haven't yet been bound (as `yes` and `no` in the example above) as free variables.
38 <p>
39 If you try to evaluate a non-terminating form, like `((\x (x x)) (\x (x x)))`, you'll probably have to force-quit your browser and start over. Anything you had earlier typed in the upper box will probably be lost.
40
41 </body>
42 </html>