Theory of computation and semantics
What can a machine compute, and what does a program mean? Start with finite automata you can build and test, turn regular expressions into machines, see why no program can decide halting, then move on to domain theory.
- Explainer
Finite-state machines
Build a DFA in a table, see it drawn, and run strings through it one symbol at a time.
Try it: DFA builder and step-by-step string tester - Explainer
Domain theory
Why recursion needs least fixed points, and how CPOs, Scott continuity and powerdomains supply them.
Try it: Fixed-point iteration stepper (Kleene chain for factorial) - Explainer
Regular expressions to automata
Regex to NFA to DFA to minimal DFA, worked through on one example with every set shown.
Try it: Regex-to-NFA builder and subset-construction stepper - Explainer
The halting problem
Why no program can tell whether every program halts, with the paradox program played out.
Try it: Diagonal table and a “build a halting decider” challenge
Two questions
The theory of computation asks what machines can do at all, given limited resources. Finite-state machines are the simplest interesting answer: machines with a fixed, finite memory. They are enough for searching text and recognising tokens, and the proof that they cannot count without bound is the first real impossibility result most students meet. Regular expressions and automata shows that regular expressions describe exactly the same languages, by turning one into the other. At the far end, the halting problem shows that some questions about programs cannot be answered by any machine at all.
The semantics of programming languages asks what a program means, as a mathematical object, so that we can prove programs equivalent or correct. Domain theory is the mathematics that makes this work for recursive programs, by ordering partial results by information and taking least fixed points.