-
Notifications
You must be signed in to change notification settings - Fork 1
Developer Guide
MesTTo edited this page Jun 19, 2026
·
1 revision
This page covers the Lean tooling, libraries, and proof machinery for working on LeaTTa. For the concepts themselves, read the documentation.
-
elan manages the Lean toolchain. The exact version is pinned in
lean-toolchain(leanprover/lean4:v4.31.0). elan reads that file automatically. -
lake is the build tool.
lake build LeaTTabuilds just the interpreter binary,lake buildbuilds everything including the metatheory, andlake exe cache getfetches prebuilt Mathlib oleans so you do not compile Mathlib yourself. -
Editor: VS Code with the Lean 4 extension, or any editor with the Lean LSP. The
extension provides the goal view,
exact?, and hover types, which are the main way to drive proofs interactively.
-
Mathlib is pinned to the release whose toolchain matches ours. It backs the
metatheory layer only:
MettaHyperonFull/Proofs/andMettaHyperonFull/Operational/. Use it freely there for orders,Multiset,Relation.ReflTransGen, decidability infrastructure, andaesop. -
The executable kernel does not import Mathlib.
Multiset,Finset, andRealare noncomputable, so the interpreter that mustlake exestays onListandStd.HashMap. Keep this split: computable code underCore,Runtime, andMinimalstays Mathlib free, and proofs about it live underProofs.
-
omegafor linear arithmetic overNatandInt. -
decideandDecidableinstances for finite, computable checks. -
simpwith explicit lemma sets rather than blanket simp, so proofs stay stable. -
aesopwhere a goal is routine. -
termination_byanddecreasing_byfor the fuel-bounded interpreter driver. The termination measure is explicit and Lean checks it. - Hard invariant: zero
sorry, zeroadmit, zeronative_decide, zeropartial, and zerounsafe. A proof that needs one of these is not finished.
-
exact?,apply?, andrw?suggest library lemmas from the current goal. - For broader search, use Loogle or the Mathlib search. Prefer an existing Mathlib lemma over a hand-rolled one in the proof layer.
-
MettaHyperonFull/Coreis the object language. -
MettaHyperonFull/Runtime/Parserparses surface MeTTa. -
MettaHyperonFull/Minimal/InterpreterandMinimal/Stdlibare the faithful kernel and the standard library written over its twelve instructions. This is the computable heart. -
MettaHyperonFull/Proofsis the Mathlib-backed metatheory: determinism, confluence of the deterministic fragment, sound and complete first-argument indexing, type soundness, and alpha-equivalence. -
MettaHyperonFull/Operationalmachine-checks the published Meta-MeTTa operational semantics: the four-register machine, its barbed bisimulation, and the gas extension.
See CONTRIBUTING.md.
Keep the kernel Mathlib free, put new theorems under Proofs, and run make oracle
against Hyperon's corpus before proposing a change.