Quotiented free model of open composition #
This module defines Expr, the initial (quotiented) free model of
OpenTheory.
Expr Atom Δ is the quotient of the raw syntax tree Raw Atom Δ by the
equivalence relation Raw.Equiv, which identifies raw expressions that
should be equal according to the OpenTheory equations (functoriality of
map, naturality of par, wire, and plug).
The quotient construction yields a lawful OpenTheory instance by
construction: each law holds because it is a constructor of Raw.Equiv.
Main definitions #
Expr: quotient ofRawbyRaw.Equiv.Expr.mk: canonical projection fromRawtoExpr.Expr.map,Expr.par,Expr.wire,Expr.plug: lifted operations.Expr.interpret: interpretation into any lawfulOpenTheory, lifted fromRaw.interpret.Expr.theory: the free lawfulOpenTheoryoverAtom.Expr.toInterp: embedding into the tagless-finalInterpmodel.
Expr Atom Δ is the free open-system expression of boundary Δ, generated
by primitive atoms Atom.
This is the quotient of Raw Atom Δ by the OpenTheory equations. Unlike the
raw syntax tree, Expr satisfies map_id, map_comp, and the naturality
laws, so it forms a lawful OpenTheory.
For pattern matching on the underlying syntax, project to Raw via
Expr.liftOn or work with Raw directly.
Instances For
Project a raw expression into the quotiented Expr.
Instances For
Inject a primitive open component.
Instances For
Adapt the exposed boundary along a structural morphism.
Instances For
Place two open systems side by side.
Instances For
Connect one shared boundary between two open systems.
Instances For
The identity wire (coevaluation) on boundary Γ.
Instances For
Close an open system against a matching context.
Derived from wire and map, mirroring Raw.plug.
Instances For
The monoidal unit (closed system with no boundary).
Derived from idWire and map, mirroring Raw.unit.
Instances For
Interpret a quotiented expression in a compact closed target theory.
Well-defined on the quotient because Raw.Equiv.interpret_eq shows that
equivalent raw expressions interpret the same way in any compact closed theory.
Instances For
The free lawful OpenTheory whose objects are quotiented expressions over
Atom.
Instances For
Embed a quotiented expression into the tagless-final representation.
Well-defined on the quotient because equivalent raw expressions interpret the
same way in every compact closed theory (which is exactly what Interp.ext
requires).