philippe flajolet & analytic combinatorics: inherent...
TRANSCRIPT
![Page 1: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/1.jpg)
Philippe Flajolet & Analytic Combinatorics:Inherent Ambiguity of Context-Free
Languages
Frederique Bassino and Cyril Nicaud
LIGM, Universite Paris-Est & CNRS
December 16, 2011
![Page 2: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/2.jpg)
I first met Philippe in 1996 (teaching an AofAcourse).
I started my PhD in automata theory and read INRIAresearch reports for a year.
I attended the same course in 1998 !
12πi
∫f (z)zn+1 dz
![Page 3: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/3.jpg)
I first met Philippe in 1996 (teaching an AofAcourse).
I started my PhD in automata theory and read INRIAresearch reports for a year.
I attended the same course in 1998 !
12πi
∫f (z)zn+1 dz
![Page 4: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/4.jpg)
I first met Philippe in 1996 (teaching an AofAcourse).
I started my PhD in automata theory and read INRIAresearch reports for a year.
I attended the same course in 1998 !
12πi
∫f (z)zn+1 dz
![Page 5: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/5.jpg)
I first met Philippe in 1996 (teaching an AofAcourse).
I started my PhD in automata theory and read INRIAresearch reports for a year.
I attended the same course in 1998 !
12πi
∫f (z)zn+1 dz
![Page 6: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/6.jpg)
Philippe Flajolet & Analytic Combinatorics:Inherent Ambiguity of Context-Free
Languages
Frederique Bassino and Cyril Nicaud
LIGM, Universite Paris-Est & CNRS
December 16, 2011
![Page 7: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/7.jpg)
I. Context-free languages
![Page 8: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/8.jpg)
I A word on a (finite) alphabet A = a, b, . . . is a (finite)sequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b.
I The empty word ε is the word with no letter.I A language is a set of words. It can be finite or infinite.
Program for L
u
true false
Interested in languages L such thata machine can decide if u ∈ L :
I Turing machineI Context-free languagesI Regular languagesI . . .
![Page 9: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/9.jpg)
I A word on a (finite) alphabet A = a, b, . . . is a (finite)sequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b.
I The empty word ε is the word with no letter.
I A language is a set of words. It can be finite or infinite.
Program for L
u
true false
Interested in languages L such thata machine can decide if u ∈ L :
I Turing machineI Context-free languagesI Regular languagesI . . .
![Page 10: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/10.jpg)
I A word on a (finite) alphabet A = a, b, . . . is a (finite)sequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b.
I The empty word ε is the word with no letter.I A language is a set of words. It can be finite or infinite.
Program for L
u
true false
Interested in languages L such thata machine can decide if u ∈ L :
I Turing machineI Context-free languagesI Regular languagesI . . .
![Page 11: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/11.jpg)
I A word on a (finite) alphabet A = a, b, . . . is a (finite)sequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b.
I The empty word ε is the word with no letter.I A language is a set of words. It can be finite or infinite.
Program for L
u
true false
Interested in languages L such thata machine can decide if u ∈ L :
I Turing machineI Context-free languagesI Regular languagesI . . .
![Page 12: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/12.jpg)
I A word on a (finite) alphabet A = a, b, . . . is a (finite)sequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b.
I The empty word ε is the word with no letter.I A language is a set of words. It can be finite or infinite.
Program for L
u
true false
Interested in languages L such thata machine can decide if u ∈ L :
I Turing machineI Context-free languagesI Regular languagesI . . .
![Page 13: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/13.jpg)
I A context-free grammar is a formal description of a context-freelanguage. It is made of :
I A finite set V = S,X,Y, . . . of variables.I A finite set A = a, b, c, . . . of terminals.I A starting axiom S ∈ V .I Rules of the form X → w, where X ∈ V and w is a sequence of
symbols of V ∪ A.
I The idea is to produce sequences of terminals only, by startingwith S and by repeatedly applying the rules to the variables.
I Notation : X → aX | XY | YbbY instead ofX → aXX → XYX → YbbY
![Page 14: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/14.jpg)
I A context-free grammar is a formal description of a context-freelanguage. It is made of :
I A finite set V = S,X,Y, . . . of variables.I A finite set A = a, b, c, . . . of terminals.I A starting axiom S ∈ V .I Rules of the form X → w, where X ∈ V and w is a sequence of
symbols of V ∪ A.
I The idea is to produce sequences of terminals only, by startingwith S and by repeatedly applying the rules to the variables.
I Notation : X → aX | XY | YbbY instead ofX → aXX → XYX → YbbY
![Page 15: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/15.jpg)
I A context-free grammar is a formal description of a context-freelanguage. It is made of :
I A finite set V = S,X,Y, . . . of variables.I A finite set A = a, b, c, . . . of terminals.I A starting axiom S ∈ V .I Rules of the form X → w, where X ∈ V and w is a sequence of
symbols of V ∪ A.
I The idea is to produce sequences of terminals only, by startingwith S and by repeatedly applying the rules to the variables.
I Notation : X → aX | XY | YbbY instead ofX → aXX → XYX → YbbY
![Page 16: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/16.jpg)
Example 1
I V = SI A = a, bI S→ aSbS | ε
S → aSbS
aSbS → aSbaSb → aaSbSb
aaSbSb → aabSbaabSb → aabaSbSb
aabaSbSb → aababSbaababSb → aababb
I aababb is in the language generated by the grammar.
![Page 17: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/17.jpg)
Example 1
I V = SI A = a, bI S→ aSbS | ε
S → aSbSaSbS → aSb
aSb → aaSbSbaaSbSb → aabSbaabSb → aabaSbSb
aabaSbSb → aababSbaababSb → aababb
I aababb is in the language generated by the grammar.
![Page 18: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/18.jpg)
Example 1
I V = SI A = a, bI S→ aSbS | ε
S → aSbSaSbS → aSbaSb → aaSbSb
aaSbSb → aabSbaabSb → aabaSbSb
aabaSbSb → aababSbaababSb → aababb
I aababb is in the language generated by the grammar.
![Page 19: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/19.jpg)
Example 1
I V = SI A = a, bI S→ aSbS | ε
S → aSbSaSbS → aSbaSb → aaSbSb
aaSbSb → aabSbaabSb → aabaSbSb
aabaSbSb → aababSbaababSb → aababb
I aababb is in the language generated by the grammar.
![Page 20: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/20.jpg)
Example 1
I V = SI A = a, bI S→ aSbS | ε
S → aSbSaSbS → aSbaSb → aaSbSb
aaSbSb → aabSbaabSb → aabaSbSb
aabaSbSb → aababSbaababSb → aababb
I aababb is in the language generated by the grammar.
![Page 21: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/21.jpg)
I A context-free language is a language generated by acontext-free grammar.
I Examples of context-free languages with A = a, b, c :
L1 = anbmck | n,m, k ≥ 0L2 = anbncm | n,m ≥ 0
I Example of a language that is not context-free :
L3 = anbncn | n ≥ 0
I The set of context-free languages is closed under union,concatenation and Kleene star.
I It is not closed under complementation and intersection.
![Page 22: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/22.jpg)
I A context-free language is a language generated by acontext-free grammar.
I Examples of context-free languages with A = a, b, c :
L1 = anbmck | n,m, k ≥ 0L2 = anbncm | n,m ≥ 0
I Example of a language that is not context-free :
L3 = anbncn | n ≥ 0
I The set of context-free languages is closed under union,concatenation and Kleene star.
I It is not closed under complementation and intersection.
![Page 23: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/23.jpg)
Example 1
I V = SI A = a, bI S→ aSbS | ε
S
a S b S
εa S b S
ε a S b S
ε ε
![Page 24: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/24.jpg)
Example 1
I V = SI A = a, bI S→ aSbS | ε
S
a S b S
ε
a S b S
ε a S b S
ε ε
![Page 25: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/25.jpg)
Example 1
I V = SI A = a, bI S→ aSbS | ε
S
a S b S
εa S b S
ε a S b S
ε ε
![Page 26: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/26.jpg)
Example 1
I V = SI A = a, bI S→ aSbS | ε
S
a S b S
εa S b S
ε
a S b S
ε ε
![Page 27: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/27.jpg)
Example 1
I V = SI A = a, bI S→ aSbS | ε
S
a S b S
εa S b S
ε a S b S
ε ε
![Page 28: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/28.jpg)
Example 1
I V = SI A = a, bI S→ aSbS | ε
S
a S b S
εa S b S
ε a S b S
ε ε
I The derivation tree of aababb.I It is the unique derivation tree for aababb.
![Page 29: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/29.jpg)
Example 2
I V = SI A = aI S→ SS | a
S
S S
S S a
a a
S
S S
SSa
aa
I The word aaa has two derivation trees.I Every binary tree with 2n + 1 nodes produces an+1.
![Page 30: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/30.jpg)
Example 2
I V = SI A = aI S→ SS | a
S
S S
S S a
a a
S
S S
SSa
aa
I The word aaa has two derivation trees.I Every binary tree with 2n + 1 nodes produces an+1.
![Page 31: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/31.jpg)
Example 2
I V = SI A = aI S→ SS | a
S
S S
S S a
a a
S
S S
SSa
aa
I The word aaa has two derivation trees.I Every binary tree with 2n + 1 nodes produces an+1.
![Page 32: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/32.jpg)
Example 2
I V = SI A = aI S→ SS | a
S
S S
S S a
a a
S
S S
SSa
aa
I The word aaa has two derivation trees.I Every binary tree with 2n + 1 nodes produces an+1.
![Page 33: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/33.jpg)
I A grammar is ambiguous if there exists a word with at least twoderivation trees in its generated language.
I A context-free language L is ambiguous (inherently ambiguous)if every grammar that generates L is ambiguous.
I an | n ≥ 1 is generated by S→ SS | a, which is an ambiguousgrammar . . .
I but an | n ≥ 1 is also generated by the non-ambiguousS→ Sa | a, and is therefore a non-ambiguous language.
I Main focus : sufficient conditions that ensure the ambiguity of acontext-free language.
![Page 34: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/34.jpg)
I A grammar is ambiguous if there exists a word with at least twoderivation trees in its generated language.
I A context-free language L is ambiguous (inherently ambiguous)if every grammar that generates L is ambiguous.
I an | n ≥ 1 is generated by S→ SS | a, which is an ambiguousgrammar . . .
I but an | n ≥ 1 is also generated by the non-ambiguousS→ Sa | a, and is therefore a non-ambiguous language.
I Main focus : sufficient conditions that ensure the ambiguity of acontext-free language.
![Page 35: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/35.jpg)
I A grammar is ambiguous if there exists a word with at least twoderivation trees in its generated language.
I A context-free language L is ambiguous (inherently ambiguous)if every grammar that generates L is ambiguous.
I an | n ≥ 1 is generated by S→ SS | a, which is an ambiguousgrammar . . .
I but an | n ≥ 1 is also generated by the non-ambiguousS→ Sa | a, and is therefore a non-ambiguous language.
I Main focus : sufficient conditions that ensure the ambiguity of acontext-free language.
![Page 36: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/36.jpg)
I Do ambiguous context-free languages exist ?
I Yes !anbmck | n = m or m = k
I The original proof is combinatorial, using classical techniques oflanguage theory (pumping lemmas, . . . )
I Is the problem difficult ?I Yes !I Some languages seem to resist (discrete) combinatorial
approachesI The problem is undecidable : there is no algorithm to check
whether a given context-free language is ambiguous.
![Page 37: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/37.jpg)
I Do ambiguous context-free languages exist ?I Yes !
anbmck | n = m or m = k
I The original proof is combinatorial, using classical techniques oflanguage theory (pumping lemmas, . . . )
I Is the problem difficult ?I Yes !I Some languages seem to resist (discrete) combinatorial
approachesI The problem is undecidable : there is no algorithm to check
whether a given context-free language is ambiguous.
![Page 38: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/38.jpg)
I Do ambiguous context-free languages exist ?I Yes !
anbmck | n = m or m = k
I The original proof is combinatorial, using classical techniques oflanguage theory (pumping lemmas, . . . )
I Is the problem difficult ?
I Yes !I Some languages seem to resist (discrete) combinatorial
approachesI The problem is undecidable : there is no algorithm to check
whether a given context-free language is ambiguous.
![Page 39: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/39.jpg)
I Do ambiguous context-free languages exist ?I Yes !
anbmck | n = m or m = k
I The original proof is combinatorial, using classical techniques oflanguage theory (pumping lemmas, . . . )
I Is the problem difficult ?I Yes !I Some languages seem to resist (discrete) combinatorial
approachesI The problem is undecidable : there is no algorithm to check
whether a given context-free language is ambiguous.
![Page 40: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/40.jpg)
II. From languages to functions
![Page 41: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/41.jpg)
I The counting generating function of a language L, is the formalpower series (seen as a function) :
L(z) =∑n≥0
`nzn,
where `n is the number of words of length n in L.I The function is analytic in a neighborhood of the origin : since`n ≤ |A|n, we have
1|A|≤ ρ ≤ 1
I A function is algebraic (over Q) when there exists a polynomialP with coefficients in Q such that P(z,L(z)) = 0. It istranscendental otherwise.
![Page 42: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/42.jpg)
Theorem (Chomsky-Schutzenberger)
The counting generating function of a non-ambiguous context-freelanguage is algebraic over Q.
Proof :S → XYT → aT | TbT | YcYY → YaY | cY | abTaYYa | XX → a | b | c
⇒
s(z) = x(z)y(z)t(z) = zt(z) + zt(z)2 + zy(z)2
y(z) = zy(z)2 + zy(z) + z4t(z)y(z)2 + x(z)x(z) = 3z
Algebraic elimination gives
s(z)8 − 27(z3 − z2) s(z)5 + . . .+ 59049z10 = 0
![Page 43: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/43.jpg)
Theorem (Chomsky-Schutzenberger)
The counting generating function of a non-ambiguous context-freelanguage is algebraic over Q.
Proof :S → XYT → aT | TbT | YcYY → YaY | cY | abTaYYa | XX → a | b | c
⇒
s(z) = x(z)y(z)t(z) = zt(z) + zt(z)2 + zy(z)2
y(z) = zy(z)2 + zy(z) + z4t(z)y(z)2 + x(z)x(z) = 3z
Algebraic elimination gives
s(z)8 − 27(z3 − z2) s(z)5 + . . .+ 59049z10 = 0
![Page 44: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/44.jpg)
Theorem (Chomsky-Schutzenberger)
The counting generating function of a non-ambiguous context-freelanguage is algebraic over Q.
Proof :S → XYT → aT | TbT | YcYY → YaY | cY | abTaYYa | XX → a | b | c
⇒
s(z) = x(z)y(z)t(z) = zt(z) + zt(z)2 + zy(z)2
y(z) = zy(z)2 + zy(z) + z4t(z)y(z)2 + x(z)x(z) = 3z
Algebraic elimination gives
s(z)8 − 27(z3 − z2) s(z)5 + . . .+ 59049z10 = 0
![Page 45: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/45.jpg)
Theorem (Chomsky-Schutzenberger)
The counting generating function of a non-ambiguous context-freelanguage is algebraic over Q.
Corollary
If the counting generating function is transcendental over Q, then thelanguage is ambiguous.
![Page 46: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/46.jpg)
Theorem (Chomsky-Schutzenberger)
The counting generating function of a non-ambiguous context-freelanguage is algebraic over Q.
Corollary
If the counting generating function is transcendental over Q, then thelanguage is ambiguous.
![Page 47: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/47.jpg)
III. Transcendence
![Page 48: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/48.jpg)
Transcendental numbers
I A number α is algebraic when there exists a polynomial P ofQ[X] such that P(α) = 0.
I√
2 is algebraic, since it is a root of X2 − 2.I A number is transcendental when it is not algebraic.
I e is transcendental [Hermite 1873]I π is transcendental [von Lindemann 1882]I ab is always transcendental for algebraic a /∈ 0, 1 and
irrational algebraic b [Gelfond 1934] [Schneider 1935] (Hilbert’sseventh problem).
I not known : e + π, ee, eπ, γ, . . .
![Page 49: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/49.jpg)
Transcendental functions
I It is usually easier to establish the transcendence of a function.
I Algebraic functions have some typical properties.
I Philippe gave several criteria to establish transcendence, usingthis properties.
I We shall see two of them in this talk.
![Page 50: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/50.jpg)
TheoremAn algebraic function L(z) over Q as finitely many singularities,which are algebraic numbers.
Criterion 1A function having infinitely many singularities is transcendental.
![Page 51: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/51.jpg)
Theorem (Puiseux+Transfert)
If L(z) is an algebraic function over Q then
`n ∼βnns
Γ(s + 1)
m∑i=0
Ciωni ,
where s ∈ Q \ −1,−2, . . ., β > 0 is algebraic, the Ci and ωi arealgebraic, with |ωi| = 1.
Criterion 2If the asymptotic of `n is of the form
`n ∼ αβn ns,
with s /∈ Q \ −1,−2, . . ., then the language is ambiguous.
![Page 52: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/52.jpg)
IV. Ambiguous languages
![Page 53: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/53.jpg)
Goldstine language
I Initial motivation for Philippe’s paper.I G = an1ban2b . . . anpb | p ≥ 1, ∃i, ni 6= iI abaabaaab /∈ G but abaabaabb ∈ G
I A∗ \ G = I ∪ J, with
I = ua | u ∈ A∗J = ε ∪ a1ba2b . . . apb | p ≥ 1
I We obtain, using |a1ba2b . . . apb| = n(n+1)2 − 1, that
g(z) =1− z1− 2z
−∑n≥1
zn(n+1)/2−1
![Page 54: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/54.jpg)
Goldstine language
I Initial motivation for Philippe’s paper.I G = an1ban2b . . . anpb | p ≥ 1, ∃i, ni 6= iI abaabaaab /∈ G but abaabaabb ∈ G
I A∗ \ G = I ∪ J, with
I = ua | u ∈ A∗J = ε ∪ a1ba2b . . . apb | p ≥ 1
I We obtain, using |a1ba2b . . . apb| = n(n+1)2 − 1, that
g(z) =1− z1− 2z
−∑n≥1
zn(n+1)/2−1
![Page 55: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/55.jpg)
Lacunary functions
I A lacunary function is an analytic function that cannot beanalytically continued anywhere outside its circle ofconvergence.
I f (z) =∑
n≥0 fλnzλn , with fλn 6= 0I Sufficient conditions :
Iλn+1−λn
λn→∞ [Hadamard 1892]
Iλn+1−λn√
λn→∞ [Borel 1896]
I λn+1 − λn →∞ [Fabry 1896]I λn/n→∞ [Faber 1904]
I A lacunary function is transcendental (Criterion 1)
![Page 56: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/56.jpg)
Goldstine language
I G = an1ban2b . . . anpb | p ≥ 1, ∃i, ni 6= iI We obtained that
g(z) =1− z1− 2z
−∑n≥1
zn(n+1)/2−1
I∑
n≥1 zn(n+1)/2−1 is a lacunary function, hence g(z) istranscendental.
Theorem (Flajolet)
The Goldstine language is ambiguous.
![Page 57: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/57.jpg)
Another example
I Let Ω3 be the context free language defined by
Ω3 = u ∈ a, b, c∗ | |u|a 6= |u|b or |u|a 6= |u|c
I Its complementary is
I = A∗ \ Ω3 = u ∈ a, b, c∗ | |u|a = |u|b = |u|c
I Its counting generating function O(z) satisfies
O3(z) +∑n≥0
(3n
n, n, n
)z3n =
11− 3z
![Page 58: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/58.jpg)
Another example
I Let Ω3 be the context free language defined by
Ω3 = u ∈ a, b, c∗ | |u|a 6= |u|b or |u|a 6= |u|c
I Its complementary is
I = A∗ \ Ω3 = u ∈ a, b, c∗ | |u|a = |u|b = |u|c
I Its counting generating function O(z) satisfies
O3(z) +∑n≥0
(3n
n, n, n
)z3n =
11− 3z
![Page 59: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/59.jpg)
Another example
I Let Ω3 be the context free language defined by
Ω3 = u ∈ a, b, c∗ | |u|a 6= |u|b or |u|a 6= |u|c
I Its complementary is
I = A∗ \ Ω3 = u ∈ a, b, c∗ | |u|a = |u|b = |u|c
I Its counting generating function O(z) satisfies
O3(z) +∑n≥0
(3n
n, n, n
)z3n =
11− 3z
![Page 60: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/60.jpg)
I But using Stirling formula(3n
n, n, n
)∼√
32π· 27n · n−1
Criterion 2If the asymptotic of `n is of the form
`n ∼ αβn ns,
with s /∈ Q \ −1,−2, . . ., then the language is ambiguous.
TheoremThe language Ω3 is ambiguous.
![Page 61: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/61.jpg)
Conclusion
I Need the counting generating function in some wayI Need to fulfill a criterion
I Solving computer science problems using analysisI Solving discrete problems using continuous mathematics
I Beautiful ideasI Exciting mathematicsI Simple proofs (relying on complicated earlier results)
I Analytic combinatorics for something else than asymptoticresults.
![Page 62: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/62.jpg)
Conclusion
I Need the counting generating function in some wayI Need to fulfill a criterion
I Solving computer science problems using analysisI Solving discrete problems using continuous mathematics
I Beautiful ideasI Exciting mathematicsI Simple proofs (relying on complicated earlier results)
I Analytic combinatorics for something else than asymptoticresults.
![Page 63: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/63.jpg)
Conclusion
I Need the counting generating function in some wayI Need to fulfill a criterion
I Solving computer science problems using analysisI Solving discrete problems using continuous mathematics
I Beautiful ideasI Exciting mathematicsI Simple proofs (relying on complicated earlier results)
I Analytic combinatorics for something else than asymptoticresults.
![Page 64: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/64.jpg)
Conclusion
I Need the counting generating function in some wayI Need to fulfill a criterion
I Solving computer science problems using analysisI Solving discrete problems using continuous mathematics
I Beautiful ideasI Exciting mathematicsI Simple proofs (relying on complicated earlier results)
I Analytic combinatorics for something else than asymptoticresults.
![Page 65: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/65.jpg)
I’m trying to get a unambiguousgrammar that generates this contextfree language.
You can’t, it’s inherentlyambiguous !
Why ?
Because π is a transcendentalnumber.
That’s why we are doing research !
![Page 66: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/66.jpg)
I’m trying to get a unambiguousgrammar that generates this contextfree language.
You can’t, it’s inherentlyambiguous !
Why ?
Because π is a transcendentalnumber.
That’s why we are doing research !
![Page 67: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/67.jpg)
I’m trying to get a unambiguousgrammar that generates this contextfree language.
You can’t, it’s inherentlyambiguous !
Why ?
Because π is a transcendentalnumber.
That’s why we are doing research !
![Page 68: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/68.jpg)
I’m trying to get a unambiguousgrammar that generates this contextfree language.
You can’t, it’s inherentlyambiguous !
Why ?
Because π is a transcendentalnumber.
That’s why we are doing research !
![Page 69: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/69.jpg)
I’m trying to get a unambiguousgrammar that generates this contextfree language.
You can’t, it’s inherentlyambiguous !
Why ?
Because π is a transcendentalnumber.
That’s why we are doing research !
![Page 70: Philippe Flajolet & Analytic Combinatorics: Inherent …algo.inria.fr/pfac/PFAC/Program_files/nicaud.pdfsequence of letters : u = aaba, v = bcbaa, w = aaaaab = a5b. I Theempty word](https://reader030.vdocuments.pub/reader030/viewer/2022040415/5f2a25baa37f5b7c0d44b7ec/html5/thumbnails/70.jpg)
I’m trying to get a unambiguousgrammar that generates this contextfree language.
You can’t, it’s inherentlyambiguous !
Why ?
Because π is a transcendentalnumber.
That’s why we are doing research !