SLIDE 1 Complexity of the Lambek Calculus and Its Fragments
Mati Pentus http://lpcs.math.msu.su/~pentus/
- The Lambek calculus (denoted L) is a mathematical tool for formal
language specification. It generates the class of all context-free languages without the empty word.
- The Lambek calculus with empty antecedents (denoted L∗)
generates the class of all context-free languages.
- Proof nets provide a convenient criterion for derivability in L∗.
- The derivability problems for L∗(\, /) and L(\, /) are NP-complete.
- The derivability problems for L∗(\) and L(\) are decidable in
deterministic polynomial time.
1
SLIDE 2 1 “Hilbert style” Lambek calculus
- J. Lambek, The mathematics of sentence structure,
American Mathematical Monthly 65 (1958), no. 3, 154–170. Definition 1. The set of all types is defined as the minimal set Tp such that
- {p0, p1, p2, . . .} ⊂ Tp
- If A ∈ Tp and B ∈ Tp, then
(A·B) ∈ Tp, (A\B) ∈ Tp, and (A/B) ∈ Tp. Example 1. (p1·(p1\p2)) ∈ Tp. Below, we shall use q, r, s, and t instead of p0, p1, p2, and p3. Derivable objects of LH are A → B, where A ∈ Tp and B ∈ Tp. Example 2. LH ⊢ (s/q)·q → s, but LH q·(s/q) → s.
2
SLIDE 3 Axioms and rules of LH (the “Hilbert style” Lambek calculus) A → A (A·B)·C → A·(B·C) A·(B·C) → (A·B)·C A → B B → C A → C A·B → C A → C/B A·B → C B → A\C A → C/B A·B → C B → A\C A·B → C We write LH ⊢ A → B for “A → B is derivable in the calculus LH”. Example 3. LH ⊢ q → s/(q\s). q\s → q\s q·(q\s) → s q → s/(q\s)
3
SLIDE 4
Example 4. LH ⊢ A·(A\B) → B, LH ⊢ (B/A)·A → B, LH ⊢ (A\B)·(B\C) → A\C, LH ⊢ (C/B)·(B/A) → C/A, LH ⊢ A → B/(A\B), LH ⊢ A → (B/A)\B, LH ⊢ (A\B)/C → A\(B/C), LH ⊢ A\(B/C) → (A\B)/C. Definition 2. A ↔ B iff LH ⊢ A → B and LH ⊢ B → A. Example 5. (A\B)/C ↔ A\(B/C), A/(B·C) ↔ (A/C)/B, A·(A\(A·B)) ↔ A·B, A\(A·(A\B)) ↔ A\B. Example 6. LH ⊢ ((r/q)\s)\t → (r\s)\(q\t), LH ((q\r)\s)\t → s\((r\q)\t), LH ⊢ ((q\r)\(q\q))\t → (q\q)\((r\q)\t).
4
SLIDE 5
2 Gentzen style Lambek calculus
Tp∗ denotes the set of all finite sequences of types. Tp+ denotes the set of all non-empty finite sequences of types. Derivable objects of the calculus L (the Gentzen style Lambek calculus) are sequents Γ → A, where A ∈ Tp and Γ ∈ Tp+. Axioms and rules of L A → A Φ → B Γ B ∆ → A Γ Φ ∆ → A (cut) A Π → B Π → A\B (→ \) (Π is non-empty) Φ → A Γ B ∆ → C Γ Φ (A\B) ∆ → C (\ →) Π A → B Π → B/A (→ /) (Π is non-empty) Φ → A Γ B ∆ → C Γ (B/A) Φ ∆ → C (/ →) Γ → A ∆ → B Γ ∆ → A·B (→ ·) Γ A B ∆ → C Γ (A·B) ∆ → C (· →) Here A, B, C ∈ Tp and Γ, ∆, Φ, Π ∈ Tp∗.
5
SLIDE 6 Example 7. L ⊢ A·(B/C) → (A·B)/C A → A C → C B → B (B/C) C → B (/ →) A (B/C) C → (A·B) (→ ·) A (B/C) → (A·B)/C (→ /) A·(B/C) → (A·B)/C (· →) Theorem 1 (J. Lambek, 1958). L ⊢ A1 . . . An → B if and only if LH ⊢ A1· . . . ·An → B. Theorem 2 (cut-elimination, J. Lambek, 1958). A sequent is derivable in L if and only if it is derivable in L without (cut).
- Corollary. The derivability problem for L (and for LH) is decidable in
nondeterministic polynomial time.
- Remark. L (A·B)/C → A·(B/C).
6
SLIDE 7
3 Grammars
The purpose of a Lambek categorial grammar is to provide an algorithm for distinguishing sentences from nonsentences in a fragment of a natural language. Example 8.
Mary np John np smiles np\s sees (np\s)/np charmingly (np\s)\(np\s) np = p1 s = p2
np → np np → np s → s np (np\s) → s (\ →) np ((np\s)/np) np Mary sees John → s (/ →) (np\s) → (np\s) np → np s → s np (np\s) → s (\ →) np (np\s) ((np\s)\(np\s)) Mary smiles charmingly → s (\ →)
7
SLIDE 8
4 Lambek calculus with empty antecedents
Derivable objects of the calculus L∗ are sequents Γ → A, where A ∈ Tp and Γ ∈ Tp∗ (Tp∗ denotes the set of all finite sequences of types). Axioms and rules of L∗ A → A Φ → B Γ B ∆ → A Γ Φ ∆ → A (cut) A Π → B Π → A\B (→ \) Φ → A Γ B ∆ → C Γ Φ (A\B) ∆ → C (\ →) Π A → B Π → B/A (→ /) Φ → A Γ B ∆ → C Γ (B/A) Φ ∆ → C (/ →) Γ → A ∆ → B Γ ∆ → A·B (→ ·) Γ A B ∆ → C Γ (A·B) ∆ → C (· →) Example 9. B → B → B\B (→ \) A → A A/(B\B) → A (/ →) Cut-elimination theorem. We may drop (cut) from L∗.
8
SLIDE 9
5 Interpretation in the free group
If a sequent is derivable in L∗, then in the free group its translation is equal to the unit. Here A/B = A · B−1 and A\B = A−1 · B. Example 10. L∗ ⊢ q → (s/q)\s. q\((s/q)\s) = q−1 · ((s · q−1)−1 · s) = q−1 · ((q · s−1) · s) = q−1 · q · s−1 · s = 1
9
SLIDE 10 6 Cyclic linear logic
Noncommutative linear logic was suggested by J.-Y. Girard in 1987 and expounded by D. N. Yetter.
- D. N. Yetter, Quantales and noncommutative linear logic, Journal of
Symbolic Logic, 55 (1990), no. 1, pp. 41–64. Definition 3. Let At ⇌ {p0, p1, p2, . . .} ∪ {p0, p1, p2, . . .}. Linear formulas are the elements of the minimal set Fm such that
- At ⊂ Fm,
- if A∈Fm and B ∈Fm, then (A⊗B)∈Fm and (AB)∈Fm.
(pi)⊥ ⇌ pi (pi)⊥ ⇌ pi (A ⊗ B)⊥ ⇌ (B)⊥ (A)⊥ (A B)⊥ ⇌ (B)⊥ ⊗ (A)⊥
10
SLIDE 11 The mapping A → A embeds L∗ into cyclic linear logic.
A ( B)⊥
A)⊥ B
A ⊗ B Example 11.
and
Derivable objects of cyclic linear logic are sequents → A1 . . . An, where Ai ∈ Fm. The intended meaning of → A1 . . . An is A1 . . . An. Axioms and rules of CMLL → pi pi → pi pi → Γ A B ∆ → Γ (A B) ∆ → Γ A → Φ B ∆ → Φ Γ (A ⊗ B) ∆ → Γ A Π → B ∆ → Γ (A ⊗ B) ∆ Π
11
SLIDE 12 Example 12. CMLL ⊢ → (p ⊗ q) (q ⊗ r) (r p). → p p → q q → (p ⊗ q) q p → r r → (p ⊗ q) (q ⊗ r) r p → (p ⊗ q) (q ⊗ r) (r p) Example 13. CMLL ⊢ → (r ⊗ r) (r ⊗ r) (r r)
- Remark. L∗ ⊢ A1 . . . An → B if and only if CMLL ⊢ →
An
⊥ . . .
A1
⊥
B. Example 14. L∗ ⊢ ((q\r)·s) → (q\(r·s)) and CMLL ⊢ → (s (r ⊗ q)) (q (r ⊗ s)). → r r → s s → s r (r ⊗ s) → q q → s (r ⊗ q) q (r ⊗ s) → s (r ⊗ q) (q (r ⊗ s)) → (s (r ⊗ q)) (q (r ⊗ s))
12
SLIDE 13 7 Region proof nets for CMLL and L∗
- M. Pentus, Free monoid completeness of the Lambek calculus allowing empty
premises, Proceedings of LC 1996, pp. 171–209. For each sequent we build a tree. q → ((s/q)\s)
- q\((s/q)\s)
- q s q s
- q ((q ⊗ s) s)
- q
s ⊗ s q
SLIDE 14 A region proof net consists of the tree, nonintersecting axiom links (green), and arcs leading from each ⊗ to a in the same region. The oriented graph consisting of black arcs must be acyclic. Example 15. L∗ ⊢ q → (s/q)\s. q s ⊗ s q
- Example 16. L∗ (s/q)\s → q.
((s/q)\s)\q
s q s
q
SLIDE 15 Example 17. L∗ ⊢ (s\p)\t → (r\p)\((s\r)\t).
- (s\p)\t
- \
- (r\p)\((s\r)\t)
- s p t r p r p t
- (t ⊗ (s p)) (p ⊗ r) (r ⊗ s) t
r s s p p r ⊗ t t
SLIDE 16 Example 17. L∗ ⊢ (s\p)\t → (r\p)\((s\r)\t).
- (s\p)\t
- \
- (r\p)\((s\r)\t)
- s p t r p r p t
- (t ⊗ (s p)) (p ⊗ r) (r ⊗ s) t
r s s p p r ⊗ t t
SLIDE 17 Example 17. L∗ ⊢ (s\p)\t → (r\p)\((s\r)\t).
- (s\p)\t
- \
- (r\p)\((s\r)\t)
- s p t r p r p t
- (t ⊗ (s p)) (p ⊗ r) (r ⊗ s) t
r s s p p r ⊗ t t
- ⊗
- ⊗
- Theorem 3. A sequent is derivable in CMLL if and only if there exists
a region proof net for it.
17
SLIDE 18 8 The complexity of L∗ and L
- M. Pentus, Lambek calculus is NP-complete, Theoretical Computer Science,
357 (2006), no. 1–3, pp. 186–201.
- Remark. The derivability problem for CMLL is in NP.
Theorem 4 (2003). The derivability problems for L∗ and L are NP-complete. We can reformulate the well-known NP-complete problem SAT (satisfiability in the classical propositional logic) in terms of electrical circuits. This makes it easy to translate the problem into a problem concerning planar graphs. Let c1 ∧ . . . ∧ cm be a Boolean formula in conjunctive normal form with clauses c1, . . . , cm and variables x1, . . . , xn. We construct a frame (with m lamps and n sockets) and a set of 2n blocks (each of which fits into one socket only) so that the formula c1 ∧ . . . ∧ cm is satisfiable if and only if there is a way to plug n blocks into the sockets so that no lamp will be switched on. Each block (and each socket) has 2m contacts.
18
SLIDE 19 Example 18. (x1 ∨ x2) ∧ (¬x1 ∨ x3). x1 x2 x3
x2 = 0 x3 = 0 x1 = 1 x2 = 1 x3 = 1
19
SLIDE 20 Example 19. (x1 ∨ x2) ∧ (¬x1 ∨ x2) ∧ (¬x2). x1 x2
x2 = 0 x1 = 1 x2 = 1
20
SLIDE 21 To model the circuits in L∗ we shall construct types G, Ei(0), Ei(1), Fi (where 1 ≤ i ≤ n) with the following properties.
- L∗ ⊢ E1(t1) . . . En(tn) → G if and only if t1, . . . , tn ∈ {0, 1}n is
a satisfying assignment for the Boolean formula c1 ∧ . . . ∧ cm.
- L∗ ⊢ F1 . . . Fn → G if and only if L∗ ⊢ E1(t1) . . . En(tn) → G for some
t1, . . . , tn ∈ {0, 1}. This can be done in deterministic polynomial time (in terms of the length of the given Boolean formula). We construct these types from pj
i (where 0 ≤ i ≤ n and 0 ≤ j ≤ m).
For any Boolean variable xi let ¬0xi stand for the literal ¬xi and ¬1xi stand for the literal xi. Note that t1, . . . , tn ∈ {0, 1}n is a satisfying assignment for the Boolean formula c1 ∧ . . . ∧ cm if and only if for every positive integer j ≤ m there exists a positive integer i ≤ n such that the literal ¬tixi occurs in the clause cj.
21
SLIDE 22 In the following definitions 1 ≤ j ≤ m, 1 ≤ i ≤ n and t ∈ {0, 1}. G0 ⇌ p0
0\p0 n,
Gj ⇌ (pj
0\Gj−1)·pj n,
H0
i ⇌ p0 i−1\p0 i ,
Hj
i ⇌ pj i−1\(Hj−1 i
·pj
i),
E0
i (t) ⇌ p0 i−1\p0 i ,
Ej
i (t) ⇌
i−1\Ej−1 i
(t))·pj
i
if ¬txi occurs in cj, pj
i−1\(Ej−1 i
(t)·pj
i)
G ⇌ Gm, Hi ⇌ Hm
i ,
Ei(t) ⇌ Em
i (t),
Fi ⇌ (Ei(1)/Hi)·Hi·(Hi\Ei(0)). Example 20. Let n = 2, m = 1, and c1 = x1 ∨ x2. 0, 1 L∗ ⊢ (p1
0\((p0 0\p0 1)·p1 1)) ((p1 1\(p0 1\p0 2))·p1 2) → (p1 0\(p0 0\p0 2))·p1 2,
0, 0 L∗ (p1
0\((p0 0\p0 1)·p1 1)) (p1 1\((p0 1\p0 2)·p1 2)) → (p1 0\(p0 0\p0 2))·p1 2.
The Boolean formula x1 ∨ x2 is true under the assignment 0, 1 and false under the assignment 0, 0.
22
SLIDE 23 p0
2
⊗2 p0
1
p0
1
⊗6 p0 p0 10 p0
2
1 ⊗3 5 ⊗7 9 ⊗11 p1
2
p1
1
p1
1
p1 p1 p1
2
4 8 The extended parse tree, axiom links, and region arcs corresponding to x1 ∨ x2 and the truth assignment 0, 0.
23
SLIDE 24 p0
2
⊗2 p0
1
p0
1
⊗6 p0 p0 10 p0
2
1 ⊗3 5 ⊗7 9 ⊗11 p1
2
p1
1
p1
1
p1 p1 p1
2
4 8 The proof net corresponding to x1 ∨ x2 and the truth assignment 0, 1.
24
SLIDE 25 p0
1
⊗3 p0 p0 9 p0
1
2 ⊗4 8 ⊗10 p1
1
p1 p1 p1
1
1 ⊗5 7 ⊗11 p2
1
p2 p2 p2
1
6 The extended parse tree, axiom links, and region arcs corresponding to x1 ∧ ¬x1 and the truth assignment 0.
25
SLIDE 26 9 The fragments with \ and /
Theorem 5 (Y. Savateev, 2008). The derivability problems for L∗(\, /) and L(\, /) are NP-complete. We shall construct types ˇ G, ˇ Ei(0), ˇ Ei(1) and sequences of types Γi with the following properties.
E1(t1) . . . ˇ En(tn) → ˇ G if and only if t1, . . . , tn ∈ {0, 1}n is a satisfying assignment for the Boolean formula c1 ∧ . . . ∧ cm.
- L∗(\, /) ⊢ Γ1 . . . Γn → ˇ
G if and only if L∗ ⊢ ˇ E1(t1) . . . ˇ En(tn) → ˇ G for some t1, . . . , tn ∈ {0, 1}. We construct these types from pj
i and qj i (where 0 ≤ i ≤ n and 0 ≤ j ≤ m).
26
SLIDE 27 ˇ G0 ⇌ (p0
0\p0 n),
ˇ Gj ⇌ (qj
n/((qj 0\pj 0)\ ˇ
Gj−1))\pj
n,
ˇ C0
i ⇌ p0 i ,
ˇ Cj
i ⇌ (qj i / ˇ
Cj−1
i
)\pj
i,
ˇ E0
i (t) ⇌ p0 i−1,
ˇ Ej
i (t) ⇌
i /(((qj i−1/ ˇ
Ej−1
i
(t))\pj
i−1)\pj−1 i
), if ¬txi occurs in cj, (qj
i−1/(qj i /( ˇ
Ej−1
i
(t)\pj−1
i
)))\pj
i−1,
ˇ Fi(t) ⇌ ( ˇ Em
i (t)\pm i ),
Γi ⇌ ( ˇ Fi(0)/( ˇ Ci−1\ ˇ Ci)) ˇ Fi(0) ( ˇ Fi(0)\ ˇ Fi(1)), ˇ G ⇌ ˇ Gm.
27
SLIDE 28 10 The fragments with · and \
Theorem 6 (Y. Savateev, 2009). The derivability problems for L∗(·, \), L(·, \), L∗(·, /), and L(·, /) are NP-complete. G0
i ⇌ p0 0\p0 i ,
Gj
i ⇌ (pj 0\Gj−1 i
)·pj
i, H0
i ⇌p0 i−1\p0 i ,
Hj
i ⇌pj i−1\(Hj−1 i
·pj
i ),
E0
i (t)⇌p0 i−1\p0 i ,
Ej
i (t)⇌
⎧ ⎨ ⎩ (pj
i−1\Ej−1 i
(t))·pj
i
if ¬txi occurs in cj, pj
i−1\(Ej−1 i
(t)·pj
i )
Hi⇌Hm
i ,
Ei(t)⇌Em
i (t),
˙ F1 ⇌ E1(0)·((E1(0)\E1(1))·(H1\r1)), ˙ Fi ⇌ ((Ei−1(0)\ri−1)\Ei(0))·(Ei(0)\Ei(1))·(Hi\ri) if 2 ≤ i ≤ n, ˙ Fn+1 ⇌ (En(0)\rn)\Hn+1. We can prove that L∗(·, \) ⊢ ˙ F1 . . . ˙ Fn+1 → Gm
n+1 if and only if
L∗(·, \) ⊢ E1(t1) . . . En(tn) → Gm
n for some t1, . . . , tn ∈ {0, 1}.
28
SLIDE 29 11 The fragments with one division
Theorem 7 (Y. Savateev, 2006, 2008). The derivability problems for L∗(\), L(\), L∗(/), and L(/) are decidable in deterministic polynomial time.
- Y. Savateev, The derivability problem for Lambek calculus with one division,
a talk at the International conference “Logical Models of Reasoning and Computation”, May 2008.
29
SLIDE 30 Example 21. L∗ ⊢ (s\p)\t → (r\p)\((s\r)\t).
- (s\p)\t
- \
- (r\p)\((s\r)\t)
- s p t r p s r t
r s s p p r ⊗ t t
p r s t p r t
30
SLIDE 31 Example 22. L∗ (r\p)\((s\r)\t) → (s\p)\t. s r r p s t p t In the derivability criterion for L∗(\), we require the following. (1) For each axiom link, the depth of its left end must be one greater than the depth of its right end. (2) If the right end of an axiom link has depth 2k, where k > 0, and the depth
- f the left predecessor of the left end is greater than 2k, then there must be
a vertex of depth less than 2k between the two ends of the axiom link. In the derivability criterion for L(\), the second condition is made stronger by removing the red words. (2’) If the right end of an axiom link has non-zero even depth, then between the two ends of the axiom link there must be a vertex of smaller depth.
31
SLIDE 32 12 The fragments with one variable
Ak ⇌ A· . . . ·A
Let a sequent contain only the variables q1, . . . , qN−1. We replace qi by pi\p/pN−i, and this does not affect derivability. Recall that (A·B)\C ↔ B\(A\C) and A/(B·C) ↔ (A/C)/B. Example 23. Let N = 3. The substitution maps q1 to (p\p/p)/p and q2 to p\(p\p/p). For example, we have L q1\q2 → q1 and L ((p\p/p)/p)\(p\(p\p/p)) → (p\p/p)/p.
32
SLIDE 33 Let a sequent contain only the variables q1, . . . , qN−1. We replace qi by
\p, and this does not affect derivability. (This substitution was discovered by S. Kuznetsov in 2007.) Example 24. If N = 3, then Kuznetsov’s substitution maps q1 to p\(p\(((p\(p\p))\p)\(p\(p\p)))) and q2 to p\(((p\(p\p))\p)\(p\(p\(p\p)))).
33
SLIDE 34 13 Conclusion
L L∗ L(p1) L∗(p1) ·, \, / NP
2003
NP
2003
NP
2003
NP
2003
·, \ NP
2009
NP
2009
NP
2009
NP
2009
·, / · P P P P \, / NP
2008
NP
2008
NP
2008
NP
2008
\ P
2006
P
2008
P
2006
P
2008
/
34