Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > contrib > by-pkgid > 8a80864b07c5f16e9ba9be320c149cfa > files > 39

teyjus-1.0_b31-15mdk.i586.rpm

/*
 * A call-by-value evaluator for the pure lambda calculus. Observe how
 * substitution is realized simply as (Lambda Prolog) application in the 
 * second clause for eval.
 */

module eval_basic.

eval  (abs R)  (abs R).
eval  (app M N)  V  :-  eval M (abs R), eval N U, eval (R U) V.