CS 4201/5201: Software Verification

Fall 2018

Software Verification

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.

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

Textbooks and Software

The primary text is Software Foundations by Pierce et al., a software verification and programming languages course available free and online. We'll be using: Before or just after the first day of class, I encourage you to download and install the Coq proof assistant (version 8.8), the tool upon which Software Foundations is based.

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.

Prerequisites

CS 3200 but also: Some mathematical maturity (at the level of "I've seen and done proofs before"), facility with a couple different programming languages, and a desire to learn.

Course Structure

The course consists of twice-weekly lectures (Mondays and Wednesdays) and a weekly lab (Fridays), during which I'll help with problems you may encounter while completing the homeworks. Ocassionally during the weekly Friday lab, we'll cover material that we didn't get a chance to cover during the MW lectures.

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

The weekly homeworks and attendance at lecture and lab are worth approximately 50%.

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.

Homework Rubric

Homework will be graded on a 0-4 scale with 4 being the best and 0 the worst. To get an A in the course, your homework grade needs to be close to 4.

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

Point GradeWhat's Required To Get It
4Complete all or nearly all 1- through 4-star exercises in the assigned chapters, including all advanced but not necessarily all optional exercises.
3Complete all or nearly all 1- through 3-star exercises in the assigned chapters, not necessarily including advanced or optional exercises.
2Complete all or nearly all 1- through 2-star exercises in the assigned chapters, not including advanced and optional exercises.
1Complete all or nearly all 1-star exercises in the assigned chapters, not including advanced and optional exercises.
0Fail 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.

From Point Grades to Letter Grades

The following table gives a rough mapping of point grades to letter grades, to give you a sense how much effort is required to get, e.g., a homework grade of A. Disclaimer: I reserve the right to change this mapping. However, I will likely revise it only in a way that is beneficial to you.

Average Point GradeLetter Grade
>= 3.5 A
>= 2.5 B
>= 1.5 C
>= 0.5 D
< 0.5 F

Schedule

The schedule is subject to revision.

Introduction to Functional Programming and Coq
Week 1 (27 Aug.)
Introduction to functional programming, Coq. Basic proofs.
Reading: Basics, Induction.
A0: Assignment 0.
Week 2
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.
Monday, 3 September: Labor Day, no class
Logic in Coq
Week 3
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.
Week 4 (17 Sep.)
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.
Week 5
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
Week 6
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.
1-3 October: Gordon away at conference, class still held
Friday, 5 October: Fall Semester Reading Day, no class
W7 (8 Oct.)
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.
Programming Language Semantics
Week 8
Hoare Logic.
Reading: Equiv, Hoare, Hoare2.
A6: Complete the exercises in this week's assigned readings. Due Monday of Week 9 by 11:59pm.
Friday, 26 October: EECS Departmental Retreat, no class
Week 9
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.
Lambda Calculus and Type Systems
Week 10
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.
Week 11 (5 Nov.)
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.
Week 12
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.
Monday, 12 November: Veterans Day, no class
Week 13 (19 Nov.)
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.
21-25 November: Thanksgiving Break, no classes
Grab Bag (Instructor+Class Choice)
Week 14
Topic to be determined
Week 15 (3 Dec.)
Final project presentations
10-15 December: Final Exams

Student Outcomes vs. Course Learning Outcomes

1. An ability to analyze a complex computing problem and to apply principles of computing and other relevant disciplines to identify solutions. Students will be able to:

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

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

Homework and Collaboration Policies

Academic Honesty Policy

Acceptable Collaboration Matrix

Instructor/GANoninstructor (e.g., Another Student)
Youall collaboration allowedhigh-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.

Students with Disabilities

If you suspect you may need an accommodation based on the impact of a disability, please contact me privately to discuss your specific needs. If you're not yet registered as a student with a disability, contact the Office of Student Accessibility Services first.