System architecture

Architecture overview

judgment is a proof-producing core for contextual symbolic reasoning. Its unit of knowledge is a checked judgment

𝒯; Γ ⊢ P

a proposition P that holds in the theory 𝒯 under the context Γ of assumptions. Only the kernel creates checked judgments. A reusable theorem is a guarded judgment 𝒯 ⊢ G ⇒ P: any context that establishes the guard G can apply it.

The source of truth

The system architecture describes the wider CAS. Current kernel contracts live in the implementation reference, and the theory is normative for the mathematics. The integration contracts name the normative pages of the other components. These sources must agree; update the relevant contracts together when behavior changes.

Note sections Topic On this site
17–20 the kernel: syntax, theories, contexts, proofs, conversion The logic, implementation reference
17.2 the scalar profile The scalar profile
27 packages, their dependencies, and their contracts Packages and dependencies, integration contracts
30 checking at the boundary, evidence, the trusted base Checking and evidence, the trusted base
31 Symbolic normalization, Rubi, certificates System architecture, section 31
32 abstract theories, polynomials, special functions System architecture, section 32

How a request flows

The following is the intended workflow of the larger CAS. The packages of this repository supply the kernel, the authoring library, and the theory packages; the parser, engines, and coordinator shown here are parts of the design that the packages do not supply (capabilities and limits). For a workflow you can run, start with getting started.

CAS request: Simplify[(x^2 - 1)/(x - 1), x > 2]
  │
  ├─ reasoner opens a session for the request
  │     engines (rewrite, polynorm, linarith, …) search,
  │     sharing provisional facts that carry proof recipes
  │
  ├─ reasoner selects the best candidate:  x + 1
  │     its recipe cites:  x ≠ 1  (from x > 2, by linarith)
  │                        x ≠ 1 ⇒ (x²−1)/(x−1) = x+1  (polynorm)
  │
  ├─ judgment_core checks the recipe's proof       ← the boundary
  │
  └─ the answer x + 1 is returned, labeled Checked;
     the session and its provisional facts are dropped

Nothing inside the session is trusted, and none of it survives the request unless the kernel checked it. That is why search can be fast: a wrong step costs time, never soundness (checking and evidence).

The parts

Part Role Trusted
termbank Proof-DAG storage (termbank.dag): terms, declarations, contexts, and proof rows, each interned once; workspaces; the verified watermark yes
judgment_core The kernel: types, checked terms, theories, contexts, proofs, conversion, literal arithmetic yes
judgment_shell Theorems, guards, proof building, authoring, the engine protocol no
Theory packages (scalar, judgment_nat, …) The meaning of the symbols: constants, axioms, definitions, lemmas, built on judgment_shell their axioms
judgment The public entry point: authoring and the Scalar builders no
judgment_search Concurrent proof search and lemma checking over session forks (optional) no
judgment_store Proof libraries and their re-checking, interpretations, OpenTheory import and export (optional) no
Engines (rewrite, linarith, polynorm, …) Search: propose answers with recipes and certificates no
reasoner The coordinator: goals, sessions, strategies, the boundary no
The CAS Parsing, presentation, policies; named separately no

The packages page gives the dependency graph of the packages in this repository. Engines, reasoner, and the CAS are parts of the design outside it. The prebuilt core compiles judgment once into a shared library for its Mojo and Python clients; its generated shims only convert arguments and results, so it adds no trusted code.

What makes it fast enough

The architecture separates search, checking, and retained evidence:

  1. Checking at the boundary. The kernel checks the proof of what is returned or stored, not every fact the search derives.
  2. A kernel that computes. Associativity, commutativity, units, and exact arithmetic are definitional equality: supported computations do not require a separate proof node for each arithmetic step. The computation itself still takes time and memory.
  3. Certificates. Untrusted algorithms return evidence that is much cheaper to check than to find.
  4. Proofs on demand. Deterministic runs can be replayed to rebuild a proof that was not materialized.

The system's working target for simplification is checking overhead of 10–20% at most; it is not a measured guarantee of the kernel alone. The development page lists the kernel's measurement programs.

judgment v1.0.0 for Mojo 1.2 · Apache License 2.0 with LLVM Exceptions · Source on GitHub