next up previous contents
Next: Introducing types into the Up: The (untyped) lambda calculus Previous: A fixed point combinator   Contents

Making sense of terms without normal forms

Recall that for terms with normal forms, the normal form denotes the ``value'' of the term. What about terms without normal forms? Are all terms without normal forms equally ``meaningless''?

Suppose we want an equivalence $\approx$ on lambda terms such that:

  1. $(\lambda x M)N \approx M\{x \leftarrow N\}$--that is, $\approx$ the equivalence induced by the $\beta $ reduction.

  2. If $M$ and $N$ do not have normal forms, then $M \equiv N$.

  3. Functions that are equated by $\approx$ yield equivalent results for the same arguments. That is, if $M \approx N$ then for all $R$, $MR \approx NR$.

Then, we can show that $\approx$ is the trivial relation the equates all terms--in other words, $M \approx N$ for all $M$, $N$!

To see this, consider the function $F$ defined by


\begin{displaymath}
F x b = \mathrm{~if~} b \mathrm{~then~} x \mathrm{~else~} (F x b)
\end{displaymath}

As we have seen above, we can plug in our definition for if-then-else and then unravel this recursive definition to yield a lambda term for $F$.

It turns out that


\begin{displaymath}
F = GG, \mathrm{~where~} G = \lambda fxb.
(\mathrm{~if~} b \mathrm{~then~} x \mathrm{~else~} (f f x b)
\end{displaymath}

Now, consider $F X \langle{\texttt{tt}}\rangle $ and $F X \langle{\texttt{ff}}\rangle $, where $\langle{\texttt{tt}}\rangle $ and $\langle{\texttt{ff}}\rangle $ are the encodings of the truth values true and false.

Now, suppose we have an equivalence $\approx$ as described above. Then


\begin{displaymath}
\begin{array}{lcl}
F Z & \rightarrow & (\lambda xb.(\mathrm...
...~} Z \mathrm{~else~} G))\\
& \rightarrow & \ldots
\end{array}\end{displaymath}

Since $F Z$ does not terminate for any $Z$, we have $FX \approx FY$ for all $X$ and $Y$. But, since $FX \approx FY$ implies that $FX M
\approx FY M$ for all M (by Condition 3 in the definition of $\approx$). But then we have $FX \langle{\texttt{tt}}\rangle \approx
FY \langle{\texttt{tt}}\rangle $. Since $F Z \langle{\texttt{tt}}\rangle \rightarrow Z$ for all $Z$, this means that $X \approx Y$ for all $X$ and $Y$!


next up previous contents
Next: Introducing types into the Up: The (untyped) lambda calculus Previous: A fixed point combinator   Contents
Madhavan Mukund 2004-04-29