Definition. Tensor of Grammars

For formal grammars 𝐴 and 𝐡, their tensor π΄βŠ—π΅ represents the concatenation of the languages they describe. A parse for π΄βŠ—π΅ at a string 𝑀 consists of a splitting of 𝑀 into a prefix 𝑒 and suffix 𝑣, along with a parse of 𝑒 in 𝐴 and a parse of 𝑣 in 𝐡.

Formally, it is defined as:

(π΄βŠ—π΅)(𝑀)=βˆ‘π‘€=𝑒𝑣𝐴(𝑒)×𝐡(𝑣)

This operation is exactly the Day convolution of 𝐴 and 𝐡, where we view formal grammars as presheaves over the monoid of strings.

grammar-tensor definition entries/parsing/grammar-tensor.hel