Documentation

PolyFun.Interaction.Execution.ReactiveNetwork.Diagram

Open routing diagrams of reactive polynomial machines #

A diagram contains typed components and routes without selecting a global environment. Parallel composition and wiring preserve the components themselves. Boundary maps translate only external traffic, and wiring resolves an outgoing shared-boundary packet to the receiving component's ingress. Every component retains its own polynomial effect and private state.

The designated environment and execution policy are supplied when a diagram is run. In particular, composing two fragments does not choose two competing recipients of yielded control. Boundary functions are structural semantic data; their executable cost is a separate obligation.

structure Interaction.Execution.ReactiveNetwork.Diagram (Node : Type) (boundary : PortBoundary) (result : Type) :

Typed open components and their internal and external packet routes.

Instances For
    theorem Interaction.Execution.ReactiveNetwork.Diagram.ext {Node result : Type} {Δ : PortBoundary} {left right : Diagram Node Δ result} (heffect : left.effect = right.effect) (hports : left.ports = right.ports) (hcomponent : left.component ≍ right.component) (hroute : left.route ≍ right.route) (hingress : left.ingress ≍ right.ingress) :
    left = right

    Diagrams agree when their interfaces, initialized machines, and typed routes agree.

    theorem Interaction.Execution.ReactiveNetwork.Diagram.ext_iff {Node result : Type} {Δ : PortBoundary} {left right : Diagram Node Δ result} :
    left = right ↔ left.effect = right.effect ∧ left.ports = right.ports ∧ left.component ≍ right.component ∧ left.route ≍ right.route ∧ left.ingress ≍ right.ingress
    def Interaction.Execution.ReactiveNetwork.Diagram.reindex {Node Node₁ result : Type} {Δ : PortBoundary} (diagram : Diagram Node Δ result) (e : Node₁ ≃ Node) :
    Diagram Node₁ Δ result

    Relabel components and dependent packet recipients along an identity bijection.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      def Interaction.Execution.ReactiveNetwork.Diagram.atom {result : Type} {Δ : PortBoundary} {effect : PFunctor.{0, 0}} (process : ReactiveProcess.Process effect Δ Unit result) :
      Diagram Unit Δ result

      Place one initialized reactive machine at a single node.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        def Interaction.Execution.ReactiveNetwork.Diagram.map {Node result : Type} {Δ₁ Δ₂ : PortBoundary} (f : Δ₁.Hom Δ₂) (diagram : Diagram Node Δ₁ result) :
        Diagram Node Δ₂ result

        Adapt the external boundary without changing component interfaces or private states.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          def Interaction.Execution.ReactiveNetwork.Diagram.par {Node₁ Node₂ result : Type} {Δ₁ Δ₂ : PortBoundary} (left : Diagram Node₁ Δ₁ result) (right : Diagram Node₂ Δ₂ result) :
          Diagram (Node₁ ⊕ Node₂) (Δ₁.tensor Δ₂) result

          Parallel composition uses disjoint node identities and retains both external boundaries.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            def Interaction.Execution.ReactiveNetwork.Diagram.wire {Node₁ Node₂ result : Type} {Δ₁ Δ₂ Γ : PortBoundary} (left : Diagram Node₁ (Δ₁.tensor Γ) result) (right : Diagram Node₂ (Γ.swap.tensor Δ₂) result) :
            Diagram (Node₁ ⊕ Node₂) (Δ₁.tensor Δ₂) result

            Wire a shared boundary directly to the other fragment's ingress. Sends still consume their ordinary local and delivery activations; no component or shared service is copied.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              def Interaction.Execution.ReactiveNetwork.Diagram.plug {Node₁ Node₂ result : Type} {Δ : PortBoundary} (left : Diagram Node₁ Δ result) (right : Diagram Node₂ Δ.swap result) :
              Diagram (Node₁ ⊕ Node₂) PortBoundary.empty result

              Close two opposite boundaries while retaining the identities of every component.

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