Logic and Computation
CS 2800 Spring 2022

Khoury College of Computer Sciences
Northeastern University

Sections

For Instructors and TAs, click on Contact Info on your left.

Rules

Books and Supplies

The course book will be freely distributed to you during the semester. Click on Lecture Notes on your left.

An optional book that includes a lot of exercises is: Computer Aided Reasoning. Kaufmann, Manolios, Moore. You can order it from here. Please note that the book was written for at least upper level undergraduate students, so expect parts of the book to be hard. Also, in class we use ACL2s, a version of ACL2 that includes contracts and lots of other things that are not mentioned in the book. Nevertheless, this is the standard reference for ACL2 and contains many exercises whose solutions are available online.

Software

We will be using the ACL2s system. Please download it and install it on your machines, using the instructions from the first lab. It is also available on the Khoury Virtual Desktops, which allow you to run ACL2s with only a browser. See lab 1 for more information.

Academic Integrity

Read and intimately familiarize yourselves with the Northeastern Academic Integrity policy.

Warning: We do not tolerate any violations. If we believe that you violated the policy, we will report you to the university and to the college. If you remain in the class, your grade will be reduced, most likely to an F, at our discretion. In addition the university and the college can impose further penalties, including not allowing you to go on co-op; even expulsion from the university is possible in severe cases.

For example, here is something you cannot do, but again, read the full policy, the course contract and see Mitch Wand's Web page on the topic.

Unauthorized Collaboration: The University defines unauthorized collaboration as instances when students submit individual academic works that are substantially similar to one another. While several students may have the same source material, the analysis, interpretation, and reporting of the data must be each individual's independent work.

You can only collaborate with your partners on homework problems. Besides staff, the use of any other sources for homework solutions is a violation of the academic integrity policy. For exams you have to work alone and cannot use any resources beyond those explicitly allowed.

If you have any doubts at all whether something is allowed or not, please ask! For example, you can (and are encouraged to) discuss the material we cover in class with anyone. Collaboration, interaction, debate and discussion is encouraged, except for graded work as outlined above.

Exams

There will be five in-class exams and they will be during labs. You have to take exams in the lab you are registered for. The tentative dates for exams are: 2/11, 3/4, 3/25, 4/8, 4/22.

Grading

Grades will be determined as follows.

There is no final.

Homeworks will be given about once a week. Your homework grade will be based on your top ten homeworks. You will mostly work in groups. We will give you instructions on group sizes and composition. We may only grade a subset of the problems assigned. Homeworks will be due on Tuesday at 10:00PM, unless otherwise noted.

We will drop your lowest exam grade, i.e., only four of the five exams will count towards your final grade.

Grading Notes

Labs

All exams are held during labs. If there is no exam, you will spend most of your time working on problems that we distribute in advance. If you solve the problems on your own before lab and are confident in your solutions, there is no need to show up. If you did not have time to solve the problems, or you tried and ran into trouble, then go to lab.

Prerequisites

CS 1800 and CS 2500.
If you do not have this background you should get the permission of the instructor. Our policy is that we do not grant exemptions if you did not getting passing grades in both the prerequisites: experience has shown that this is the best policy for students.


Tentative Schedule

Week
Topics
Readings
Jan 17
L1-L2
  1. Introductions & motivation
  2. Course overview, Programming review
  1. None
  2. None
Jan 24
L3-L5
  1. Designing data-driven programs, the ACL2s development environment
  2. Basic data types, expressions, syntax & semantics of atomic data and associated primitive functions
  3. Syntax & semantics of lists, design considerations of the ACL2s core language, contracts, termination, quote, let
  1. None
  2. 2.1-2.4
  3. 2.5-2.11
Jan 31
L6-L8
  1. Datatypes: enumerated, range, product, record, union, list, (mutually) recursive; pattern matching
  2. Contract-based testing, expression coverage and designing programs
  3. Property-based testing
  1. 2.12-2.13
  2. 2.14-2.17
  3. 2.18-2.22
Feb 7
L9-L11
  1. Property-based testing in industry, Fuzzing, security applications
  2. Boolean logic, truth tables, characterization of formulas, Security: one-time pads
  3. Introduction to P=NP, Properties of Boolean operators, Proof methods: instantiation, case analysis, equational proofs, decision procedures
  1. 3-3.2
  2. 3.3-3.5
  3. 3.6-3.10
Feb 14
L12-L14
  1. Boolean logic in ACL2s, Normal forms
  2. Shannon Expansions
  3. Set Theory Connections, Boolean Algebra based on sets, resolution-based SAT solving
  1. 4
  2. 4.1
  3. 4.2-4.4
Feb 21
L15-L16
  1. Limitations of Boolean logic, intro to equational reasoning for programs, Axioms for equality, cons-first-rest axioms, definitional axioms, instantiation, contract checking and completion
  2. Equational reasoning with nested Boolean operators, derived context
  1. 4.5
  2. 4.6
Feb 28
L17-L19
  1. Context vs. theorems, numeric reasoning in C & other languages
  2. How to prove theorems using equational reasoning, formalization examples, proof examples
  3. Definitions: soundness, termination, contracts, the ACL2s Definitional Principle
  1. None
  2. 5.1
  3. None
Mar 7
L20-L22
  1. Termination, measure functions
  2. Using termination to show soundness of common recursions schemes, big-Oh analysis as a refinement of termination
  3. Undecidability of halting problem
  1. 5.2-5.3
  2. 5.4-5.5
  3. 6-6.2
Mar 21
L23-L25
  1. Proof by contradiction, mathematical induction, well-foundnesses, a proof that mathematical induction works, how to extract induction schemes from admissible recursive functions
  2. Using induction to prove program correctness
  3. Data-function-induction trinity, Importance of termination
  1. 6.3
  2. 6.4-6.6
  3. 6.7
Mar 28
L26-L28
  1. Induction like a professional
  2. Reasoning about algorithms: sorting, correctness
  3. Generalization, lemma generation, dealing with induction failure
  1. None
  2. 6.8
  3. 6.9
Apr 4
L29-L31
  1. Intro to reasoning about accumulators
  2. Tail recursion: efficiency considerations, how to prove correctness
  3. Accumulator reasoning examples
  1. 6.9
  2. 6.9
  3. 8.1-8.2
Apr 11
L32-L34
  1. Abstract and algebraic data types
  2. Observational equivalence
  3. Reasoning about imperative programs: defining the semantics of a simple while language in ACL2s
  1. 8.3-8.4
  2. 9-9.2
  3. 9.3
Apr 18
L35-L37
  1. Reasoning about imperative programs using loop invariants; checking such proofs in ACL2s
  2. Reasoning about imperative programs and security
  3. Mathematical logic: syntax, semantics, proof theory, undecidability, incompleteness
Apr 25
L38
  1. A look back: Logic and the birth of computer science; A look forward: what's next
  1. None