Symbolic AI · Knuth Literate Study

McCarthy's Advice Taker, side by side

John McCarthy's five foundational common-sense AI papers (1959–1993) woven from a single Knuth-style literate Axioma program (mccarthy_advice_taker_study.lit.ax) — placing McCarthy's primary-source logic and plain-English AxiomaAgent prompts beside live, browser-runnable Axioma models.

▶ Edit any literate block and press Run — or ⌘/Ctrl+Enter. Runs the real Axioma WebAssembly interpreter in your browser. interpreter: loading…
KNUTH LITERATE PROGRAMMING · NATURAL-LANGUAGE BRIDGE

One executable text: paper, plain English, and formal verifier

Following Donald Knuth's Literate Programming [14], this study is woven directly from a single executable Axioma source file whose /**md … */ prose blocks sit alongside the verbatim .ax statements they explain. Running the file natively checks all 28 assertions; weaving it renders the prose and primary sources on the left beside live WebAssembly code cards on the right.

In day-to-day use, human operators do not need to memorize low-level .ax syntax: AxiomaAgent translates plain-English goals, standing orders, contextual views, and contradictory-advice updates into structured calls to axioma --mcp's advisor tool (realizing McCarthy's 1959 Advice Taker), retaining auditable /runs receipts while the symbolic engine below verifies preconditions, Reiter frame persistence, om epistemic gaps, contingent sense branches, and hitting-set contractions. For the companion architectural essay, see Axioma vs. McCarthy's Advice Taker and Axioma and the Calculemus Lineage.

01 · MCCARTHY (1959) · PROGRAMS WITH COMMON SENSE

Declarative premises, the Airport Problem, and active epistemic inquiry

In McCarthy's 1959 Advice Taker proposal, world facts (direct_at, walkable) are stated declaratively rather than baked into procedural control flow [1]. When a precondition is genuinely unknown (om), [solver/advice] either halts with .epistemic_gaps for active inquiry or — when a | sense action and fallback exist — synthesizes a verified contingent branching plan.

LITERATE AXIOMA · EXECUTABLE MODEL

Literate mapping
Spatial containment is encoded as direct_at with transitive closure at_loc. In [solver/advice | ...], unknown marks an om (Ω, Kleene unknown) fluent distinct from false and none.
Epistemic & decidability boundary
Without a sensor or fallback, the planner reports "has_keys(me, car)" in .epistemic_gaps for active inquiry; adding a knowledge-producing | sense action and transit fallback synthesizes a verified Scherl–Levesque contingent branching plan (.contingent == true).
advice_01_airport_inquiry.ax Open in Playground ↗

What running this establishes. Transitive spatial deduction succeeds ({"desk", "home", "county"}), inquiry surfaces ["has_keys(me, car)"], and contingent_inquiry verifies both if_true (drive) and if_false (take_train) branches.

02 · MCCARTHY & HAYES (1969); REITER (1991)

Situation Calculus, ability (can_do), and automatic frame persistence

Once key possession is confirmed, [solver/advice | ...] synthesizes the complete desk-to-airport plan under standing-order preferences (prefer drive) [2], [3]. Reiter's successor-state compilation preserves every unaffected fluent (walkable(home)) without hand-written frame axioms, and can_do checks action executability in the initial situation.

LITERATE AXIOMA · EXECUTABLE MODEL

Literate mapping
Lifted action schemas (walk, unlock_and_board, drive, take_train) compile directly into Reiter successor-state transitions (State \ Del) ∪ Add, eliminating M × N manual frame axioms.
Epistemic & decidability boundary
Bounded-horizon breadth/cost search with standing-order preferences (prefer drive) finds the optimal 3-step plan and verifies both initial executability (can_do) and frame inertia.
advice_02_sitcalc_frame.ax Open in Playground ↗

What running this establishes. The 3-step plan (walk → unlock_and_board → drive) achieves at(me, airport), while untouched fluents such as walkable(home) survive across all three transitions automatically.

