Definition. Grammar Residuals
For formal grammars and , the residual (sometimes called the lollipop or linear implication) is the right adjoint to the grammar tensor . It describes strings that, when prefixed by a string matching , will match .
Formally, it is defined as:
Intuitively, a parse of at a string is a function that takes any prefix string and a parse of in , and produces a parse of the full concatenated string in .