Lambda Calculus (interpreters)

home1 home2
 Bib
 Algorithms
 Bioinfo
 FP
 Logic
 MML
 Prog.Lang
and the
 Book

FP (external)
FP (local)
 Lambda
  Syntax
  Introduction
  λ-Examples

Also see:
 PFL (|| λ)
 Prolog
Semantics

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
output lazy.show.P
(evaluation is print driven)
strict.show.P
expressions lazy.eval.p
(by-need evaluation)
strict.eval.P
(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].

Coding Ockham's Razor, L. Allison, Springer

A Practical Introduction to Denotational Semantics, L. Allison, CUP

Linux
 Ubuntu
free op. sys.
OpenOffice
free office suite
The GIMP
~ free photoshop
Firefox
web browser

© L. Allison   http://www.allisons.org/ll/   (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 Tuesday, 19-Mar-2024 18:58:46 AEDT.