03 · MCCARTHY (1980) · CIRCUMSCRIPTION

Non-monotonic defaults (<~~), abnormality guards (unless), and online advice

Common-sense rules have open-ended exceptions (the Qualification Problem) [4]. Axioma pairs defeasible <~~ rules (grounded at "conjecture") with | unless abnormality clauses in [solver/advice] so newly reported exceptions defeat defaults cleanly and reroute plans online [4], [5].

LITERATE AXIOMA · EXECUTABLE MODEL

Literate mapping
Defeasible <~~ rules cap their epistemic grounding at "conjecture" (never inflating to "theorem"), while | unless road_closed(From, To) guards action schemas against late-arriving qualifications.
Epistemic & decidability boundary
Adding road_closed("home", "airport") defeats the default conjecture non-monotonically without classical ex falso explosion and reroutes the planner to take_train in zero code edits.
advice_03_circumscription.ax Open in Playground ↗

What running this establishes. passable_route("home", "airport") holds initially with grounding "conjecture", retracts cleanly to false once road_closed is asserted, and [solver/advice] switches to the rail fallback.

04 · MCCARTHY (1990); FREGE (1892); RAMSEY (1930)

Hyperintensional attitude opacity and decidable ∃∀ (EPR) fragments

McCarthy (1979, 1990) emphasized Fregean referential opacity in epistemic attitudes [6], [7], alongside Church–Turing honesty about which first-order fragments admit exact decision procedures [8]. Axioma's held [logic | φ] ASTs keep believes/knows hyperintensional, while [logic/epr | ...] decides Bernays–Schönfinkel–Ramsey (∃∀) formulas and explicitly refuses ∀∃ Skolem alternations.

LITERATE AXIOMA · EXECUTABLE MODEL

Literate mapping
[logic | route_open(hwy_101)] quotes the formula's held AST (Sinn) rather than eagerly reducing it to extensional "US-101" (Bedeutung), while [logic/epr | ...] grounds function-free ∃∀ sentences over their finite Herbrand universe into DPLL SAT.
Epistemic & decidability boundary
Out-of-fragment ∀x. ∃y. Skolem alternations generate an infinite Herbrand universe and refuse cleanly instead of looping or guessing.
advice_04_attitudes_epr.ax Open in Playground ↗

What running this establishes. Coreference hwy_101 === bayshore_fwy holds while attitude_holds preserves referential opacity; [logic/epr | ...] certifies "decidable" satisfiability and refuses ∀x. ∃y..

05 · MCCARTHY (1993); GUHA (1991)

First-class contexts (ist(c, p)) and conditional Guha lifting rules

No common-sense axiom holds unconditionally across every time, source, and scenario [9], [10]. ContextGraph nodes isolate microtheories, inherit along parent edges, transfer filtered assertions via context_lift_rule, and evaluate full strict/defeasible rules locally through ist and [logic/ist | cg, c: φ].

LITERATE AXIOMA · EXECUTABLE MODEL

Literate mapping
context_graph builds a DAG of microtheories (c_base, c_morning, c_dot_feed); context_lift_rule transfers facts meeting a confidence threshold; and [logic/ist | cg, c: φ] projects rules and facts inside c without mutating sibling or parent contexts.
Epistemic & decidability boundary
Contextualized closures defeat open_corridor inside "c_morning" while leaving "c_base" untouched.
advice_05_contexts_ist.ax Open in Playground ↗

What running this establishes. Before lifting, ist(cg, "c_morning", ...) derives true; after lifting the 0.92-confidence DOT closure into "c_morning", "c_morning" evaluates to false while "c_base" remains true.

06 · AGM (1985); REITER (1987); PEARL (2009)

Scaled Reiter HS-Tree belief contraction and Pearlian do-intervention

To complete a general-purpose Advice Taker loop, an agent must revise multi-path beliefs when reality refutes a conclusion [11], [12] and distinguish passive observation from active intervention when evaluating actions [13].

