arXiv:2611.12618cs.CCNov 2026

Manuscript Offprint

arXiv:2611.12618

Type-logical grammars and formal languages

Richard Moot

1 Introduction

In a recent article, Pshenitsyn (2025, Section 4) provides a new lower bound for the string languages generated grammars in first-order linear logic, showing we can generate grammars in the class CSLINCS_{LIN}, the context-sensitive languages generated in non-deterministic linear time.

The basic idea is modelling context-sensitive rewrites AB→BCDAB \to BCD as Lambek calculus formulas (A∙B)/(B∙C∙D)(A \bullet B)/(B \bullet C \bullet D), then using the Lambek calculus product to add a constant number kk of these formulas to each lexical entry of the grammar. So if FF is a first-order linear logic formula, and A1,…AjA_1, \dots A_j are j≤kj \le k not necessarily different formulas of the form (p1∙⋯∙pm)/(q1∙⋯∙qn)(p_1 \bullet \dots \bullet p_m)/(q_1 \bullet \dots \bullet q_n) (for all p,qp, q atomic), then we add (…(F∙A1)⋯∙Aj)(\dots (F \bullet A_1) \dots \bullet A_j) for all choices of j≤kj \le k formulas AA.

This construction adds a number of rewrites to an existing grammar, each rewrite replacing a sequence of atomic formulas by another. Given that at most a constant number of rewrites is added to each word of the input sequence, at most a linear number of rewrites can be added in total. This gives a CSLINCS_{LIN} lower bound on the string languages generated by grammars in first-order linear logic. We know CFL⊊L(CSLIN)⊊CSLCFL \subsetneq L(CS_{LIN}) \subsetneq CSL (Book 1978). Given that the context-sensitive languages are generated in non-deterministic linear space, L(MILL1)⊆CSLL(MILL1) \subseteq CSL, where equality would entail NP=PSPACENP = PSPACE. So the full picture of the string languages of first-order linear logic is as follows1^1.

CFL⊊L(CSLIN)⊊L(MILL1)⊆CSLCFL \subsetneq L(CS_{LIN}) \subsetneq L(MILL1) \subseteq CSL

What makes the construction work is that in first-order linear logic, we can ensure that the rewrite rules commute freely. At its base, first-order linear logic is a commutative logic, and, where needed, non-commutativity is enforced by the use of string positions.

Given the result by Book (1978) showing that fixed recognition for CSLINCS_{LIN} is NP complete, Pshenitsyn (2025) showed that fixed recognition for MILL1

1^1The first inclusion is strict because the language {wcwRcw∣w∈(a∣b)∗}\{wcw^R cw|w \in (a|b)^*\} is not in CSLINCS_{LIN} but is a tree adjoining language, and therefore in MILL1. I conjecture that L(MILL1)⊊CSLL(MILL1) \subsetneq CSL as well, possibly with a condition that the first-order logic doesn't use term symbols.

grammars is NP complete as well. MILL1 grammars therefore have NP complete fixed recognition together with NP complete universal recognition.

In this paper, we will do two things. First we will show that even though most type-logical grammars operate with a non-commutative base logic, the mechanisms used for common linguistic constructions can be used to adapt the construction of Pshenitsyn (2025) to any modern type-logical grammars which has product formulas, associativity 2^{2}, an extraction operator or any way to prefix constituents, and a non-deterministic infixation operation. We will show that any type-logical grammar formalism having all these ingredients will have NP complete fixed recognition as well.

Second, we will show how the quasi-linear languages QQ, that is, the class of languages generated in non-deterministic linear time (NSPACE(n)=NLINNSPACE(n) = NLIN, Q=L(NLIN)Q = L(NLIN)) can be generated by grammars in first-order linear logic. The quasi-linear languages are an interesting but powerful class of formal languages. The quasi-linear languages are the smallest abstract family of languages (AFL) closed under intersection. While Pshenitsyn (2025) already showed that MILL1 grammars are closed under intersection, this shows that MILL1 grammars can also generate languages like the exponential language a2na^{2^n}, which can not be generated by intersections of context-free grammars.

This gives us new lower bounds for the class of languages generated by type-logical grammars, L(NLIN)L(NLIN) for first-order linear logic and L(CSLIN)L(CS_{LIN}) for other type-logical grammars.

Figure

It would seem that NLIN strictly contains TAL and probably also MCFL. We will see later that at least the iconic mildly context-sensitive languages are in NLIN. We will see that there are also a number of languages outside of these classes which can be generated by NLIN, notably the exponential language a2na^{2^n} and languages whose relation with these classes is currently unknown, such as the generalised MIX languages.

NLIN should be contrasted to the better-known class LOGCFL. LOGCFL is the class of problems which are logspace many-one reducible to the context-free languages. In terms of automata, they can be seen as non-deterministic Turing machines with a single stack (like context-free grammars) and with a logspace auxiliary store (Sudborough 1978). For NLIN, the auxiliary tapes have linear storage, but the time bound for computation is linear as well (Book & Greibach 1970).

2^{2}Or any form of modally licensed associativity.

The precise relation between NLIN and LOGCFL is unknown and would seem to require important progress in complexity theory to be resolved, notably on the relation between logarithmic space with polynomial time and linear space with linear time.

FormalismStorageTime
CFL1 stackpolynomial
LOGCFL1 stack, 1 logspace Turing tapepolynomial
NLIN1 stack, 1 linear Turing tapelinear

For NLIN, we can see the three stacks as one stack (corresponding to the stack automata, like with context-free grammars) and one Turing tape (since two stacks can emulate one Turing tape). The key question is then whether one linear-space Turing tape with linear time is enough to emulate a log-space stack with polynomial time.

References (17)