Course Summary

This course will cover functional and logic programming, concepts of programming language design, and formal reasoning about programs and programming languages. The following are the course learning objectives:

Functional Programming (ML/OCaml)

Small-step and large-step operational semantics

Denotational semantics

Fixpoints, fixpoint induction

Axiomatic semantics

Type theory

Untyped and simply typed lambda calculus

Partial evaluation, non-determinism

Logic programming

Through taking this course, students will learn the tradeoffs of imperative vs. non-imperative programming languages, issues involved in designing a programming language, the role of formal semantics and type-systems in reasoning about programs and languages, and proof techniques related to programming language design.

The course is open to Ph.D. students and Masters students. Interested undergraduates should see the instructor for permission to take the course.

Prerequisites: Discrete Structures (CS 3305/5333 or equivalent), Algorithm Analysis and Data Structures (CS 3345/5343 or equivalent), Automata Theory (CS 4384/5349 or equivalent). A solid background in all three of these areas will be heavily assumed throughout the course!

To Prepare for the Course...

Although the early course lectures will include a brief survey of the OCaml programming language, students will be expected to learn most of OCaml on their own. Therefore, if you want to get a head start, I recommend downloading and installing OCaml, and walking yourself through some of the many online tutorial examples:

Download OCaml from the INRIA website. Feel free to use any version you find easiest to get running. If you are comfortable with unix, I recommend using one of the unix versions. If you prefer Windows, I recommend the Microsoft-based native Win32 precompiled binary. (Using the Cygwin binaries can be difficult unless you are already familiar with Cygwin and how to configure it.)

Once you've successfully installed OCaml, try creating a simple program and compiling it. OCaml programs are plain text files, just like C programs. Using your favorite text-editor, create a file named "fib.ml" containing the code found in section 1.9 of the online OCaml manual. At the unix or DOS prompt, type one of the following to compile the program:

On Unix, type: ocamlc -o fib fib.ml

At the DOS prompt, type: ocamlc -o fib.exe fib.ml

(Be sure that the ocamlc.exe binary is in your path and that the fib.ml file you created is in your current directory.) If it compiles successfully, type fib 10 to get it to print the 10th Fibonacci number.

Start experimenting with the other examples found on page 3 of the OCaml manual. The other examples on that page use OCaml in interactive mode (where you use OCaml sort of like a calculator instead of a compiler). You can either go ahead and use OCaml in interactive mode or incorporate the examples into your .ml file and recompile it to see the results.

OCaml is an extremely powerful language and has many features that we won't be using in the course. However, in most of the programming assignments you will be free to use any OCaml language features you wish, so the more OCaml you learn, the easier you will find the assignments.

Using OCaml from the UTD Server

If you can't get OCaml to work on your personal machine, you can use OCaml on the UTD CS Dept. Linux servers. To do so:

ssh to cslinux2.utdallas.edu

at the Unix prompt, type ocaml to enter interactive mode, or type ocamlc to use the compiler

to exit interactive mode, at the OCaml prompt type: exit 0;;

OCaml is available on each of the following CS servers: cslinux2.utdallas.edu, cscomp.utdallas.edu, cscomp1.utdallas.edu, cscomp2.utdallas.edu, cscomp3.utdallas.edu. When connecting from off-campus, ssh to cs1.utdallas.edu or cs2.utdallas.edu first, and then ssh to one of the other machines from there.

Grading

Homework (40%): Homeworks will be assigned approximately once per 1.5 weeks, and will consist of a mix of programming assignments and written assignments. All programming assignments will be done in Ocaml or Prolog. Written assignments will typically involve discrete math proofs. Homeworks must be turned in at the start of class (i.e., by 4:05pm) on the due date. No late homeworks will be accepted.

Midterm (25%): There will be an in-class midterm exam on Thursday, October 2. The exam will cover functional programming, operational semantics, denotational semantics, and fixpoints.

Final (35%): The final exam for the course is scheduled for 2:00pm Thursday, December 11. The exam will be cumulative, covering all material in the course. Students will have 2 hours and 45 minutes to complete it.

Texts

The course has no required textbook, but we will make use of several online references: