The shape of a TLA⁺ declaration/module, reused as-is by TypedTLAPlus via an abbrev over its
own Expression. Parametrized here by the expression former (E) so the shape and its
Functor/Traversable/Bifunctor/Bitraversable instances are defined once.
Neither SurfaceTLAPlus nor CoreTLAPlus reuses this type: each has its own Declaration/
Module (Core/SurfaceTLAPlus/Syntax.lean, Core/CoreTLAPlus/Syntax.lean) — SurfaceTLAPlus's
because .function's binder list there is wider, admitting the shared-domain/tuple-pattern
sugar Desugarer/TLAPlus.lean flattens down to this shape; both because RECURSIVE's own
.recursive constructor lives on each of theirs (a RECURSIVE predeclaration is checker-
internal bookkeeping past that point — Elaborator/Declarations.lean's Δ — so
TypedTLAPlus.Declaration, reusing this type unchanged, never needs one).
The shared type is named TLAModule, not Module: it sits at root (see below), where it would
otherwise collide with Mathlib's Module typeclass.
A top-level TLA⁺ declaration. RECURSIVE and module INSTANCE are not represented — by the
time a declaration reaches this shared type (TypedTLAPlus, the only stage still using it), a
RECURSIVE predeclaration has already been fully absorbed into an ordinary .operator.
- constants {E : Type → Type} {α : Type} : List (String × α) → Declaration E α
- variables {E : Type → Type} {α : Type} : List (String × α) → Declaration E α
- assume {E : Type → Type} {α : Type} : E α → Declaration E α
- operator
{E : Type → Type}
{α : Type}
: α → String → List (String × ℕ) → E α → Declaration E α
An operator definition, optionally with higher-order arguments. Each parameter's
Natis its arity (0forx,3forF(_, _, _), …). - function
{E : Type → Type}
{α : Type}
: α → String → List (String × E α) → E α → Declaration E α
A function definition, with an explicit domain for every argument.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
A TLA⁺ module, EXTENDS-list and all, wrapping the embedded (Distributed) PlusCal algorithm at
whatever α the caller instantiates it at — kept abstract to avoid a cyclic import between the
TLA⁺ and PlusCal Core ASTs. Each stage recovers its Module via an abbrev over its
Expression (SurfaceTLAPlus.Module, CoreTLAPlus.Module, TypedTLAPlus.Module). Dot-called
extension methods under a stage's Module namespace (mod.runChecker, mod.checkWellFormed,
…) become qualified calls rather than method calls: generalized field notation resolves through
the abbrev's full unfold, landing on this shared type instead of the stage's (nonexistent)
namespace.
- name : String
- declarations₁ : List (Declaration E β)
- pcalAlgorithm : Option α
- declarations₂ : List (Declaration E β)
Instances For
Equations
- instInhabitedTLAModule = { default := instInhabitedTLAModule.default }
@@ posOf m, for the same reason SurfacePlusCal.Process/.Algorithm's instances carry it:
mapping a module rebuilds the structure, and a rebuilt node that isn't re-registered has no
position of its own — posOf then answers for it with whatever unrelated value last occupied
that address (Common/Position.lean). Annotation resolution alone maps every module once
(CommentAnnotation → Annotation), and SurfaceTLAPlus.Module.desugar reads the result's
position.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.