Lectures
This page is the lecture archive and materials home for CARS. Use
Schedule for the week-by-week view of what is happening
when; use this page when you want the lecture-by-lecture record.
CARS meets every Tuesday evening (18:30-21:20) in CSE2 G10. Each
lecture has three phases: Practice (hands-on solver-aided
programming), Theory (algorithms and foundations), and Studio
(guided exercises or reading discussion). As the quarter progresses,
each lecture entry below links to its overview page and posted
materials.
The lecture material in CARS draws extensively from Emina Torlak's
CSE 507 course
design, lecture notes, and demos. Her work is the foundation this
course builds on.
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.
Week 2 | Apr 6 – Apr 12
Last week you saw solvers find bugs and prove correctness. This week: how do you encode a real engineering problem? We build a package manager in three versions, each asking a different question of the solver. Then we look under the hood at how modern SAT solvers actually work, and close with the first reading discussion.
Week 3 | Apr 13 – Apr 19
Last week you saw solvers encode and optimize real engineering
problems. But everything fit into boolean variables and CNF. This
week you find out that Z3 has been doing more than that all along.
Theory solvers extend SAT with richer primitives: integers,
bitvectors, arrays, equality. Your reductions can speak the
language of your actual problem instead of decomposing everything
into booleans. We open with two concrete payoffs (shorter
encodings, better abstraction), then look inside one theory solver
to see how it decides equality without knowing what the functions
actually do.
Week 4 | Apr 20 – Apr 26
Last week you opened one theory solver and traced congruence
closure by hand on an equation over uninterpreted functions.
Z3 has more theory solvers. This week we meet four: linear real
arithmetic, linear integer arithmetic, bitvectors, and arrays.
Each is the right reach for some class of engineering problem
and the wrong reach for others, and the wrong reach silently
gives you a correct answer to a different question. Practice
picks one engineering problem per theory and works it out
concretely. Theory opens each solver and shows how it decides
its fragment, ending with arrays and a callback to last week.
Studio is the Reading Reflection 2 small-group discussion.
Week 5 | Apr 27 – May 3
Real verification problems span multiple theories at once: a heap
routine touches arrays, integer indices, and uninterpreted helpers
all in one formula. Today we make cooperation precise. First-order
logic gives the language for what theory solvers know;
Nelson-Oppen gives the protocol they use to talk. Practice
motivates with three escalating demos, Theory makes the protocol
formal and works through both the convex and non-convex cases,
and Studio is hands-on practice on the FOL evaluator and small
mixed-theory queries.
Week 6 | May 4 – May 10
Tonight ForAll moves to the foreground. When you don't have the source for a function, the spec is what you reason from in its place. A spec that holds for every input is a ForAll axiom. Two questions tonight. How does Z3 reason about these axioms? How does DPLL(T) handle the boolean structure (the ANDs and ORs) wrapping the theory atoms inside? Practice runs ForAll on a queue library you don't have source for. Theory builds DPLL(T). Studio is the third reading discussion, on the limits of formal methods. Next week we move up to Rosette.
Lecture 7: Program Verification
Week 7 | May 11 – May 17
Content will be posted before class.
Lecture 8: Verification in Practice
Week 8 | May 18 – May 24
Content will be posted before class.
Lecture 9: Mini-Project: Milestone
Week 9 | May 25 – May 31
Content will be posted before class.
Lecture 10: Mini-Project: Final
Week 10 | Jun 1 – Jun 7
Content will be posted before class.