The HW1 programming assignment turns Lec2's entailment into a Pacman take on the Wumpus agent. Q1–Q2 warm up with Expr and pycosat. Q3–Q5 write the PKE percept rule, build the KB, and use two SAT calls to decide SAFE, NOT_SAFE or UNSURE. Q6–Q7 use the provided A* helpers to build an exploration agent and a three-tier hybrid agent. The starter code and local autograder are public; the Gradescope online questions are CMU-only. No solutions here.
Lec2 turns 'is this square safe?' in Minesweeper and Wumpus World into an entailment question: KB ⊨ α exactly when KB ∧ ¬α is unsatisfiable. Three ways to answer it: TT-ENTAILS, which enumerates every model; DPLL, which adds early termination, pure symbols and unit clauses to backtracking; and forward chaining, which accepts only definite clauses and runs in linear time. Resolution sits in the appendix, marked out of scope.
Week 1 is about getting a program to derive new facts from known ones: propositional symbols and five connectives turn knowledge into sentences; model checking enumerates all 2^n truth assignments to decide whether the knowledge base entails a query; inference rules and resolution work on the sentences directly, converting to CNF and deriving the empty clause by contradiction; first-order logic cuts the number of symbols with constants, predicates and quantifiers. With time links for every section, plus the approach, common mistakes and self-checks for the Knights and Minesweeper projects (reference implementations folded away).
CS221 is Stanford's course on AI principles and techniques. It lays AI out in four layers — reflex, states, variables and logic — with deep learning as only the lowest one. The executable Python lectures and all eight assignments, with code skeletons and a local grader, are public; lecture recordings, hidden test cases and assignment solutions are not.