Documentation

Core.SurfacePlusCal.Syntax

The surface syntax of Distributed PlusCal algorithms, as accepted by the parser, prior to desugaring into explicit-goto form.

Positions are attached out-of-band via @@/posOf/match_source (Common/Position.lean), not stored structurally in these types.

structure SurfacePlusCal.Ref (β : Type) :

A reference to a (possibly indexed/field-accessed) variable, e.g. x[1][2].y. One entry per path segment, in left-to-right textual order: .inl for a .field segment, .inr for a [e₁, …, eₙ] bracket-index group.

Instances For
    @[implicit_reducible]
    instance SurfacePlusCal.instReprRef {β✝ : Type} [Repr β✝] :
    Repr (Ref β✝)
    Equations
    def SurfacePlusCal.instReprRef.repr {β✝ : Type} [Repr β✝] :
    Ref β✝Std.Format
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      @[implicit_reducible]
      Equations
      @[implicit_reducible]
      Equations
      • One or more equations did not get rendered due to their size.

      The filter/value expression of a multicast, e.g. [m = self, n \in Actors \ {self} |-> Hello(m, n)].

      • binds : List (String × α × Bool × β)

        Each bind is (name, annotation, isEquality, expr); isEquality is true for =, false for \in.

      • val : β
      Instances For
        @[implicit_reducible]
        instance SurfacePlusCal.instReprMulticastFilter {α✝ β✝ : Type} [Repr α✝] [Repr β✝] :
        Repr (MulticastFilter α✝ β✝)
        Equations
        def SurfacePlusCal.instReprMulticastFilter.repr {α✝ β✝ : Type} [Repr α✝] [Repr β✝] :
        MulticastFilter α✝ β✝Std.Format
        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          @[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.
          inductive SurfacePlusCal.Statement (α β : Type) :

          A PlusCal statement. α carries comment annotations (as in SurfaceTLAPlus), β is the embedded-expression type. A block (the body of if/while/with/either/…) is a flat List (String ⊕ Statement α β): a leading label and the statement it labels are elements of the same list; desugaring separates them into distinct fields.

          Instances For
            partial def SurfacePlusCal.instReprStatement.repr {α✝ β✝ : Type} [Repr α✝] [Repr β✝] :
            Statement α✝ β✝Std.Format
            @[implicit_reducible]
            instance SurfacePlusCal.instReprStatement {α✝ β✝ : Type} [Repr α✝] [Repr β✝] :
            Repr (Statement α✝ β✝)
            Equations
            partial def SurfacePlusCal.Statement.bimap {α β γ δ : Type} (f : αβ) (g : γδ) (S : Statement α γ) :
            Statement β δ
            @[implicit_reducible]
            Equations
            Instances For
              partial def SurfacePlusCal.Statement.bitraverse {F : TypeType} [Applicative F] {α β γ δ : Type} (f : αF β) (g : γF δ) (S : Statement α γ) :
              F (Statement β δ)
              @[implicit_reducible]
              Equations
              • One or more equations did not get rendered due to their size.

              The declarations at the top of an algorithm or process block.

              Instances For
                @[implicit_reducible]
                instance SurfacePlusCal.instReprDeclarations {α✝ β✝ : Type} [Repr α✝] [Repr β✝] :
                Repr (Declarations α✝ β✝)
                Equations
                def SurfacePlusCal.instReprDeclarations.repr {α✝ β✝ : Type} [Repr α✝] [Repr β✝] :
                Declarations α✝ β✝Std.Format
                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  @[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 SurfacePlusCal.Process (α β : Type) :

                  process(x ∈ S) ⋆ … / process(x = e) ⋆ ….

                  Instances For
                    @[implicit_reducible]
                    instance SurfacePlusCal.instReprProcess {α✝ β✝ : Type} [Repr α✝] [Repr β✝] :
                    Repr (Process α✝ β✝)
                    Equations
                    def SurfacePlusCal.instReprProcess.repr {α✝ β✝ : Type} [Repr α✝] [Repr β✝] :
                    Process α✝ β✝Std.Format
                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      @[implicit_reducible]
                      instance SurfacePlusCal.instInhabitedProcess {a✝ : Type} [Inhabited a✝] {a✝¹ : Type} [Inhabited a✝¹] :
                      Inhabited (Process a✝ a✝¹)
                      Equations
                      @[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 SurfacePlusCal.Algorithm (α β : Type) :

                      fifos c₁ : τ₁, …; P₁ ∥ … ∥ Pₙ.

                      Instances For
                        @[implicit_reducible]
                        instance SurfacePlusCal.instReprAlgorithm {α✝ β✝ : Type} [Repr α✝] [Repr β✝] :
                        Repr (Algorithm α✝ β✝)
                        Equations
                        def SurfacePlusCal.instReprAlgorithm.repr {α✝ β✝ : Type} [Repr α✝] [Repr β✝] :
                        Algorithm α✝ β✝Std.Format
                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          @[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.