COMP 321

Design of Programming Languages: Fall 2008

Content and Aims of COMP 321


Contact Info


What's New

    On Final Projects


  1. Demo Schedule
  2. Possible topics for final projects

  3. I will hold an office hour Sunday, 5-7pm and Monday, 8:30-10 in my office (Sc 635), to discuss project choices (and anything else you want).

  4. Other office hours
  5. 7:45-9:30pm Tue
  6. 9-11pm Wed.
  7. 8-10pm, Thu
  8. You must mail your final choice of project (and who you are working with) to comp321@wesleyan.edu, with subject heading

    COMP 321 PROJECT PLAN

    By Monday night.

  9. I will put up a schedule of demos for Dec. 12-14, in my office. Prior to this meeting all members of a group should individually mail your code to comp321@wesleyan.edu, with subject

    COMP 321 FINAL PROJECT

  10. Two useful handouts, selected pages of which may be useful for some of the projects:
  11. Stansifer's treatment of Lambda Calculus and Combinators S,K, etc. starting on on pp. 242.
  12. Mitchell's treatment of type inference and unification. Take note of the unification algorithm on page 774, and the algorithm for inferring the Principal Type Scheme on p. 778.
  13. Also useful as a reference on typing rules and type-inference for the simply typed lambda-calculus: ch 9 (pp.99-111) and pp. 317-330 in Pierce's TPL


Not so new...

  1. You may turn in hw 4 on friday by 11pm. No later.
  2. Last-minute help on homework available tonight at 9:30-11pm, in Ed Morehouse's office, (Sc 630).

  3. List of Topics covered on next midterm


  4. Handout on the unification Algorithm from Llloyd's: Foundations of Logic Programming

  5. HW 4 due date moved to Dec. 4.

  6. Some (possibly helpful) hints for homework assignment 4.

  7. DROP the soundness problem (the last part of problem 2) from homework number 3, part 1.
    I will add it onto homework 4, and cover the basic ideas in class first.
    Here is a sketch of the proof of soundness with some cases worked out. You just have to fill in the missing cases. If you have already turned it in, that's fine, but you may certainly turn in a new version if you want.

  8. Some FAQs on the latest homework.
  9. Homework help session in Sc 109, at 8:10 PM
  10. Midterm II: Dec. 4.
  11. An advance view of Possible Final Projects

  12. Homework due dates changed:
  13. Homework III, Part 1, due Nov.12
  14. Homework III, Part 2, due Nov.18
  15. Homework IV: due Dec. 4
  16. Solutions to Midterm I
  17. The original emacs-mode for prolog prolog.el.
  18. A new and improved emacs-mode for prolog: debian web page with source code and links to documentation
  19. Reread (or read for the first time, if relevant) the Slides on predicate logic and natural deduction
  20. Read the first 100pp. (and more as needed) in Clocksin and Mellish


  21. Carefully read the handout on Sequent Calculus and Logic Programming
  22. Read the handout on Sets and Cardinality

  23. New Homework Assignments 3 and 4
  24. The test will cover...
  25. Read chapters 2,3,5 in Proofs and Types and the slides on Predicate Logic and Natural Deduction below.
  26. A new handout for strategies for building natural deduction proofs

  27. Due date for the Lambda Calculus part of HW 1 moved to Oct. 9, 11:59pm Please mail it following the instructions for hw1 below, but with the following changes:

  28. using subject heading

    <userid> COMP 321 hw1.5

  29. attach all code to your email in a single file called lambda.sml
  30. There will be a help session for homework on Tue. Oct 7 at 8 PM.
  31. Due date for Homework 2 postponed until October 16
  32. On homework:
  33. Mail homework in a single file called hw1.sml, as an attachment, to

    comp321@wesleyan.edu
    with subject heading eggzactly

    <userid> COMP 321 hw1

    The file may include helper functions.


  34. Homework 1 now has a new problem, quicksort. The due date has been moved to sept. 30.


  35. Types in PL must be ordered directly through Amazon or some comparable source

  36. See the Assigments section below, for programming assignments and due dates
  37. Since the handout on Context-free languages you got in class was somewhat odd (it was missing the even numbered pages) you will get a better one in class on tue.

  38. Since Types in PL has not arrived at the bookstore yet, we will start reading
  39. Proofs and Types by Girard, Lafont, Taylor. Read the following pages (page numbers are the ones wrtten on the pages, NOT the PDF viewer):
  40. Chapter 2 (Natural deduction) entirely
  41. Briefly look over chapter 1, to pick up a few ideas about logic. It's mainly of a philosophical nature.
  42. Handout on Sets and Cardinality
  43. Handout on Induction, Term Algebras and Closure
  44. Slides on the Lambda Calculus
  45. Natural Deduction Rules (propositional)
  46. Natural Deduction Rules (quantifiers)
  47. Notes (from COMP 131) on Propositional Logic and Truth Tables
  48. Slides on predicate logic and natural deduction

