Inclusions for combined oracle signatures #
Sum and dependent-sum signatures have canonical response-preserving inclusions. The public query equations expose their action for rewriting without unfolding instance implementation details.
We need Inhabited to prevent infinite type-class searching.
Add additional oracles to the right side of the existing ones.
Add additional oracles to the left side of the exiting ones.
Congruence on the left summand: an inclusion spec₁ ⊂ₒ spec₃ extends to
spec₁ + spec₂ ⊂ₒ spec₃ + spec₂.
Low priority so that searches whose source spec is a metavariable (notably the
MonadLiftT (OracleComp spec) (OracleComp superSpec) chain behind whole-computation
coercions) prefer the direct embeddings subSpec_add_left / subSpec_add_right. This keeps
such coercions a single liftComp, definitionally, instead of a stack of lifts through an
intermediate spec.
Congruence on the right summand: an inclusion spec₂ ⊂ₒ spec₃ extends to
spec₁ + spec₂ ⊂ₒ spec₁ + spec₃.
Low priority for the same reason as subSpec_left_add_left_add_of_subSpec: the direct
embeddings must win metavariable-headed searches so that whole-computation coercions stay a
single liftComp.