CSE 3001/5040: Programming Languages (Spring 1999)

General info

Instructor

Ryan Stansifer, contact info at http://www.cs.fit.edu/~ryan , e-mail address ryan@cs.fit.edu

Lectures

Lectures are from 5pm to 6:15pm Tuesday and Thursday in P133 (the Library Building).

WWW-based Bulletin Board

The Computer Sciences ListServ Site has a WWW-based bulletin board especially for this class. Please read and contribute to it.

Overview

This is a course in comparative programming languages. We do not stress learning individual languages, but instead the fundamental concepts important to the field. We will study the major programming language paradigms: imperative, logic and functional. Among the other topics discussed are syntax, semantics, types and objects, exception handling, and modules.

Why study programming languages?

Prerequisites

Students are expected to know how to program in an imperative language like Ada and Pascal, and to know about algorithms and data structures. Such material is taught in CSE 1001, 1002, 2010 in the undergraduate curriculum and CSE 5015 and 5020 in the CIS curriculum. Some mathematical sophistication is desirable. The more you know, the more you learn.

Textbook

The textbook for this class is:

Robert W. Sebesta Concepts of Programming Languages, 4th ed. Reading, Masachusetts: Addison-Wesley, 1999.
Description: xv, 670 pages; 24 cm.
ISBN: 0-201-38596-1

We will not follow the book closely, and we will take some of the material in a different order. We will not have time to cover every topic in the book in class, but you will be held responsible for knowing everything in the book. (Graduate students taking the comprehensive exam are required to know everything in the book for the exam.) The book has plenty of good material, you should read all of it. Buy the book, start reading it now! To prepare for class re-read the appropriate chapters as we come to those topics during the course of the semester. Many homework exercises will come from the textbook.

In class we will use examples from the Ada programming language, if you wish to aquaint yourself with the language, I recommend Chapter 1 of Norm Cohen's book Ada as a Second Language. One project will be written in Modula-3; its definition is a mere 50 pages. Another project will be written in SML; a concise introduction can be found in "Tips for Computer Scientists on Standard ML" (local PostScript Copy) by Mads Tofte. Information about polymorphism can be found in the excellent paper On Understanding Types (local PostScript copy) by Cardelli and Wegner. An example proof in Hoare logic is available on the WWW. The Pascal examples using function parameters show the syntax of the original Pascal and modern versions.

To view PostScript files you may have to configure your browser to invoke the program /software/X11R6.3/bin/ghostview for the MIME type application/postscript.

Negation-as-failure.

Consider the Prolog program with not:
P(a).
Q(x) :- not (P(b)).
not is defined operationally in Prolog as:
not(C) :- call(C),!,fail.
not(C).

The query P(b)? does not succeed, so the query Q(b)? does succeed (x is bound to nothing!). In Prolog we conclude Q(b) is true; but is it?

Logically we have P(a) & forall x ¬P(b) => Q(x) which does not imply Q(b). The absence of the assertion P(b) does not imply (logically) ¬P(b).

Post System

Hofstadter's Mu system

Pick strings for x and y and try to extend the proof to derive MU.

Grading and assignments

There will be an in-class midterm and a final exam. In addition, we anticipate that there will be about three homework assignments and three projects. No late work is accepted. These homework assignments are important. We encourage you to work together, as long as you individually understand, and write up the solutions. Please take the effort to do a good job; partial credit will be awarded sparingly. Remember a problem is not correct until it is written up well enough to convince a three-toed sloth that it is the correct answer.

A midterm and a final exam will be given. The grade for the course will be based 60 percent on the exams, 40 percent on the assignments and projects. If you use some source in solving the homework or the projects, you must cite it. Anyone representing someone else's work as their own, will receive an F for the class.

For each student the numeric scores for the assignments and exams are recorded. If you have any question about your standing in the class, or if some score has been recorded wrong, please contact me. Please keep in mind the CS honor code.

Please note, that copies of some work (homework, projects, exams, etc) for undergraduate classes may be kept on file for review by the CSAB, for the purposes of maintaining the accreditation of the CS program.

Projects

There will be three small projects in this course. The first project is to create a WWW page with information about some programming language and to write a Java applet. The second project will be written in Modula-3 and concerns linked lists. Since Modula-3 is much like Ada and Pascal, programming in Modula-3 should pose no special problem. The third project will be to write a tautology checker in ML. This project will be implemented in a functional style, i.e., without using the assignment statement. You may work together on the programming assignments in groups of no more than two people. Please do not work with the same person twice.

These projects will require that all students have an Harris Lab account.

Calendar and Important Dates

Tuesday, January 12, 1999first lecture
Tuesday, January 19, 1999RE, BNF[POPL]
Thursday, January 21, 1999Modula-3 [POPL]
Thursday, January 28, 1999HW #1
Friday, February 5, 1999WWW project
1999HW #2
Thursday, February 25, 1999midterm exam
Friday, March 5, 1999last day to withdraw
March 8-12, 1999Spring break (no classes)
Friday, March 19, 1999M3 project (Part I)
Friday, March 26, 1999M3 project (Part II)
1999HW #4
Thursday, April 29, 1999last lecture
Friday, April 30, 1999SML project
Tuesday, May 4, 1999final exam (6:00pm-8:00pm)

Syllabus

Week 1
Introduction, history, study of language.

Week 2
Formalizing syntax: Regular expressions, BNF

Week 3
Formalizing semantics: Attribute grammars, Post systems

Week 4
Bindings, environments, pointer

Week 5
Data types and polymorphism

Week 6
Blocks, scope, subprograms

Week 7
Exception handling

Week 8
Implementing block structured languages

Week 9
Abstract data types and modules

Week 10
Object-Oriented programming

Week 11
Logic programming: PROLOG

Week 12

Week 13
Functional programming language: ML

Week 14
Functional programming language: ML

Week 15
Functional programming language: ML

References

See the bibliography in The Study of Programming Languages.
Ryan Stansifer <ryan@cs.fit.edu>
File location: http://www.cs.fit.edu/~ryan/cse3001/index.html
Last modified: Wed Apr 7 14:20:20 EDT 1999