Other texts for the course

  • The main references on Programming Languages will be Types and Programming Languages by Benjamin Pierce, the online reference Proofs and Types (see below), and Programming in Prolog by W. F. Clocksin, C. S. Mellish.

    We will use handouts and chapters from a variety of sources throughout the course as well.


  • All Handouts available for this course

  • Slides on the Lambda Calculus
  • New! Slides on Strategies for building natural deduction proofs
  • Handouts and slides on Logic and Logic Programming
  • Handout on Sets and Cardinality
  • Handout on Induction, Term Algebras and Closure
  • Natural Deduction Rules (propositional)
  • Natural Deduction Rules (quantifiers)
  • Notes (from COMP 131) on Propositional Logic and Truth Tables
  • Slides on predicate logic and natural deduction
  • Slides for lectures on
  • LK: the Sequent Calculus, and
  • logic programming

  • About Homework

  • See the Assigments section below, for programming assignments and due dates
  • Start familiarizing yourself with ML. How? Read the first 100 pages of EOMP. Also:
  • If you read Bob Harper's
  • short tech report: Introduction to Standard ML , OR, the much more up to date
  • Chapters 2-7 (inclusive) of his much more comprehensive
    Programming in Standard ML

  • you will have most of the working knowledge of ML you will need.

    Theoretical matters of importance (type inference and polymorphism) arte covered in later chapters, as well as the use of the module suystem, which will prove very useful, in fact essential.

  • Some elementary tips on using Unix and emacs

  • Unix tips
  • To write an SML program on most unix hosts (with emacs and smlnj installed) such as sml.wesleyan.edu fire up emacs, and call your file <filename>.sml Then emacs will automatically enter SML-mode, which is convenient for editing programs in SML.

    Documentation on using Emacs features in SML (so-called SML-mode) is described in detail here (actually, too much detail!, so if you want a simple intro, read the next item and show up in class).

  • An sml-mode resource web page, with links to version 4.0.
  • You should log into sml.wesleyan.edu, fire up emacs, edit your first sml program, and load it into the interpreter. You may Use the SML menu to see how to do this. But here's a five line tutorial.
  • Make sure all the highlighting features are turned on (see the Options menu)
  • Once you've finished editing: type C-cC-l. The first time you do this, this will:
    • Ask you which sml interpreter to fire up (and offer you "sml" as a default choice, which you just accept by hitting <ENTER>.
    • Then ask ou which file you want to load, and offer you the name of the buffer you were editing as a default. You just accept by hitting <ENTER> again. This means in practice you may never type "use" unless you want to load one file from within another (more on loading modules later). Also, in practice you may choose to put in the expression you wish to evaluate at the end of your file, rather than typing anything in at the sml prompt. We'll discuss this in class.
  • Once sml is fired up, C-cC-l. will just send the file you have edited to the interpreter.
  • Other features this is just icing on the cake for now, but there are some pretty fancy features to save keystrokes. Try sml-electric-pipe in a function definition!
  • email address and instructions for mailing code

    Programming Homework must be sent to
    comp321@wesleyan.edu
    

  • Your subject heading must be

    COMP 321 HW 1 The course machine will be sml.wesleyan.edu, also known as rintintin.wesleyan.edu (its real name).

  • sml-mode is installed and should work now (see below for an explanation).

  • Programming Language Resources

    ML Resources

  • Robert Harper's comprehensive Programming in Standard ML
  • Users Guide for Standard ML of New Jersey.
  • Harper's old 1986 notes are still a great crash course on the subject, and will be handed out in class.
  • The EMACS program editor

    It is just about indispensable to become familiar with the emacs program editing environment. Ciao prolog runs inside it, and it contains special modes that highlight and format prolog and SML programs.

    Some resources for emacs use:

  • Some tips on how to use emacs
  • the home page for EMACS for windows (downloads and documentation).
  • You can download a tarred gzipped sml-modefile here.
  • An sml-mode resource web page, with links to version 4.0. Thanks to your classmate Jeremy Fisher.

  • Prolog Resources

  • The first 100 pages of Clocksin and Mellish' Programming in Prolog
  • The SWI-Prolog platform: downloadable and well-documented

    Just do it.

  • The emacs-mode for prolog prolog.el.
  • Midterms

    Midterms determine 40% of your grade. Homework (40%) and the final project (20%) determine the rest.

    Assignments

  • Homework Assignment 1
  • Homework Assignment 2
  • Homework Assignment 3 due Nov. 12 (part I), Nov. 18 (part II)
  • Homework Assignment 4 due date: Dec. 2
  • Homework Assignment 5: final projects due date: Dec. 14

  • Detailed textbook info

    
    Types and Programming Languages
    Benjamin C. Pierce
    
    The MIT Press
    Massachusetts Institute of Technology
    Cambridge, Massachusetts 02142
    http://mitpress.mit.edu
    ISBN 0-262-16209-1 
    
  • Ullman's Elements of ML Programming . , ML97 edition (aka Second edition)
     
    
     Product Details 
    
         * Paperback: 383 pages 
         * Publisher: Prentice Hall; 2nd edition (December 22, 1997) 
         * Language: English 
         * ISBN: 0137903871 
     
  • Online textbook: Proofs and Types by Girard, Laffont, Taylor.
  • Programming in Prolog (Paperback)
    by W. F. Clocksin, C. S. Mellish
    Paperback (3rd, rev., and extended ed) 			16 used & new from $0.55
    
     
    Book Description
    
    Originally published in 1981, this was the first textbook on
    programming in the Prolog language and is still the definitive
    introductory text on Prolog. Though many Prolog textbooks have been
    published since, this one has withstood the test of time because of
    its comprehensiveness, tutorial approach, and emphasis on general
    programming applications. 
    
    Product Details
    
        * Paperback: 281 pages
        * Publisher: Springer-Verlag Telos; 4th edition (September 1994)
        * ISBN: 0387583505 
     
    
  • 
            September
       Su Mo Tu We Th Fr Sa
           1  2  3  4  5  6
        7  8  9 10 11 12 13
       14 15 16 17 18 19 20
       21 22 23 24 25 26 27
       28 29 30
    
           October               November               December
    Su Mo Tu We Th Fr Sa   Su Mo Tu We Th Fr Sa   Su Mo Tu We Th Fr Sa
              1  2  3  4                      1       1  2  3  4  5  6
     5  6  7  8  9 10 11    2  3  4  5  6  7  8    7  8  9 10 11 12 13
    12 13 14 15 16 17 18    9 10 11 12 13 14 15   14 15 16 17 18 19 20
    19 20 21 22 23 24 25   16 17 18 19 20 21 22   21 22 23 24 25 26 27
    26 27 28 29 30 31      23 24 25 26 27 28 29   28 29 30 31
                           30
    
    	  
    Last modified: Thu Dec 11 18:59:08 EST 2008