Up: Index. Next: Language.

Introduction

When you type a lambda expression into the input field labeled "as" and press Enter, the program will display the sequence of reductions it performs in simplifying your expression in the output text area below. For example, type the following in the wide text area at the window's top.

(\x.* x x) (- 3 1)
On most computers, when you type the backslash, a lambda will appear. Thus you'll actually see the following.
(λx.* x x) (- 3 1)
The λx.* x x portion of this expression represents a function that takes a parameter x and returns the value of x * x. This expression says to pass the value of - 3 1 as the parameter into this function. (Note that functions are written using prefix notation: You place the multiplication sign first, followed by the two arguments.)

On pressing Enter, the program will display the following reductions to arrive at an answer.

(λx.* x x) (- 3 1)
= * (- 3 1) (- 3 1)
= * 2 2
= 4
Thus, the program has computed an answer of 4.

You can define symbols to represent lambda expressions by typing the symbol name into the "Define" field and the expression into the "as" field before pressing Enter.

Define sq as λx.* x x
The calculator will simplify the expression (in this case, it's already simplified) and store it in its memory. If you reference the symbol later, the calculator will substitute the expression in its place. If you now ask the calculator to simplify sq (- 3 1), it will display the following reductions.
sq (- 3 1)
= * (- 3 1) (- 3 1)
= * 2 2
= 4

Up: Index. Next: Language.