Multimodal Type-Logical Grammar

QVR Source

category S, NP, N, VP, PP
object Token : 256

let tlg = parser(
    rules=[evaluation, adjunction_units, modal_introduction, modal_elimination],
    terminal=Token,
    constructors=[slash, diamond],
    depth=1,
    start=S
)

output tlg

Overview

Multimodal type-logical grammar extends the Lambek calculus with modal operators that allow controlled relaxation of resource sensitivity. This example demonstrates the diamond constructor, the depth parameter for bounding modal nesting, and the modal_introduction/modal_elimination rule schemas.

Walkthrough

The category and token declarations are identical to the basic type-logical grammar example.

The parser declaration introduces two new parameters. constructors=[slash, diamond] specifies which type-level operations are available: slash permits forming \(X/Y\) and \(X \backslash Y\); diamond permits forming \(\Diamond X\), marking \(X\) as modally flexible. depth=1 bounds nesting: \(\Diamond(\mathrm{NP}/\mathrm{VP})\) is allowed, but \(\Diamond(\Diamond \mathrm{NP})\) is not. Without a depth bound, the category space would be infinite and parsing intractable.

The rules evaluation and adjunction_units work as in the basic type-logical grammar. The two new rules:

DSL Features

Python Usage

Categorical Perspective

The diamond operator \(\Diamond\) acts as a monad on the category of formulas. Its unit \(\eta : X \to \Diamond X\) (modal introduction) lifts any formula into the modal, and its multiplication \(\mu : \Diamond(\Diamond X) \to \Diamond X\) (idempotence) collapses nested modals. The standard Lambek calculus is the internal language of a symmetric monoidal closed category with no extra structure. Adding the diamond monad permits controlled relaxation of resource sensitivity: inside the monad, structural rules like exchange, weakening, and contraction become available. The parser stays tractable because the depth parameter keeps the category space finite.

Linguistic Applications

Multimodal type-logical grammar handles cases where strict linearity must be relaxed:

Connections to Other Modal Formalisms

Multimodal type-logical grammar differs from related approaches (display logic, separation logic) in that its modes are chosen for specific linguistic phenomena, and the structural rules each mode licenses are carefully restricted to avoid over-generation. It is more flexible than the strict Lambek calculus but more constrained than unrestricted phrase-structure grammars.