CS 245: Logic and Computation (Winter 2024)



General Information

Course Description

CS 245 plays a key role in the development of mathematical skills required in the Computer Science program, and thus complements MATH 135 (Algebra), MATH 239 (Graph Theory and Enumeration), and STAT 230 (Probability). The course covers a variety of topics related to "logic and computation" that are required as background for other courses in Computer Science. It differs both in tone and content from a "logic" course one would typically find in a mathematics program. The course aims to:

Objectives

At the end of the course, students should be able to:

Overview


Course Meet Times

Students registered in the course may log into Quest to view their lecture and tutorial meet times.

If you wish to register or to change sections, either use Quest or contact a Computer Science academic advisor. The instructors and course coordinator do not support course registrations.


Schedule

We will adjust this schedule as required.

Each tutorial will provide a forum for you to practice with the ideas and techniques presented in the preceding lectures. The following assignment allows further practice and feedback. Each assignment will focus on the recent topics, but includes everything that came before, as well — everything is cumulative.

The Midterm Exam will cover the material up to the end of Week #6.

There will be a Final Exam during the university's final exam period, which will cover the entire course.

Week Lectures Tutorials Assessments References
Tuesday Thursday Friday
#1:
01/08–01/12
What is logic? Logic propositions and connectives. Truth tables; translations between English and propositional logic; propositional logic syntax; review of induction. Translations; propositional syntax; induction Marked Quiz 1 released by 01/10
  • Logic01
  • Logic02 (slides 1–23)
  • [Lu] 1.2–2.3
#2:
01/15–01/19
Structural induction; propositional semantics; satisfiability. Proving arguments valid in propositional logic. Structural induction; propositional logic semantics; argument validity.
  • Marked Quiz 1 due 01/17, 11:59 PM
  • Crowdmark Assignment 1 released by 01/17
  • Logic02 (slides 24–end)
  • Logic03
  • [Lu] 2.4–2.5
#3:
01/22–01/26
Propositional calculus laws; Disjunctive and Conjunctive Normal Forms. Adequate set of connectives; Boolean algebra; logic gates. Disjunctive and Conjunctive Normal Forms; adequate sets; boolean algebra; logic gates.
  • Crowdmark Assignment 1 due 01/24, 11:59 PM
  • Marked Quiz 2 released by 01/24
  • Logic04
  • Logic05 (slides 1–20)
  • [Lu] 2.7, 2.8
#4:
01/29–02/02
Circuit design and minimization; code analysis and simplification. Formal deduction for propositional logic. Circuit design, code analysis and simplification; formal deduction for propositional logic.
  • Marked Quiz 2 due 01/31, 11:59 PM
  • Crowdmark Assignment 2 released by 01/31
  • Logic05 (slides 21–end)
  • Logic06 (slides 1–43)
  • [Lu] 2.6
#5:
02/05–02/09
Soundness and completeness of formal deduction for propositional logic (proof of completeness optional). Automated theorem-proving: resolution, Davis-Putnam Procedure (proof of soundess and completeness of DPP, starting at slide 35 of Logic07: optional). Soundness and completeness of formal deduction; resolution for propositional logic; DPP.
  • Crowdmark Assignment 2 due 02/07, 11:59 PM
  • Marked Quiz 3 released by 02/07
  • Logic06 (slides 44–end)
  • Logic07
  • [Lu] 5.1–5.3
#6:
02/12–02/16
First-order logic: domain, terms, relations, variables, quantifiers.
Translations from English to first-order logic.
First–order logic syntax and semantics. Introduction to first-order logic; syntax and semantics for first-order logic.
  • Marked Quiz 3 due 02/14, 11:59 PM
  • Logic10
  • Logic11
  • Logic12
  • [Lu] 3.1–3.3
02/19–02/23 Reading Week.
No classes, office hours or tutorials.
#7:
02/26–03/01
Logical consequence in first–order logic. Self-study (classes cancelled) No tutorial on 03/01; notes provided for logical consequence in first–order logic.
  • Midterm Exam:
    02/29, 16:30–18:20
  • Crowdmark Assignment 3 released by 02/28
  • Logic13
  • [Lu] 3.4
#8:
03/04–03/08
Formal deduction in first–order logic. Formal deduction in first–order logic: proof examples. Formal dueduction for first-order logic.
  • Crowdmark Assignment 3 due 03/06, 11:59 PM
  • Marked Quiz 4 released by 03/06
  • Logic14
  • [Lu] 3.5
#9:
03/11–03/15
Resolution for first–order logic: Prenex Normal Form, Existential-free PNF, unification and resolution, automated theorem provers/verifiers. Computation and logic: Turing machines, decidability, undecidability, the halting problem. Resolution for first–order logic; decidability; undecidability.
  • Marked Quiz 4 due 03/13, 11:59 PM
  • Crowdmark Assignment 4 released by 03/13
  • Logic15
  • Logic16a
  • [Lu] 3.6
#10:
03/18–03/22
Turing machine examples, the undecidable tiling problem (optional), decidability and complexity of some logic problems. Peano arithmetic. Turing machines, Peano arithmetic.
  • Crowdmark Assignment 4 due 03/20, 11:59 PM
  • Marked Quiz 5 released by 03/20
  • Logic16b
  • Logic17 (slides 1–24)
#11:
03/25–03/29
Proving theorems in Peano arithmetic; Godel's incompleteness theorem. Program verification: Hoare triples, partial and total correctness, rules for assignment, implication, composition. No tutorial on 03/29; notes provided for Peano arithmetic, Godel's incompleteness theorem, program verification: assignment, implication, composition.
  • Marked Quiz 5 due 03/27, 11:59 PM
  • Crowdmark Assignment 5 released by 03/29
  • Logic17 (slides 25–end)
  • Logic18 (slides 1–51)
#12:
04/01–04/05
Program verification: conditional statements. Program Verification: partial-while; Program termination; Undecidability of Partial and Total Correctness; Course Review. Program verification: conditionals, partial-while. No assessments due the week of 04/01–04/04. Logic18 (slides 52–end)
#13:
04/08–04/08
Crowdmark Assignment 5 due 04/08, 11:59 PM

Office Hours

For questions concerning course material, please join us during our scheduled office hours. Office hours will start in the second week of classes. Times listed below are in Eastern Time. Note whether specific office hours are on campus or online; and refer to LEARN on how to connect to online office hours. If the below times do not suit you, contact an instructor to schedule an meeting. For administrative questions, contact the coordinator, Dalibor Dvorski, by email: ddvorski@uwaterloo.ca.


Grading Scheme

Notes:


Textbook

The recommended textbook for this course is Mathematical Logic for Computer Science, second edition, by Lu Zhongwan. Students may access an electronic version of the textbook through the library. Please note that this book does not cover all the material presented in the course, and is meant mainly for definitions, notation, and the sections on formal deduction. For the rest of the material, students should take notes from the course and work from these. Lecture slides for the course are available electronically on LEARN.


Late Submission of Crowdmark Assignments


Practice Quizzes


Marked Quizzes


Piazza Guidelines