The observational category of circuit translations #
Dependent gate indices make raw compiler output too intensional for useful categorical equality. We quotient translations by the behavior they induce on all interpretations over a fixed carrier and on all weighted cost models. Compilation respects this relation, and the quotient forms an ordinary Mathlib category.
Two translations are observationally equivalent over U when they induce
the same interpretation pullback on U and the same pullback of every cost
model.
- pull_eq (interpretation : Interpretation τ U) : left.pull interpretation = right.pull interpretation
- pullCost_eq (operationCost : OperationCost τ) : left.pullCost operationCost = right.pullCost operationCost
Instances For
Equivalent translations compile every circuit to the same semantics over the observed carrier.
Equivalent translations compile every circuit to the same weighted cost.
Observational equivalence is a congruence for translation composition.
Left identity law, up to observational equivalence.
Right identity law, up to observational equivalence.
Associativity law, up to observational equivalence.
Setoid used to form the observational quotient of translations.
Equations
- Algebraic.Translation.equivalentOnSetoid U σ τ = { r := Algebraic.Translation.EquivalentOn U, iseqv := ⋯ }
Instances For
A signature regarded as an object whose translations are observed over
the carrier U.
- signature : Signature
The underlying signature.
Instances For
A morphism of observed signatures is an observational equivalence class of circuit translations.
Equations
- Algebraic.ObservedTranslation U source target = Quotient (Algebraic.Translation.equivalentOnSetoid U source.signature target.signature)
Instances For
Include a raw translation in the observational quotient.
Equations
- Algebraic.ObservedTranslation.mk translation = ⟦translation⟧
Instances For
Identity morphism in the observational quotient.
Equations
- Algebraic.ObservedTranslation.id signature = Algebraic.ObservedTranslation.mk (Algebraic.Translation.id signature.signature)
Instances For
Composition in the observational quotient.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Circuit signatures and translations modulo semantic-and-cost observation form a category.
Equations
- One or more equations did not get rendered due to their size.