A seminar for junior and
senior CS majors and graduate students on programming languages and
software verification, with hands-on exercise in the interactive theorem prover Coq.

Topics: logic; functional programming; inductive datatypes, recursion, and structural induction; operational, denotational, and axiomatic semantics; the simply-typed lambda calculus; the polymorphic lambda calculus; pi calculus; type systems and typechecking; SAT and SMT.

Topics: logic; functional programming; inductive datatypes, recursion, and structural induction; operational, denotational, and axiomatic semantics; the simply-typed lambda calculus; the polymorphic lambda calculus; pi calculus; type systems and typechecking; SAT and SMT.

**Lecture**: MW 11:50-12:45pm, ARC 221

**Lab**: F 11:50-12:45pm, Stocker 192

**Professor**: Gordon Stewart (gstewart@ohio.edu)

**Office Hours**: Location: Stocker 355, Time: M4-5PM, W3-4pm or by
appointment

- Volume 1: Logical Foundations;
- Volume 2: Programming Language Foundations (excerpts); and
- Volume 3: Verified Functional Algorithms (excerpts).

Two IDEs for Coq are available, the Emacs-based ProofGeneral and CoqIDE (bundled with Coq). I recommend CoqIDE for new Coq users (this is also the IDE we'll be using in class); ProofGeneral is good but requires more setup and some Emacs experience.

Periodically I may assign additional supplementary (optional but recommended) readings from Types and Programming Languages, Benjamin Pierce, and from The Formal Semantics of Programming Languages, Glynn Winskel. Both of these books are available on Amazon.

In addition to the weekly homework assignments, drawn primarily from Software Foundations, there will be:

- an in-class written exam (Week 6, approximately 15% of your grade); and
- a take-home programming exam (Week 7, approximately 15% of your grade);
- a final project (finals week, approximately 20%).

Blackboard will be used only to report grades. Up-to-date information on all other aspects of the course (assignment due dates, etc.) will be posted on this website.

In general, points are assigned to homeworks rougly according to the following rubric:

Point Grade | What's Required To Get It |
---|---|

4 | Complete all or nearly all 1- through 4-star exercises in the assigned chapters, including all advanced but not necessarily all optional exercises. |

3 | Complete all or nearly all 1- through 3-star exercises in the assigned chapters, not necessarily including advanced or optional exercises. |

2 | Complete all or nearly all 1- through 2-star exercises in the assigned chapters, not including advanced and optional exercises. |

1 | Complete all or nearly all 1-star exercises in the assigned chapters, not including advanced and optional exercises. |

0 | Fail to complete nearly all 1-star exercises, or fail to turn in the assignment. |

5 (=4+1EC) | Complete all 1- through 5-star exercises in the assigned chapters, including all advanced exercises. |

"All or nearly all" means that you miss perhaps one or two exercises, at most a handful.

Average Point Grade | Letter Grade |
---|---|

>= 3.5 | A |

>= 2.5 | B |

>= 1.5 | C |

>= 0.5 | D |

< 0.5 | F |

Introduction to functional programming, Coq. Basic proofs.

Reading:
Basics,
Induction.

A0: Assignment 0.

More functional programming: polymorphism, implicit arguments,
higher-order functions. Coq proof strategies, additional tactics.

Reading:
Lists,
Poly.

A1: Complete the exercises in this week's assigned readings.
Due Monday of Week 3 by 11:59pm.

Logic in Coq, inductively defined propositions.

Reading:
Tactics,
Logic.

Supplementary Reading:
How to Write a 21st Century Proof, by Leslie Lamport

A2: Complete the exercises in this week's assigned readings.
Due Monday of Week 4 by 11:59pm.
To get a 3, you may skip the "Additional Exercises" in `Tactics.v` and all
exercises marked "Optional" in both `Tactics.v` and `Logic.v`.

Logic in Coq continued, proof objects.

Reading:
IndProp,
ProofObjects.

A3: Complete the exercises in this week's assigned readings.
Due Monday of Week 5 by 11:59pm.

The little imperative language Imp.

Reading:
Maps,
Imp.

Supplementary Reading:
Winskel, Ch. 2, Secs. 2.1-2.5.

A4: Complete the exercises in this week's assigned readings.
Due Monday of Week 6 by 11:59pm.

Verified functional programming in Coq.

Reading:
Perm (Vol. III),
Sort (Vol. III).

A5 : Complete the exercises in this week's assigned readings.
Due Monday of Week 7 by 11:59pm.

More functional programming in Coq.

Reading:
SearchTree (Vol. III),
Redblack (Vol. III).

In-class Written Exam : Wed, 10 Oct.

Take-home Midterm : released Thursday 11 Oct., due Thursday 18 Oct.

Hoare Logic.

Reading:
Equiv,
Hoare,
Hoare2.

A6 : Complete the exercises in this week's assigned readings.
Due Monday of Week 9 by 11:59pm.

Small-step operational semantics.

Reading:
Smallstep.

Supplementary Reading:
Winskel, Ch. 2, Sec. 2.6.

A7 : Complete the exercises in this week's assigned readings.
Due Monday of Week 10 by 11:59pm.

Type systems.

Reading:
Types.

Supplementary Reading:
TAPL, Chs. 1 and 8.

A8 : Complete the exercises in this week's assigned readings.
In addition, complete Final Project Checkpoint #1 by sending me an
email describing, in a short paragraph, the topic on which you plan to do your
final project. See here for final project ideas.
Both due Monday of Week 11 by 11:59pm.

Untyped Lambda Calculus, Simply-Typed Lambda Calculus.

Reading:
Stlc.

Supplementary Reading:
TAPL, Chs. 5 and 9.

A9 : Complete the exercises in this week's assigned readings.
Due Monday of Week 12 by 11:59pm.

STLC contd., progress and preservation

Reading:
StlcProp,
Typechecking.

Supplementary Reading:
TAPL, Ch. 11.

A10 : Complete the exercises in this week's assigned readings.
Due Monday of Week 13 by 11:59pm.

More STLC: let-bindings, pairs, unit, sums, lists, recursion.

Reading:
MoreStlc.

A11 : Complete the exercises in this week's assigned readings.
Due Monday of Week 14 by 11:59pm. Make sure you're also ready to complete Final Project Checkpoint #2.

Topic to be determined

Final project presentations

- Apply principles of mathematics and computing such as induction to prove properties of programs written in a functional programming language
- Apply an understanding of fundamental computer science data structures such as inductively defined lists to prove the correctness of an implementation of a sorting algorithm such as insertion sort
- Analyze the type system and operational semantics of a small imperative language in order to prove metatheoretic properties like type soundness
- Analyze a program in order to identify specifications such as Hoare-logic pre- and post-conditions that capture the program's expected behavior

3. An ability to communicate effectively in a variety of professional contexts. Students will:

- Give a presentation on the results of a final project related to software verification

6. An ability to apply computer science theory and software development fundamentals to produce computing-based solutions. Students will be able to:

- Use an interactive theorem prover to construct a computer-checked proof of type soundness for a small arithmetic expression language
- Use an interactive theorem prover to construct a computer-checked proof of type soundness for the simply-typed lambda calculus
- Use an interactive theorem prover to construct a computer-checked Hoare-logic proof for a small imperative program
- Use an interactive theorem prover or some other formal methods tool to reason about a software system of their choosing, in the context of an open-ended final project

Instructor/GA | Noninstructor (e.g., Another Student) | |
---|---|---|

You | all collaboration allowed | high-level discussion
(of the problems, not your code!)
allowed but only after you've started the assignment;
must be documented in README as described below |

You **may** discuss the homework with other students in
the class, but only after you've attempted the problems on your own
first. If you do discuss the homework problems with others, write the
names of the students you spoke with, along with a brief summary of
what you discussed, in a README comment at the top of each
submission. Example:

(*
README Gordon Stewart, Assn #1

I worked with X and Y. We swapped tips regarding the use of Coq's "rewrite" tactic. *)

However, **under no circumstances** are you permitted
to share or directly copy code or other written homework material,
except with course instructors.
If I discover that you've cheated on an
assignment, you'll get an automatic F for the course along with an immediate
referral to the
Office of Community Standards, which will likely
take disciplinary action against you.
Remember: homework is there to give *you* practice in
the new ideas and techniques covered by the course; it does you no
good if you don't engage!

In general, students in EECS courses such as this one must adhere to the Russ College of Engineering and Technology Honor Code, and to the OU Student Code of Conduct. If you haven't ever read these documents, please do so.