Skip to main content
  (Week 1)

Lecture 1: SAT: Foundations

Week 1 | Mar 30 – Apr 5

Engineers often need to know: does this property hold for every possible input, or does a counterexample exist? Does this function produce the same result as the reference implementation on all 32-bit inputs? Is this protocol safe against every possible interleaving? SAT and SMT solvers answer questions of exactly this form. You describe the property as a logical formula. The solver either finds an input that violates it or proves no such input exists. Tonight you see what solvers can do, learn the logic underneath them, and write your first Z3 programs.

What We Cover

Practice introduces solvers through two live demos. First, a warm-up: an NP-complete puzzle from XKCD, solved in fifteen lines of Python. Then the main event: a real verification problem involving a bitwise arithmetic trick, where we watch the solver find a counterexample, diagnose the bug, and synthesize a correct fix.

Theory builds the foundation underneath Practice. We introduce propositional logic as a language for encoding problems, walk through how solvers turn arbitrary formulas into a canonical form (conjunctive normal form), and trace through the DPLL algorithm that SAT solvers use to search for satisfying assignments.

Studio is hands-on. Get Python and Z3 installed, run your first Z3 program, and work through two short exercises. We also cover the course logistics you need to know before Friday: Reading Reflection 1, Coding Assignment 1, and how office hours and Ed work.

Practice: Solver demos: verify, debug, synthesize

Two live demos before any theory: an NP-complete puzzle and a real verification bug.

Theory: Propositional logic, normal forms, and DPLL

The mechanics underneath the solver: propositional logic, normal forms, and the DPLL algorithm that searches for satisfying assignments.

Studio: Setup clinic, first exercises, and logistics

Your first hands-on session: get your tools working, write your first Z3 programs, and learn how the course operates.