Documentation

Core.CoreTLAPlus.Syntax

The desugared core syntax of TLA⁺ expressions — the output of desugaring, and the language the type checker and everything downstream actually works against.

Relative to SurfaceTLAPlus.Expression:

inductive CoreTLAPlus.Expression (α : Type) :

TLA⁺ expressions after desugaring. α carries whatever comment-annotation payload the binders (quantifiers, LET in the future, record fields, …) need.

Instances For
    partial def CoreTLAPlus.instReprExpression.repr {α✝ : Type} [Repr α✝] :
    Expression α✝ → ℕ → Std.Format
    @[implicit_reducible]
    instance CoreTLAPlus.instReprExpression {α✝ : Type} [Repr α✝] :
    Equations
    @[implicit_reducible]
    instance CoreTLAPlus.instBEqExpression {α✝ : Type} [BEq α✝] :
    BEq (Expression α✝)
    Equations
    partial def CoreTLAPlus.instBEqExpression.beq {α✝ : Type} [BEq α✝] :
    Expression α✝ → Expression α✝ → Bool
    partial def CoreTLAPlus.Expression.map {α β : Type} (f : α → β) (e : Expression α) :
    partial def CoreTLAPlus.Expression.traverse {F : Type → Type} [Applicative F] {α β : Type} (f : α → F β) (e : Expression α) :
    F (Expression β)

    Whether x occurs free in e — some .var x not under a binder that binds x. A binder's own domain is outside its scope.

    A top-level TLA⁺ declaration. Module INSTANCE is not represented. Own type rather than an abbrev over Core/Declaration.lean's shared one: a CONSTANT's own arity (0 for an ordinary value, matching CONSTANT F(_, _)'s written arity otherwise) is only needed up to the elaborator's arity-vs-annotation consistency check, and has no role in TypedTLAPlus.Declaration, which reuses the shared type unchanged — same reason .recursive (below) emits no TypedTLAPlus.Declaration at all: a RECURSIVE predeclaration is discharged by a later .operator, never becomes a typed declaration in its own right.

    Instances For
      @[implicit_reducible]

      Hand-written since deriving Repr can't discharge the higher-kinded Repr (Expression α) obligation.

      Equations
      • One or more equations did not get rendered due to their size.
      @[implicit_reducible]
      Equations
      • One or more equations did not get rendered due to their size.
      @[implicit_reducible]
      Equations
      • One or more equations did not get rendered due to their size.
      structure CoreTLAPlus.Module (α β : Type) :

      A desugared TLA⁺ module, wrapping the embedded (still-Surface, not-yet-desugared-at-the- statement-level) PlusCal algorithm at whatever α the caller instantiates it at — kept abstract to avoid a cyclic import. Own type for the same reason Declaration above is.

      Instances For
        @[implicit_reducible]
        instance CoreTLAPlus.instInhabitedModule {a✝ a✝¹ : Type} :
        Inhabited (Module a✝ a✝¹)
        Equations
        @[implicit_reducible]
        instance CoreTLAPlus.instReprModule {α β : Type} [Repr α] [Repr β] :
        Repr (Module α β)

        Hand-written, same reason as Declaration's Repr instance above.

        Equations
        • One or more equations did not get rendered due to their size.
        @[implicit_reducible]

        @@ posOf m, same reason Core/Declaration.lean's TLAModule instance carries it: mapping a module rebuilds the structure, and a rebuilt node that isn't re-registered has no position of its own.

        Equations
        • One or more equations did not get rendered due to their size.
        @[implicit_reducible]
        Equations
        • One or more equations did not get rendered due to their size.