Logic & Reasoning
Truth tables to solvers and provers: how a machine decides what follows from what, and how Prolog turns that into a program.
Math Foundations · Algorithms & Data Structures · Software Engineering
Before you start
Some lessons here build on lessons from other arcs: Graph Traversal: BFS & DFS.
- 1
Propositional Logic: Truth Tablesin progress
Math · Logic · ~20 minVariables that are true or false, joined by not, and, or, if-then, and iff. A truth table lists every world and evaluates the formula in each: what is always true, never true, or sometimes true.
- 2
Normal Forms: CNF and DNFin progress
Math · Logic · ~20 minEvery formula can be rewritten as an and of or-clauses, or an or of and-terms. Read the form off the truth table, or rewrite with De Morgan and distribution; CNF is the shape a SAT solver takes.
- 3
SAT Solving: DPLLin progress
Math · Logic · ~25 minIs there an assignment that makes every clause true? Propagate what the clauses force, guess only when nothing is forced, and back out of a dead branch: the search behind every modern solver.
- 4
Constraint Satisfaction: Backtracking and Arc Consistencyin progress
Algorithms · Searching · ~25 minVariables, domains, and constraints between them: colour a map, place queens. Assign one variable at a time, prune what each choice rules out, and undo when a domain runs dry.
- 5
Forward Chaining: Rule Enginesin progress
Math · Logic · ~20 minStart from the facts and fire each rule whose premises are known, until the goal appears or nothing new follows. For Horn clauses that is linear, sound, and complete: the heart of a rule engine.
- 6
Resolution: Proof by Refutationin progress
Math · Logic · ~25 minAdd the goal's negation to the clauses and resolve clashing pairs until the empty clause appears. One rule, complete for propositional logic, and the engine beneath every theorem prover and Prolog.
- 7
Predicate Logic: Quantifiers and Modelsin progress
Math · Logic · ~25 minRelations over objects, variables bound by for-all and there-exists, and truth decided by checking a formula against a model. Why swapping two quantifiers changes the answer, one lookup at a time.
- 8
Unification: Matching Terms with Variablesin progress
Math · Logic · ~20 minFind the bindings that make two terms with variables identical, and the most general ones. Robinson's algorithm, pair by pair, with the occurs check that keeps the answer finite.
- 9
Logic Programming: How Prolog Answers a Queryin progress
Software · Paradigms · ~25 minA program is facts and rules; a query is a goal to prove. Resolution picks the first goal, unification matches a clause, backtracking tries the rest: SLD resolution, Prolog's engine, step by step.