std.grammar.lambek¶
The Lambek calculus over a chart: rules that are theorems of the associative Lambek calculus L, under the categorial interface of std.grammar.ccg.
A grammar that extends these signatures shares its categories, items,
and lexicons with a CCG over std.grammar.ccg: Fwd(X, Y) is X/Y,
Bwd(X, Y) is X\Y (result first), and Tns(A, B) is the product A*B.
Every rule here licenses a sequent provable in L without cut, and every
rule keeps its premises in order and uses each once, so a chart over
adjacent spans derives only L-theorems: it is a sound fragment of L.
It is not complete: L also proves sequents that need hypothetical
reasoning, which no finite rule set over spans performs.
Type raising, A |- B/(A\B), leaves B free in its conclusion, so it is
not a chart rule; a grammar states the instances it needs, such as
span(I, J, NP) |- span(I, J, Fwd(S, Bwd(S, NP))), in its own body.
A deduction extending Product and C.Reified quotes Tns(A, B) as
Times(A, B) by adding product_clause to the clauses std.grammar.ccg
asks of it.
The examples on this page run in this module, which opens std.grammar.lambek with the imports and opens the module itself makes:
The rules of its deduction signatures are pinned by the specification module, which declares grammars over them and tests the sentences each derives.
Imports: std.grammar.ccg
Associative (deduction signature)¶
deduction signature Associative
Application and harmonic composition of degree one to three, every one an L-theorem: X/Y, Y/Z |- X/Z holds by /L twice and /R. Crossed composition is not, so it is absent.
Lambek (deduction signature)¶
deduction signature Lambek
The chart fragment of L: application, harmonic composition, and the product.
Product (deduction signature)¶
deduction signature Product
The product of L: two adjacent spans form their product, and a functor
over a product is curried into one over its components, C/(A*B) |-
(C/B)/A and (A*B)\C |- B\(A\C), written here result first.
product_clause (computation)¶
meta define product_clause : MorphClause !{}
The clause quoting the product Tns(A, B) as C.Times(A, B).