Documentation

VCVio.Interaction.UC.Notation

UC composition notation #

Scoped notation for open-system boundaries and the free composition syntax. All notation is scoped to Interaction.UC; use open Interaction.UC to bring it into scope.

Typeclasses #

The notation is backed by three typeclasses (HasPar, HasWire, HasPlug) with instances for Raw, Expr, and Interp. Each instance is accompanied by a @[simp] bridge lemma that normalizes the typeclass method back to the concrete operation, ensuring that existing simp lemmas (e.g., interpret_par, interpret_wire) continue to fire on notation-introduced terms.

Boundary-level #

NotationMeaningInput method
Δ₁ ⊗ᵇ Δ₂PortBoundary.tensor Δ₁ Δ₂\otimes ^b
ΔᵛPortBoundary.swap Δ (dual)\^v

Expression-level #

NotationMeaningPrecedence
e₁ ∥ e₂HasPar.par e₁ e₂ (parallel)70, right
e₁ ⊞ e₂HasWire.wire e₁ e₂ (wire)65, right
e ⊠ kHasPlug.plug e k (plug/close)60, right

Parsing rules #

Precedence ensures natural parenthesization:

Boundary-level notation #

Tensor (parallel) of port boundaries: Δ₁ ⊗ᵇ Δ₂.

Instances For

    Dual (swap) of a port boundary: Δᵛ means PortBoundary.swap Δ.

    The superscript v (typed \^v) visually suggests "flip" or "invert," matching the operation that swaps inputs and outputs. Avoids the Mathlib-global ᵒᵖ (which denotes Opposite).

    Instances For

      Composition typeclasses #

      class Interaction.UC.HasPar (F : PortBoundaryType u_1) :
      Type (max 1 u_1)

      Parallel composition on boundary-indexed types.

      Instances
        class Interaction.UC.HasWire (F : PortBoundaryType u_1) :
        Type (max 1 u_1)

        Wiring (partial internal connection) on boundary-indexed types.

        Instances
          class Interaction.UC.HasPlug (F : PortBoundaryType u_1) :
          Type (max 1 u_1)

          Plugging (full closure) on boundary-indexed types.

          Instances

            Notation #

            Parallel composition: e₁ ∥ e₂.

            Instances For

              Wiring: e₁ ⊞ e₂.

              Instances For

                Plug (full closure): e ⊠ k.

                Instances For

                  Instances and bridge lemmas for Raw #

                  @[implicit_reducible]
                  @[implicit_reducible]
                  @[implicit_reducible]
                  @[simp]
                  theorem Interaction.UC.OpenSyntax.Raw.hasPar {Atom : PortBoundaryType u_1} {Δ₁ Δ₂ : PortBoundary} (e₁ : Raw Atom Δ₁) (e₂ : Raw Atom Δ₂) :
                  HasPar.par e₁ e₂ = e₁.par e₂
                  @[simp]
                  theorem Interaction.UC.OpenSyntax.Raw.hasWire {Atom : PortBoundaryType u_1} {Δ₁ Δ₂ Γ : PortBoundary} (e₁ : Raw Atom (Δ₁.tensor Γ)) (e₂ : Raw Atom (Γ.swap.tensor Δ₂)) :
                  HasWire.wire e₁ e₂ = e₁.wire e₂
                  @[simp]
                  theorem Interaction.UC.OpenSyntax.Raw.hasPlug {Atom : PortBoundaryType u_1} {Δ₁ : PortBoundary} (e : Raw Atom Δ₁) (k : Raw Atom Δ₁.swap) :

                  Instances and bridge lemmas for Expr #

                  @[implicit_reducible]
                  @[implicit_reducible]
                  @[implicit_reducible]
                  @[simp]
                  theorem Interaction.UC.OpenSyntax.Expr.hasPar {Atom : PortBoundaryType u_1} {Δ₁ Δ₂ : PortBoundary} (e₁ : Expr Atom Δ₁) (e₂ : Expr Atom Δ₂) :
                  HasPar.par e₁ e₂ = e₁.par e₂
                  @[simp]
                  theorem Interaction.UC.OpenSyntax.Expr.hasWire {Atom : PortBoundaryType u_1} {Δ₁ Δ₂ Γ : PortBoundary} (e₁ : Expr Atom (Δ₁.tensor Γ)) (e₂ : Expr Atom (Γ.swap.tensor Δ₂)) :
                  HasWire.wire e₁ e₂ = e₁.wire e₂
                  @[simp]
                  theorem Interaction.UC.OpenSyntax.Expr.hasPlug {Atom : PortBoundaryType u_1} {Δ₁ : PortBoundary} (e : Expr Atom Δ₁) (k : Expr Atom Δ₁.swap) :

                  Instances and bridge lemmas for Interp #

                  @[implicit_reducible]
                  @[implicit_reducible]
                  @[implicit_reducible]
                  @[simp]
                  theorem Interaction.UC.OpenSyntax.Interp.hasPar {Atom : PortBoundaryType u_1} {Δ₁ Δ₂ : PortBoundary} (e₁ : Interp Atom Δ₁) (e₂ : Interp Atom Δ₂) :
                  HasPar.par e₁ e₂ = e₁.par e₂
                  @[simp]
                  theorem Interaction.UC.OpenSyntax.Interp.hasWire {Atom : PortBoundaryType u_1} {Δ₁ Δ₂ Γ : PortBoundary} (e₁ : Interp Atom (Δ₁.tensor Γ)) (e₂ : Interp Atom (Γ.swap.tensor Δ₂)) :
                  HasWire.wire e₁ e₂ = e₁.wire e₂
                  @[simp]
                  theorem Interaction.UC.OpenSyntax.Interp.hasPlug {Atom : PortBoundaryType u_1} {Δ₁ : PortBoundary} (e : Interp Atom Δ₁) (k : Interp Atom Δ₁.swap) :

                  Verification #

                  The following examples verify correct elaboration, precedence, and that bridge lemmas fire correctly with simp.