Notes and Examples
see Paper handed out first day of class.
see Code for
see Code for
Here is how you can run this:
Then the correct stuff should be imported and you can type:
> (run 1 (q) (exist (x) (proveo q '() '() '() x)))
((and (lit (pos (sym *0))) (lit (neg (sym *0)))))
What is below is irrelevant for 2009.
A Poor Man's Logic System with
First-Class Relations, a
printable version , and
source (just load it) .
code for expand-only.
code for match.
Just load cps?.ss (for ? = A | B | C | D | E | F).
code for cpsA.ss.
code for cpsB.ss.
code for cpsC.ss.
code for cpsD.ss.
code for cpsE.ss.
code for cpsF.ss.
code for cps-tests.ss.
code for cps-tester.ss.
code for kunify.ss.
code for gensyms.ss.
code for Aziz's Interpreter
code for app.ss
code for ooo7.ss
The file ooo7.ss is quite simply the file ooo6.ss, but with all
lets rewritten as
lets and all the
let* rewritten as
let*s. This causes all
the occurrences of
let* to disappear.
This removes all the lexical context that stores positions. The
only changes occurred in
Using an Abstracted Interpreter to Understand Abstract Interpretation (ps)
Using an Abstracted Interpreter to Understand Abstract Interpretation (pdf)
From Direct Style to Monadic Style
through Continuation-Passing Style
, a printable version,
and source (just load it).
Direct Style from Monadic
Style and Back , a printable
version, and source (just load
Assignment for April 11th class.
Here is r* a lambda-calculus reducer.
(let ((t (r0 e (lambda (hole) hole))))
((equal? t e) t)
(else (r* t))))))
(lambda (e ctx)
(,x (guard (symbol? x)) (ctx x))
((lambda (,id) ,body)
(r0 body (lambda (hole) (ctx `(lambda (,id) ,hole)))))
;;; in Scheme we don't go under the lambda, but here we do
;;; just for the fun of it.
(,f (guard (symbol? f)) (r0 rand (lambda (hole) (ctx `(,f ,hole)))))
((lambda (,id) ,body) (ctx (beta-subst rand id body)))
(,else (r0 rator (lambda (hole) (ctx `(,hole ,rand))))))))
;;; We have chosen to evaluate the rator first.
;;; obviously this is arbitrary.
Grab your body[id <- rand] from last semester's handout to implement
(beta-subst rand id body)
Finish implementing this reducer by defining beta-subst (see Stoy)
and then try to mini-kanrenize it.