Definition. Dependent Tensor of Grammars
The tensor of grammars,
is simply typed, so cannot see what matched.
Just as we have the generalization from the pair type to the dependent pair , we can define a dependent tensor operation. It is a -like generalization over the ordinary tensor, in which the second grammar depends on a parse tree of the first.
Write for the type of parse trees of , each paired with the string it parses.
For a grammar and a family of grammars , the dependent tensor is:
We may also write it as .
When is a constant family, the dependent tensor reduces to the ordinary tensor .
Dependence runs left to right here, which fits left-to-right parsing. The other handedness, in which the first grammar depends on a parse of the second, is also definable.
Relation to Day Convolution
Just as the ordinary tensor is given by Day convolution, I think there is a similar dependent Day convolution for which this operation is an instance. My best guess is for any presheaf on a monoidal category and a functor from the category of elements of into presheaves on ,
Iβm not positive on this though, and I would hope to also extend this to enrichments that arenβt but I donβt see how that could make sense given that I have quantified over the element in the coend rather than using the tensor of the enriching category.