∀  ·  a cognitive language for reasoning

Axioma

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.

The language, in six axioms

What you can say

Axioma reads like mathematics and runs like a program. Each construct below is real, executable syntax — try any of it in the playground.

I.

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}
II.

Logic is executable

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
III.

Rules reason for you

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)
IV.

Truth has more than two values

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
V.

“is” means three things

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
VI.

Reasoning runs anywhere

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]
Reasoning about reasoning

It knows what it knows

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.ax
[ 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.

A cognitive kernel

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)

Self-explaining proofs

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]

Knowledge has grades

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

Defaults & exceptions

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

Errors are values

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
λ

Code is data

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
A wider vocabulary

Three centuries of ideas, runnable

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.

Concepts as numbers

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

Definite descriptions

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

Textbook notation

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

The geometry of meaning

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"

One fact, two framings

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"}
Many-valued logic

Beyond true and false

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.

  • ⊤ true asserted, no conflict
  • ⊥ false denied, no conflict
  • ⊤⊥ both asserted and denied — a paraconsistent contradiction
  • ? neither no information either way

Contradiction propagates through rules instead of crashing — and every derived fact carries its epistemic grounding, from axiom down to hypothesis.

⊤⊥ ? more info ↑
A cognitive paradigm

Computing as the mind does

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

1679
Leibniz

characteristica universalis + calculus ratiocinator — a universal language of thought, and a calculus to reason in it.

1854
Boole

The Laws of Thought — the algebra of logic.

1879
Frege

Begriffsschrift — the first formal logic; quantifiers, sense & reference.

1903
Russell

Types, definite descriptions, and the three meanings of “is.”

1931
Gödel

Incompleteness — and numbering a formal system within itself.

1959
McCarthy

Programs with common sense.

today
Axioma

The cognitive language — 17 logics and 8 knowledge-representation systems, executable in your browser.

Interop

It speaks other languages

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.

axioma → python

Translate

Compile a comprehension to idiomatic Python source — deterministic and offline.

[axioma -> python | [n*n | n <- range(10)]]
⇒ "[n * n for n in range(10)]"
python → axioma

Embed & call

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
sql

Query tables

Run SQL against in-process tables — joins, GROUP BY, aggregates.

[sql | SELECT region, SUM(qty)
       FROM sales GROUP BY region]
english → axioma

Symbolize

Describe what you want in plain English; an LLM emits Axioma you can run.

[nl --> axioma | the empty list]
⇒ []

Try it. No install.

The interpreter runs in your browser — write a comprehension, prove a theorem, watch a rule reach its fixpoint.

▶ Open the Playground
play.axiomalang.org