September 22, 1999 Strong Typing Slide #36

Applicative Order Solution

Similarly, instead of

        Y = f.(x.(f (x x)) x.(f (x x)))

Use

        Y = f.((x.(q.f (x x)) q.f (xx))

Then when we want to make a recurive call, apply to a dummy argument Q

For example, R becomes:

        g.(mn.(IF (IS_ZERO m) (q.n) (q.(g Q) (PRED m) (SUCC n))) Q)

The first Q in there is to force the recursive call if necessary


Next Copyright © 1999 M-J. Dominus