Documentation

Elaborator.Context

Resolve x against Γ: lexical first (an expression binder at position iOrigin.bound i), then named (a Memory-keyed name or a declaration, taking its stored Origin). Returns the type, the Origin to bake onto the .var node, and whether the binding is a scheme.

Equations
  • One or more equations did not get rendered due to their size.
Instances For

    Insert one already-tagged named binding — used to build the initial Γ from a module's imports (Driver/Modules.lean).

    Equations
    Instances For
      def extend {m : TypeType} [MonadElaborator m] {α : Type} (x : String) (τ : TypedTLAPlus.Typ) (act : m α) :
      m α

      Push one expression-level lexical binder for the scope of act — a quantifier, CHOOSE, set-builder, map'/fn, EXCEPT binder, or multicast filter recipient. References to x inside act elaborate to Origin.bound 0 at the top of the pushed scope.

      Equations
      Instances For
        def extendAll {m : TypeType} [MonadElaborator m] {α : Type} (bindings : List (String × TypedTLAPlus.Typ)) (act : m α) :
        m α

        Push several lexical binders at once — operator/function parameters. bindings is in declaration order (Op(a, b)[(a, _), (b, _)]), so the last parameter ends up innermost: a elaborates to Origin.bound 1, b to Origin.bound 0.

        Equations
        Instances For
          def extendFree {m : TypeType} [MonadElaborator m] {α : Type} (x : String) (τ : TypedTLAPlus.Typ) (act : m α) :
          m α

          Add one Memory-keyed name (Origin.free — a PlusCal variable/channel/fifo, self, or a statement-level with) for the scope of act.

          Equations
          Instances For
            def extendAllFree {m : TypeType} [MonadElaborator m] {α : Type} (bindings : List (String × TypedTLAPlus.Typ)) (act : m α) :
            m α

            extendFree over a list — a whole variables/channels/fifos block, or a process's local state in scope for its threads.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              def extendAllBindings {m : TypeType} [MonadElaborator m] {α : Type} (bindings : List (String × Binding)) (act : m α) :
              m α

              Extend Γ with a list of already-tagged named Bindings (each carrying its own isScheme/origin) for the scope of act — a checked declaration list's operator/function schemes and CONSTANT/VARIABLE bindings.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For

                Requires that an annotation be present, erroring at pos with what otherwise.

                Equations
                Instances For