LITERATE AXIOMA · EXECUTABLE MODEL

Literate mapping
kb_contract_plan builds a breadth-first Reiter HS-Tree over all derivation paths and kb_apply_contraction emits an auditable axioma.contraction.receipt/1 receipt; import "advice.causal" implements Pearl's structural graph surgery scm_do.
Epistemic & decidability boundary
Both sensors (sensor_a, sensor_b) independently entail bridge_safe("r1"), so any valid contraction must hit both supports (size == 2); in the causal fork, turning the sprinkler off (do) does not force rain (1/2), whereas passively observing the sprinkler off implies it rained (1).
advice_06_contraction_causal.ax Open in Playground ↗

What running this establishes. Contraction removes both minimal supports with a verified receipt ({}), and scm_observe_prob (1) separates cleanly from scm_intervene_prob (1/2) and twin-network scm_counterfactual (false).

PRIMARY LITERATURE

References

  1. McCarthy, J. (1959). “Programs with common sense.” In Proceedings of the Teddington Conference on the Mechanization of Thought Processes, Her Majesty's Stationery Office, London, pp. 75–91.
  2. McCarthy, J., & Hayes, P. J. (1969). “Some philosophical problems from the standpoint of artificial intelligence.” In B. Meltzer & D. Michie (Eds.), Machine Intelligence 4, Edinburgh University Press, pp. 463–502.
  3. Reiter, R. (1991). “The frame problem in the situation calculus: A simple solution (sometimes) and a completeness result for goal regression.” In V. Lifschitz (Ed.), Artificial Intelligence and Mathematical Theory of Computation: Papers in Honor of John McCarthy, Academic Press, pp. 359–380.
  4. McCarthy, J. (1980). “Circumscription — A form of non-monotonic reasoning.” Artificial Intelligence, 13(1–2), pp. 27–39.
  5. Belnap, N. D. (1977). “A useful four-valued logic.” In J. M. Dunn & G. Epstein (Eds.), Modern Uses of Multiple-Valued Logic, D. Reidel, pp. 8–37.
  6. McCarthy, J. (1990). “Artificial intelligence, logic and formalizing common sense.” In R. H. Thomason (Ed.), Philosophical Logic and Artificial Intelligence, Kluwer Academic Publishers, pp. 161–190. (See also McCarthy 1979, “First order theories of individual concepts and propositions,” Machine Intelligence 9, pp. 129–147.)
  7. Frege, G. (1892). “Über Sinn und Bedeutung.” Zeitschrift für Philosophie und philosophische Kritik, 100, pp. 25–50.
  8. Ramsey, F. P. (1930). “On a problem of formal logic.” Proceedings of the London Mathematical Society, s2-30(1), pp. 264–286.
  9. McCarthy, J. (1993). “Notes on formalizing context.” In Proceedings of the Thirteenth International Joint Conference on Artificial Intelligence (IJCAI-93), Chambéry, pp. 555–560.
  10. Guha, R. V. (1991). Contexts: A Formalization and Some Applications. Ph.D. Dissertation, Stanford University (supervised by John McCarthy; Stanford CS Technical Report STAN-CS-91-1399).
  11. Alchourrón, C. E., Gärdenfors, P., & Makinson, D. (1985). “On the logic of theory change: Partial meet contraction and revision functions.” Journal of Symbolic Logic, 50(2), pp. 510–530.
  12. Reiter, R. (1987). “A theory of diagnosis from first principles.” Artificial Intelligence, 32(1), pp. 57–95.
  13. Pearl, J. (2009). Causality: Models, Reasoning, and Inference (2nd ed.). Cambridge University Press.
  14. Knuth, D. E. (1984). “Literate programming.” The Computer Journal, 27(2), pp. 97–111.
  15. McCarthy, J. (2007). “From here to human-level AI.” Artificial Intelligence, 171(18), pp. 1174–1182.

Tell, deduce, plan, and revise.

Explore the full architectural specification or open any block in the live Playground.