Lambda Calculus (interpreters)

LA home
 FP,  λ
 Logic,  π


Also see:
 PFL (|| λ)

λ 2

There are lazy and strict versions of the toy lambda-calculus interpreter. They both share the same input syntax and can be used on the same example lambda-calculus programs, although some programs will not work (i.e. will loop) when using the strict interpreter of course.

  Lazy Interpreter Strict Interpreter
main programs Lazy.p Strict.p
declarations define values lazy.type.P <--
interpreters proper lazy.exec.P strict.exec.P
(evaluation is print driven)
expressions lazy.eval.p
(by-need evaluation)
(strict evaluation)
apply functions lazy.apply.P strict.apply.P
process declarations lazy.D.P strict.D.P
binary operators lazy.O.P <--
unary operators lazy.U.P strict.U.P
manipulate environments lazy.env.P strict.env.P
form basic values lazy.mkval.P <--
It is a useful exercise to compare the strict and lazy versions of the above files, particularly the two *.eval.P files.
  • General routines common to both interpreters:
lexical syntax
Neither interpreter is a production system. They are as small and simple as possible, written to illustrate evaluation strategies. Notably omitted: type checker, garbage collector. The lazy interpreter can be run through this form:

There is more on [λ-calculus here] and additional [λ examples here].

window on the wide world:

Computer Science Education Week

free op. sys.
free office suite,
ver 3.4+

~ free photoshop
web browser
like it says!

© L. Allison   (or as otherwise indicated),
Faculty of Information Technology (Clayton), Monash University, Australia 3800 (6/'05 was School of Computer Science and Software Engineering, Fac. Info. Tech., Monash University,
was Department of Computer Science, Fac. Comp. & Info. Tech., '89 was Department of Computer Science, Fac. Sci., '68-'71 was Department of Information Science, Fac. Sci.)
Created with "vi (Linux + Solaris)",  charset=iso-8859-1,  fetched Monday, 21-Apr-2014 22:12:14 EST.