Integration contracts¶
The packages of this repository share one version and one toolchain and
are built from the checkout. External dependencies (APN and FP Mojo) are
installed by Pixi from the modular-community channel at the versions
pixi.toml pins. The package graph specifies the allowed
imports.
Package responsibilities¶
| Component | Owns |
|---|---|
termbank and judgment_core |
Proof-DAG storage and workspaces, canonical construction, contexts, inference rules, conversion, literal implementations, theory mechanisms, and proof checking |
judgment_shell |
Proposition builders, proof recipes, guards, evidence labels, theorem lookup, law bundles, the engine protocol, and Session authoring |
scalar |
The extended scalar carrier, domain predicates, mathematical laws, and bridges to imported HOL objects, built on judgment_shell's public API |
judgment_nat |
The natural numbers, induction, and primitive recursion as checked definitions, built on judgment_shell's public API |
judgment |
Public entry point for the authoring API and the explicit Scalar profile builders |
judgment_search |
Concurrent proof search and lemma checking over Session forks, built on judgment_shell's public API |
Prebuilt core (bindings/) |
The facade compiled once into a shared library, its ABI description, and the Mojo and Python clients generated from the facade's public declarations |
judgment_store |
Proof libraries of checked proof rows, their loading and re-checking, theory interpretations, OpenTheory import and export |
isabelle_bridge |
Isabelle-side export of extended articles; external, run only through scripts/isabelle/isabelle.py when a new article is exported for judgment_mathlib |
Engines consume law bundles rather than importing a particular scalar profile. The application supplies those bundles and chooses its evidence policy.
Contracts¶
Every interface between components is a contract owned by its producer. The producer's specification is normative; consumers code against it, and a change updates the specification and its consumers together.
| Contract | Owner | Covers | Normative pages |
|---|---|---|---|
| Kernel API | termbank, judgment_core |
Raw syntax and proof-DAG rows; types, terms, declarations and theory mechanisms, contexts, inference rules, conversion, literal kinds, checking, workspaces | T1, K1, C1, K2; the termbank and kernel references |
| L-terms | judgment_shell |
Typed term views, builders, binder opening, and bounded printing | L1 |
| L-recipes | judgment_shell |
Recipes, their atomic execution through the session, and derived rules | L2.1–L2.3 |
| L-labels | judgment_shell |
Evidence labels, dependency classes, source provenance, and tracked external claims | L2.4–L2.5 |
| L-store | judgment_shell |
Matching, metavariables, guards, supports, the theorem store, and its index | L3.1–L3.6 |
| L-bundles | judgment_shell |
Law bundles, their schemas, and filling from class instances | L3.7 |
| L-engines | judgment_shell |
Conversions and the engine protocol | L4 |
| S-format | judgment_store |
The container, stable identities, and the proof-library and partition formats | ST1, ST7, ST9 |
| S-article | judgment_store |
The OpenTheory reader and the extended article format | ST6 |
| Scalar profile | scalar |
Profile and session builders, exact literals, guards, rational transfer, polynomial construction and reification, the algebraic library, law bundles, and numeric APIs | Scalar specifications; the contract boundary |
| Scalar model and bridges | scalar |
build_model, build_bridges, build_classes, and build_analysis |
HOL model and bridges; the contract boundary |
| I-export | isabelle_bridge |
Statement and proof export from the pinned Isabelle release, replay of exported results in Isabelle, and run-time requests | isabelle_bridge's own documentation; the articles it writes use S-article |
The judgment facade reexports the authoring API
and the Scalar profile and model builders with their original types and
semantics; it adds no contract of its own. judgment_nat's interface is
specified on the natural numbers page, and
judgment_search's on the concurrent proof search
page. The prebuilt core binds the facade's API
without adding to it: its clients keep the facade's names, defaults, and
refusals, and pixi run binding-abi-diff shows whether a facade change
changed the bound ABI.
Arithmetic dependencies¶
apn_mojo (exact integers and rationals) and fp_mojo (algebraic data types
and bounded concurrency) are Mojo 1.2 channel packages installed by Pixi. Both
are part of the runtime trusted base. Formal polynomials are
encoded and checked directly inside judgment_core; results produced by any
external polynomial algorithm must enter through checked proof steps rather than
bypassing the kernel.
Isabelle statements and replayed proofs¶
The bridge uses a pinned Isabelle release and explicit fragment coverage.
It gives the kernel no .thy reader. The native storage layer reads
OpenTheory articles, with an extended format for definitions, overloading,
classes, instances, and sorts that require additional commands.
An imported statement admitted without a proof checked by judgment trusts both Isabelle's kernel and the translation of the statement. It enters an import theory with its source prover, release, session, theory, and theorem name. Results that depend on it must retain that provenance. Oracle-derived Isabelle theorems are excluded from admitted imports.
A replayed theorem supplies a derivation checked by judgment. Its acceptance then depends on the checked derivation and its admitted axioms. Translating a statement faithfully and establishing its proof are separate obligations; matching the printed name of a constant is insufficient.
The system's foreign prover is Isabelle, and it reaches the system only
through judgment_mathlib: the theorems the system
uses, exported once from Isabelle with their complete proofs, keeping their
Isabelle source as provenance, and converted into a proof-DAG library. The
library is not in the repository and is not a package; everything that uses
it opens it through judgment_store, and no package and no gate runs
Isabelle. A statement-only import of its theorems is an explicit assumption;
a full load rechecks their proofs. There is no Lean bridge. The
HOL rationale explains the foundation and engineering
tradeoffs. The Isabelle theory sources of the library, including the
constructions generated from scalar's terms, are not part of the system:
they survive as the exported proofs inside the library.
Keep semantic conventions separate¶
Imported HOL objects and CAS scalar objects occupy distinct theories. Isabelle/HOL fields totalize division by zero to zero; the extended scalar profile has infinity and indeterminate values. Bridge theorems relate operations where their meanings agree, retaining the necessary guards. The scalar semantics describes this boundary.
Numeric checks can refute a proposed identity but do not admit it as a new theorem. A mathematical rule must be proved, imported under the stated trust policy, or represented as an explicit hypothesis. External solver claims without checked certificates likewise enter as hypotheses with provenance.
Evidence and persistence¶
Session handles belong to a live session (CG4). Persistent records need
the declarations, evidence, and interpretation required to reconstruct a
result. A proof library stores each theorem's proof rows, which every load
and Library.recheck check again, so rechecking does not depend on
rerunning a search engine (checking,
Proposition B-6). No recipe or certificate is stored.
Evidence labels follow exact judgments through the library's tracked operations. They cannot be reconstructed from matching proposition text. An engine returns a proposal; the coordinator verifies the meaning of its result and evidence policy before publication, including branch coverage and overlap for piecewise results. See checking and evidence for the system boundary.