Sets are first-class
Set-builder notation, comprehensions, and the full algebra of sets — straight from the page into the runtime.
nums: [1, 2, 3, 4, 5, 6] { n | n <- nums, n mod 2 == 0 } ⇒ {2, 4, 6}
State what is true. Let the language reason.
A cognitive programming language for knowledge representation and reasoning — sets, logic, and many-valued truth, with a natural-language syntax that runs entirely in your browser.
Most languages compute with numbers. Axioma computes with truth.
Axioma reads like mathematics and runs like a program. Each construct below is real, executable syntax — try any of it in the playground.
Set-builder notation, comprehensions, and the full algebra of sets — straight from the page into the runtime.
nums: [1, 2, 3, 4, 5, 6] { n | n <- nums, n mod 2 == 0 } ⇒ {2, 4, 6}
Universal and existential quantifiers range over sets and evaluate to a truth value — ∀ and ∃, as code.
forall x in {2, 4, 6} | x mod 2 == 0 ⇒ true exists x in {1, 2, 3} | x > 2 ⇒ true
Declare facts and Horn-clause rules; recursion computes the full transitive closure, Datalog-style. The relation and assert keywords are even optional in the obvious cases.
ancestor(X, Z) <== parent(X, Z) ancestor(X, Z) <== parent(X, Y) and ancestor(Y, Z)
Boolean, Kleene K3, Łukasiewicz L3, Belnap B4, and Gödel G3 — first-class logics for the unknown and the contradictory.
belnap("both") ⇒ ⊤⊥ om or true ⇒ true # unknown ∨ true
Russell's copula, made precise: identity, predication, and existence — with concepts, instances, and classification.
concept Stock { price: 0 } aapl: a Stock { price: 150 } aapl is Stock ⇒ true
The whole interpreter compiles to WebAssembly — no install, no server. It also speaks Forth-style stacks and prose-like definitions.
# a function, REBOL-style binding sq: func(n) [n * n] map(sq, [1, 2, 3]) ⇒ [1, 4, 9]
Beyond running your program, Axioma reasons about its own knowledge — where a fact came from, how sure it is, and how to explain it. The [ model | … ] lens even charts your code on the knowledge lifecycle as you write it.
[ model | relation mortal(x) axiom mortal("socrates") human(X) <== mortal(X) { X | X <- human(X) } ] ┌─ model · epistemic lifecycle ───────────────────────────────────── │ ✓ represented │ ✓ grounded │ ✓ inferred │ ✗ proved → why <conclusion> · proof(rel, args…) chains back to axioms · prove / derive / refute (automated reasoning) │ ✗ truth-valued → set_truth(rel, args…, "both") · truth(rel, args…) (T / F / Both / Neither) │ ✗ applied → check Concept / examine Concept (→ B4) · examples / counterexamples · reconcile against KB / Cascade · understand X runs the whole arc └─ 3/6 phases present · advisory only — your code runs exactly as written. ⇒ {"socrates"}
Wrap any block in [ model | … ] and Axioma runs it untouched — returning {"socrates"} — then charts how far that knowledge has travelled: represented → grounded → inferred → proved → truth-valued → applied. Here three of six phases are present, and every unreached phase (✗) names the exact next step. It's Calculemus turned on the program itself: computing a result is one thing — knowing what you've actually established is another.
understand · examine · abduce — Peirce's inference-to-the-best-explanation as a built-in (the "fifth paradigm").
flies(X) <~~ bird(X) abduce("flies", "tweety") ⇒ ("bird(tweety)", defeasible)
Ask why a conclusion holds and get a prose proof traced back to its founding axioms.
why mortal("socrates") # ⇒ a theorem, from # human("socrates") [axiom]
Axioma is named for the axiom — you don't just assert facts, you grade them (axiom > postulate > theorem > conjecture > hypothesis), and the grade propagates through every proof.
axiom mortal("socrates") # foundational grounding("mortal", "socrates") ⇒ axiom
Defeasible rules (<~~) hold by default and retract for exceptions — non-monotonic logic, provenance kept.
flies(X) <~~ bird(X) cancel("flies", "pingu") # penguins excepted; tweety still flies
No stack unwinding — a fault becomes an inspectable value that auto-classifies into a concept you can match on.
e: try(10 / 0) e is DivByZero ⇒ true parse_int("x") otherwise 0 ⇒ 0
Homoiconic to the core: quote ASTs, write hygienic macros, even build a symbolic differentiator in user code.
macro double(x) quasiquote(unquote(x) * 2) double(21) ⇒ 42
Set theory and intensional logic, the geometry of meaning, prime-number taxonomy, the opacity of belief — each is a chip in the playground, one click from running.
Leibniz's 1666 dream: encode primitive concepts as primes, so that subsumption becomes plain divisibility.
human: 2*3*7*13*19 # a prime fingerprint is_subtype_of(human, 2*3*7) ⇒ true
Russell's the X where … — name a class by a property, then test membership or iterate its extent.
big: the Stock where price > 1000 luxury is big ⇒ true
Write the symbols mathematicians use — quantifiers ∀ ∃, membership ∈, set difference \, proper subset ⊊.
∀ x in {2,4,6} | x mod 2 == 0 ⇒ true {1,2,3,4} \ {2,4} ⇒ {1, 3} {1,2} ⊊ {1,2,3} ⇒ true
Gärdenfors conceptual spaces — concepts as convex regions, categorization by the nearest prototype.
add_prototype(fruit, "apple", [7,5]) nearest_prototype(fruit, [6,5]) ⇒ "apple"
Intensionality made executable — the same fact under divergent value-laden descriptions (Epictetus, Ench. 11).
departed("estate") qua "lost" departed("estate") qua "given_back" framings_of("departed", "estate") ⇒ {"lost", "given_back"}
Real knowledge is incomplete and sometimes contradictory. Axioma builds that in: Belnap's four-valued bilattice treats missing and conflicting information as first-class truth values.
Contradiction propagates through rules instead of crashing — and every derived fact carries its epistemic grounding, from axiom down to hypothesis.
Axioma is a cognitive programming language — built for knowledge representation, symbolic reasoning, and explainable AI. After procedural, object-oriented, functional, and logic programming comes a fifth paradigm, whose defining act is to understand: to model a thing into a model of everything. Seventeen logics and eight knowledge-representation systems, unified under a single old dream.
“Calculemus. Let us calculate.”— G. W. Leibniz, on settling every dispute by computation
characteristica universalis + calculus ratiocinator — a universal language of thought, and a calculus to reason in it.
The Laws of Thought — the algebra of logic.
Begriffsschrift — the first formal logic; quantifiers, sense & reference.
Types, definite descriptions, and the three meanings of “is.”
Incompleteness — and numbering a formal system within itself.
Programs with common sense.
The cognitive language — 17 logics and 8 knowledge-representation systems, executable in your browser.
One bracket form, many backends: translate Axioma to Python, run Python or SQL inline, or symbolize plain English. These reach out to other runtimes, so they need the native axioma binary — shown here rather than in the browser playground.
Compile a comprehension to idiomatic Python source — deterministic and offline.
[axioma -> python | [n*n | n <- range(10)]] ⇒ "[n * n for n in range(10)]"
Run Python inline, or pull a Python function into Axioma scope and call it.
[python --> axioma | def double(x): return x*2] double(5) ⇒ 10
Run SQL against in-process tables — joins, GROUP BY, aggregates.
[sql | SELECT region, SUM(qty) FROM sales GROUP BY region]
Describe what you want in plain English; an LLM emits Axioma you can run.
[nl --> axioma | the empty list] ⇒ []
The interpreter runs in your browser — write a comprehension, prove a theorem, watch a rule reach its fixpoint.
▶ Open the Playground