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.
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_atwith transitive closureat_loc. In[solver/advice | ...],unknownmarks anom(Ω, Kleene unknown) fluent distinct fromfalseandnone. - Epistemic & decidability boundary
- Without a sensor or fallback, the planner reports
"has_keys(me, car)"in.epistemic_gapsfor active inquiry; adding a knowledge-producing| senseaction and transit fallback synthesizes a verified Scherl–Levesque contingent branching plan (.contingent == true).
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.
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.
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.
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 totake_trainin zero code edits.
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.
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.
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..
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_graphbuilds a DAG of microtheories (c_base,c_morning,c_dot_feed);context_lift_ruletransfers facts meeting a confidence threshold; and[logic/ist | cg, c: φ]projects rules and facts insidecwithout mutating sibling or parent contexts.- Epistemic & decidability boundary
- Contextualized closures defeat
open_corridorinside"c_morning"while leaving"c_base"untouched.
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.
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_planbuilds a breadth-first Reiter HS-Tree over all derivation paths andkb_apply_contractionemits an auditableaxioma.contraction.receipt/1receipt;import "advice.causal"implements Pearl's structural graph surgeryscm_do.- Epistemic & decidability boundary
- Both sensors (
sensor_a,sensor_b) independently entailbridge_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).
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).
References
- 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.
- 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.
- 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.
- McCarthy, J. (1980). “Circumscription — A form of non-monotonic reasoning.” Artificial Intelligence, 13(1–2), pp. 27–39.
- 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.
- 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.)
- Frege, G. (1892). “Über Sinn und Bedeutung.” Zeitschrift für Philosophie und philosophische Kritik, 100, pp. 25–50.
- Ramsey, F. P. (1930). “On a problem of formal logic.” Proceedings of the London Mathematical Society, s2-30(1), pp. 264–286.
- 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.
- 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).
- 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.
- Reiter, R. (1987). “A theory of diagnosis from first principles.” Artificial Intelligence, 32(1), pp. 57–95.
- Pearl, J. (2009). Causality: Models, Reasoning, and Inference (2nd ed.). Cambridge University Press.
- Knuth, D. E. (1984). “Literate programming.” The Computer Journal, 27(2), pp. 97–111.
- 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.