Notes and Examples

  • see Paper handed out first day of class.
  • see Code for alphaleantap.tar.gz
  • see Code for test.scm

    Here is how you can run this:

    ikarus test.scm
    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 type-verifier.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 the lets rewritten as lets and all the let* rewritten as let*s. This causes all the occurrences of let and let* to disappear. This removes all the lexical context that stores positions. The only changes occurred in OBJECT and def-class.
  • 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 it).

    Assignment for April 11th class.
    Here is r* a lambda-calculus reducer.
    (define r*
      (lambda (e)
        (let ((t (r0 e (lambda (hole) hole))))
          (cond
    	((equal? t e) t)
    	(else (r* t))))))
    
    (define r0
      (lambda (e ctx)
        (match e
          (,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.
          ((,rator ,rand)
           (match rator
    	 (,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. ... Dan