Course / Lectures / Lecture 12 / Lab Lab 12

Formalize, then check.

Three puzzles, three candidate formalizations each, and a real solver. Pick a candidate and the lab enumerates every assignment, returns the models, and checks what follows. When the formalization is wrong, the proof is still valid.

~12 min play 3 puzzles · 9 candidates ≤ 8 assignments each No install · runs in the browser

The formalize-and-check lab

Preset 01 · one key, three signs

The three boxes

    Atoms
      Candidate formalizations

      Preset loaded. Choose a candidate and press Check.

      Puzzle preset

      Which box contains the key?

      Trace

      HOW TO READ THE TRACE

      Three steps, one verdict.

      01 · Parse

      The formula, not the text

      The parser reads the prefix DSL and prints the tree. A well-formed formula is the only thing the solver ever sees.

      02 · Enumerate

      Every assignment

      With n atoms there are 2n assignments. The highlighted rows are the models; the formula is satisfiable when at least one exists.

      03 · Entail

      All models, or a countermodel

      A query is entailed only if it holds in every model. One countermodel is enough to refute it; zero models make every query vacuously true.

      What this shows — and what it does not

      It shows a genuine brute-force model enumeration over propositional formulas, an entailment check against the full model set, and the gap between a valid proof and the intended reading. Preset 1 is the deliberate trap: all three candidates parse, all three solve, and only one matches the text. The lab does not show first-order logic, SMT theories, or a production solver. The puzzles are small on purpose: every assignment is visible.

      The sentence to take away

      The solver is sound with respect to the formula. When a wrong candidate produces a different answer, the solver is still sound — the formalization is what failed. That is why the lecture calls fidelity the unverified part.

      ← Read the hook again · Back to Lecture 12 · Slides →