Download - Handbook of Formal Languages Vol. 1-3digitale-objekte.hbz-nrw.de/storage/2006/07/07/file_110/1472075.pdf · x Contents 5. Complexityissues..... 96 5.1 Statecomplexityissues..... 96

Transcript
Page 1: Handbook of Formal Languages Vol. 1-3digitale-objekte.hbz-nrw.de/storage/2006/07/07/file_110/1472075.pdf · x Contents 5. Complexityissues..... 96 5.1 Statecomplexityissues..... 96

Contents of Volume 1

Chapter 1. Formal Languages: an Introduction and a SynopsisAlexandru Mateescu and Arto Salomaa . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11. Languages, formal and natural . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

1.1 Historical linguistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.2 Language and evolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71.3 Language and neural structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

2. Glimpses of mathematical language theory . . . . . . . . . . . . . . . . . . . . . . 92.1 Words and languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102.2 About commuting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122.3 About stars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152.4 Avoiding scattered subwords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192.5 About scattered residuals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

3. Formal languages: a telegraphic survey . . . . . . . . . . . . . . . . . . . . . . . . . 273.1 Language and grammar. Chomsky hierarchy . . . . . . . . . . . . . . . . . 273.2 Regular and context-free languages . . . . . . . . . . . . . . . . . . . . . . . . . 313.3 L Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333.4 More powerful grammars and grammar systems . . . . . . . . . . . . . . 353.5 Books on formal languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

Chapter 2. Regular LanguagesSheng Yu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411. Preliminaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432. Finite automata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

2.1 Deterministic finite automata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452.2 Nondeterministic finite automata . . . . . . . . . . . . . . . . . . . . . . . . . . 492.3 Alternating finite automata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 542.4 Finite automata with output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

3. Regular expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 703.1 Regular expressions – the definition . . . . . . . . . . . . . . . . . . . . . . . . 703.2 Regular expressions to finite automata . . . . . . . . . . . . . . . . . . . . . . 713.3 Finite automata to regular expressions . . . . . . . . . . . . . . . . . . . . . . 743.4 Star height and extended regular expressions . . . . . . . . . . . . . . . . 773.5 Regular expressions for regular languages of polynomial density 80

4. Properties of regular languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 824.1 Four pumping lemmas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 824.2 Closure properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 884.3 Derivatives and the Myhill-Nerode theorem . . . . . . . . . . . . . . . . . 92

Page 2: Handbook of Formal Languages Vol. 1-3digitale-objekte.hbz-nrw.de/storage/2006/07/07/file_110/1472075.pdf · x Contents 5. Complexityissues..... 96 5.1 Statecomplexityissues..... 96

x Contents

5. Complexity issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 965.1 State complexity issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 965.2 Time and space complexity issues . . . . . . . . . . . . . . . . . . . . . . . . . . 102

References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105

Chapter 3. Context-Free Languages and Pushdown AutomataJean-Michel Autebert, Jean Berstel, and Luc Boasson . . . . . . . . . . . . . . . 1111. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111

1.1 Grammars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1121.2 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113

2. Systems of equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1142.1 Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1152.2 Resolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1202.3 Linear systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1212.4 Parikh’s theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123

3. Normal forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1243.1 Chomsky normal form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1243.2 Greibach normal forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1253.3 Operator normal form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133

4. Applications of the Greibach normal form . . . . . . . . . . . . . . . . . . . . . . . 1344.1 Shamir’s theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1344.2 Chomsky-Schutzenberger’s theorem . . . . . . . . . . . . . . . . . . . . . . . . 1354.3 The hardest context-free language . . . . . . . . . . . . . . . . . . . . . . . . . . 1364.4 Wechler’s theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138

5. Pushdown machines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1385.1 Pushdown automata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1385.2 Deterministic pda . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1445.3 Pushdown store languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1515.4 Pushdown transducers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154

6. Subfamilies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1566.1 Linear languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1566.2 Quasi-rational languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1606.3 Strong quasi-rational languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1636.4 Finite-turn languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1646.5 Counter languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1656.6 Parenthetic languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1676.7 Simple languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1696.8 LL and LR languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170

References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172

Chapter 4. Aspects of Classical Language TheoryAlexandru Mateescu and Arto Salomaa . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1751. Phrase-structure grammars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175

1.1 Phrase-structure grammars and Turing machines . . . . . . . . . . . . . 1761.2 Normal forms for phrase-structure grammars . . . . . . . . . . . . . . . . 180

Page 3: Handbook of Formal Languages Vol. 1-3digitale-objekte.hbz-nrw.de/storage/2006/07/07/file_110/1472075.pdf · x Contents 5. Complexityissues..... 96 5.1 Statecomplexityissues..... 96

Contents xi

1.3 Representations of recursively enumerable languages . . . . . . . . . . 1801.4 Decidability. Recursive languages . . . . . . . . . . . . . . . . . . . . . . . . . . 184

2. Context-sensitive grammars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1862.1 Context-sensitive and monotonous grammars . . . . . . . . . . . . . . . . 1862.2 Normal forms for context-sensitive grammars . . . . . . . . . . . . . . . . 1902.3 Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1912.4 Linear bounded automata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1922.5 Closure properties of the family CS . . . . . . . . . . . . . . . . . . . . . . . . 1942.6 Decidable properties of the family CS . . . . . . . . . . . . . . . . . . . . . . . 1962.7 On some restrictions on grammars . . . . . . . . . . . . . . . . . . . . . . . . . 197

3. AFL-theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1993.1 Language families. Cones and AFL’s . . . . . . . . . . . . . . . . . . . . . . . 1993.2 First transductions, then regular operations . . . . . . . . . . . . . . . . . 204

4. Wijngaarden (two-level) grammars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2104.1 Definitions, examples. The generative power . . . . . . . . . . . . . . . . . 2104.2 Membership problem and parsing . . . . . . . . . . . . . . . . . . . . . . . . . . 2144.3 W-grammars and complexity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218

5. Attribute grammars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2215.1 Definitions and terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2215.2 Algorithms for testing the circularity . . . . . . . . . . . . . . . . . . . . . . . 2225.3 Restricted attribute grammars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2265.4 Other results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229

6. Patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2306.1 Erasing and nonerasing patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . 2306.2 The equivalence problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2326.3 The inclusion problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2346.4 The membership problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2386.5 Ambiguity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2386.6 Multi-pattern languages. Term rewriting with patterns . . . . . . . . 241

7. Pure and indexed grammars. Derivation languages . . . . . . . . . . . . . . . 2427.1 Pure grammars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2427.2 Indexed grammars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2437.3 The derivation (Szilard) language . . . . . . . . . . . . . . . . . . . . . . . . . . 245

References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246

Chapter 5. L SystemsLila Kari, Grzegorz Rozenberg, and Arto Salomaa . . . . . . . . . . . . . . . . . . . 2531. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253

1.1 Parallel rewriting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2531.2 Callithamnion roseum, a primordial alga . . . . . . . . . . . . . . . . . . . . 2541.3 Life, real and artificial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256

2. The world of L, an overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2572.1 Iterated morphisms and finite substitutions: D0L and 0L . . . . . . 2572.2 Auxiliary letters and other auxiliary modifications . . . . . . . . . . . 2642.3 Tables, interactions, adults, fragmentation . . . . . . . . . . . . . . . . . . 268

Page 4: Handbook of Formal Languages Vol. 1-3digitale-objekte.hbz-nrw.de/storage/2006/07/07/file_110/1472075.pdf · x Contents 5. Complexityissues..... 96 5.1 Statecomplexityissues..... 96

xii Contents

3. Sample L techniques: avoiding cell death if possible . . . . . . . . . . . . . . 2754. L decisions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281

4.1 General. Sequences versus languages . . . . . . . . . . . . . . . . . . . . . . . . 2814.2 D0L sequence equivalence problem and variations . . . . . . . . . . . . 285

5. L Growth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2885.1 Communication and commutativity . . . . . . . . . . . . . . . . . . . . . . . . 2885.2 Merging and stages of death . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2945.3 Stagnation and malignancy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298

6. L codes, number systems, immigration . . . . . . . . . . . . . . . . . . . . . . . . . . 3016.1 Morphisms applied in the way of a fugue . . . . . . . . . . . . . . . . . . . . 3016.2 An excursion into number systems . . . . . . . . . . . . . . . . . . . . . . . . . 3056.3 Bounded delay and immigration . . . . . . . . . . . . . . . . . . . . . . . . . . . 308

7. Parallel insertions and deletions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3128. Scattered views from the L path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324

Chapter 6. Combinatorics of WordsChristian Choffrut and Juhani Karhumaki . . . . . . . . . . . . . . . . . . . . . . . . . 3291. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3292. Preliminaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331

2.1 Words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3322.2 Periods in words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3342.3 Repetitions in words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3372.4 Morphisms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3382.5 Finite sets of words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339

3. Selected examples of problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3423.1 Injective mappings between F -semigroups . . . . . . . . . . . . . . . . . . . 3423.2 Binary equality sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3473.3 Separating words via automata . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351

4. Defect effect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3544.1 Basic definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3544.2 Defect theorems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3574.3 Defect effect of several relations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3604.4 Relations without the defect effect . . . . . . . . . . . . . . . . . . . . . . . . . 3644.5 The defect theorem for equations . . . . . . . . . . . . . . . . . . . . . . . . . . 3664.6 Properties of the combinatorial rank . . . . . . . . . . . . . . . . . . . . . . . . 367

5. Equations as properties of words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3705.1 Makanin’s result . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3705.2 The rank of an equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3715.3 The existential theory of concatenation . . . . . . . . . . . . . . . . . . . . . 3725.4 Some rules of thumb for solving equations by “hand” . . . . . . . . . 374

6. Periodicity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3766.1 Definitions and basic observations . . . . . . . . . . . . . . . . . . . . . . . . . . 3766.2 The periodicity theorem of Fine and Wilf . . . . . . . . . . . . . . . . . . . 377

Page 5: Handbook of Formal Languages Vol. 1-3digitale-objekte.hbz-nrw.de/storage/2006/07/07/file_110/1472075.pdf · x Contents 5. Complexityissues..... 96 5.1 Statecomplexityissues..... 96

Contents xiii

6.3 The Critical Factorization Theorem . . . . . . . . . . . . . . . . . . . . . . . . 3806.4 A characterization of ultimately periodic words . . . . . . . . . . . . . . 385

7. Finiteness conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3897.1 Orders and quasi-orderings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3907.2 Orderings on words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3917.3 Subwords of a given word . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3947.4 Partial orderings and an unavoidability . . . . . . . . . . . . . . . . . . . . . 3957.5 Basics on the relation quasi-ordering �r . . . . . . . . . . . . . . . . . . . . 3987.6 A compactness property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4007.7 The size of an equivalent subsystem . . . . . . . . . . . . . . . . . . . . . . . . 4047.8 A finiteness condition for finite sets of words . . . . . . . . . . . . . . . . 405

8. Avoidability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4088.1 Prelude . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4088.2 The basic techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4098.3 Repetition-free morphisms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4158.4 The number of repetition-free words . . . . . . . . . . . . . . . . . . . . . . . . 4168.5 Characterizations of binary 2+-free words . . . . . . . . . . . . . . . . . . . 4188.6 Avoidable patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422

9. Subword complexity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4239.1 Examples and basic properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4239.2 A classification of complexities of fixed points of iterated

morphisms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431

Chapter 7. MorphismsTero Harju and Juhani Karhumaki . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4391. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4392. Preliminaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441

2.1 Words and morphisms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4412.2 Rational transductions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4422.3 Word problem for finitely presented semigroups . . . . . . . . . . . . . . 4432.4 Semi-Thue systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445

3. Post correspondence problem: decidable cases . . . . . . . . . . . . . . . . . . . . 4463.1 Basic decidable cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4463.2 Generalized post correspondence problem . . . . . . . . . . . . . . . . . . . 4493.3 (G)PCP in the binary case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451

4. Undecidability of PCP with applications . . . . . . . . . . . . . . . . . . . . . . . . 4564.1 PCP(9) is undecidable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4564.2 A mixed modification of PCP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4604.3 Common relations in submonoids . . . . . . . . . . . . . . . . . . . . . . . . . . 4614.4 Mortality of matrix monoids . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4634.5 Zeros in upper corners . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 466

5. Equality sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4685.1 Basic properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4685.2 Some restricted cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470

Page 6: Handbook of Formal Languages Vol. 1-3digitale-objekte.hbz-nrw.de/storage/2006/07/07/file_110/1472075.pdf · x Contents 5. Complexityissues..... 96 5.1 Statecomplexityissues..... 96

xiv Contents

5.3 On the regularity of equality sets . . . . . . . . . . . . . . . . . . . . . . . . . . 4715.4 An effective construction of regular equality sets . . . . . . . . . . . . . 474

6. Ehrenfeucht’s Conjecture and systems of equations . . . . . . . . . . . . . . . 4776.1 Systems of equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4786.2 Ehrenfeucht’s Conjecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4786.3 Equations with constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4836.4 On generalizations of Ehrenfeucht’s Conjecture . . . . . . . . . . . . . . 4846.5 Ehrenfeucht’s Conjecture for more general mappings . . . . . . . . . 486

7. Effective subcases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4877.1 Finite systems of equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4877.2 The effectiveness of test sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4887.3 Applications to problems of iterated morphisms . . . . . . . . . . . . . . 490

8. Morphic representations of languages . . . . . . . . . . . . . . . . . . . . . . . . . . . 4928.1 Classical results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4928.2 Representations of recursively enumerable languages . . . . . . . . . . 4938.3 Representations of regular languages . . . . . . . . . . . . . . . . . . . . . . . 4968.4 Representations of rational transductions . . . . . . . . . . . . . . . . . . . 498

9. Equivalence problem on languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5009.1 Morphic equivalence on languages . . . . . . . . . . . . . . . . . . . . . . . . . . 5019.2 More general mappings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 502

10. Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505

Chapter 8. CodesHelmut Jurgensen and Stavros Konstantinidis . . . . . . . . . . . . . . . . . . . . . . 5111. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5112. Notation and basic notions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5163. Channels and codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5224. Error correction, synchronization, decoding . . . . . . . . . . . . . . . . . . . . . . 5305. Homophonic codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5416. Methods for defining codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5457. A hierarchy of classes of codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5588. The syntactic monoid of a code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5679. Deciding properties of codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57510. Maximal codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58211. Solid codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58512. Codes for noisy channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59513. Concluding remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 600References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 600

Chapter 9. Semirings and Formal Power SeriesWerner Kuich . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6091. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6092. Semirings, formal power series and matrices . . . . . . . . . . . . . . . . . . . . . 6103. Algebraic systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 619

Page 7: Handbook of Formal Languages Vol. 1-3digitale-objekte.hbz-nrw.de/storage/2006/07/07/file_110/1472075.pdf · x Contents 5. Complexityissues..... 96 5.1 Statecomplexityissues..... 96

Contents xv

4. Automata and linear systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6265. Normal forms for algebraic systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6316. Pushdown automata and algebraic systems . . . . . . . . . . . . . . . . . . . . . . 6377. Transductions and abstract families of elements . . . . . . . . . . . . . . . . . . 6448. The Theorem of Parikh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6589. Lindenmayerian algebraic power series . . . . . . . . . . . . . . . . . . . . . . . . . . 66210. Selected topics and bibliographical remarks . . . . . . . . . . . . . . . . . . . . . . 667References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 671

Chapter 10. Syntactic SemigroupsJean-Eric Pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6791. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6792. Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 681

2.1 Relations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6812.2 Semigroups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6812.3 Morphisms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6822.4 Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6832.5 Free semigroups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6842.6 Order ideals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6842.7 Idempotents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6852.8 Green’s relations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6852.9 Categories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 686

3. Recognizability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6873.1 Recognition by ordered semigroups . . . . . . . . . . . . . . . . . . . . . . . . . 6873.2 Syntactic order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6883.3 Recognizable sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6893.4 How to compute the syntactic semigroup? . . . . . . . . . . . . . . . . . . . 691

4. Varieties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6924.1 Identities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6924.2 The variety theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695

5. Examples of varieties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6975.1 Standard examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6985.2 Commutative varieties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6995.3 Varieties defined by local properties . . . . . . . . . . . . . . . . . . . . . . . . 7015.4 Algorithmic problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 705

6. Some algebraic tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7056.1 Relational morphisms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7066.2 Mal’cev product . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7086.3 Semidirect product . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7086.4 Representable transductions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 712

7. The concatenation product . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7167.1 Polynomial closure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7167.2 Unambiguous and deterministic polynomial closure . . . . . . . . . . . 7177.3 Varieties closed under product . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7187.4 The operations L → LaA∗ and L → A∗aL . . . . . . . . . . . . . . . . . . 719

Page 8: Handbook of Formal Languages Vol. 1-3digitale-objekte.hbz-nrw.de/storage/2006/07/07/file_110/1472075.pdf · x Contents 5. Complexityissues..... 96 5.1 Statecomplexityissues..... 96

xvi Contents

7.5 Product with counters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7207.6 Varieties closed under product with counter . . . . . . . . . . . . . . . . . 721

8. Concatenation hierarchies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7228.1 Straubing-Therien’s hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7238.2 Dot-depth hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7278.3 The group hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7288.4 Subhierarchies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7308.5 Boolean-polynomial closure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 731

9. Codes and varieties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73310. Operators on languages and varieties . . . . . . . . . . . . . . . . . . . . . . . . . . . 73511. Further topics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 736References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 738

Chapter 11. Regularity and Finiteness ConditionsAldo de Luca and Stefano Varricchio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7471. Combinatorics on words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 749

1.1 Infinite words and unavoidable regularities . . . . . . . . . . . . . . . . . . 7491.2 The Ramsey theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7511.3 The van der Waerden theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7531.4 The Shirshov theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7541.5 Uniformly recurrent words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7561.6 Some extensions of the Shirshov theorem . . . . . . . . . . . . . . . . . . . . 759

2. Finiteness conditions for semigroups . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7642.1 The Burnside problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7642.2 Permutation property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7672.3 Chain conditions and J-depth decomposition . . . . . . . . . . . . . . . 7712.4 Iteration property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7752.5 Repetitive morphisms and semigroups . . . . . . . . . . . . . . . . . . . . . . 779

3. Finitely recognizable semigroups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7823.1 The factor semigroup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7833.2 On a conjecture of Brzozowski . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7853.3 Problems and results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 786

4. Non-uniform regularity conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7894.1 Pumping properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7904.2 Permutative property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 792

5. Well quasi-orders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7955.1 The generalized Myhill-Nerode Theorem . . . . . . . . . . . . . . . . . . . . 7965.2 Quasi-orders and rewriting systems . . . . . . . . . . . . . . . . . . . . . . . . . 7985.3 A regularity condition for permutable languages . . . . . . . . . . . . . 8005.4 A regularity condition for almost-commutative languages . . . . . . 803

References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 806

Page 9: Handbook of Formal Languages Vol. 1-3digitale-objekte.hbz-nrw.de/storage/2006/07/07/file_110/1472075.pdf · x Contents 5. Complexityissues..... 96 5.1 Statecomplexityissues..... 96

Contents xvii

Chapter 12. Families Generated by Grammars and L SystemsGheorghe Paun and Arto Salomaa . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8111. Grammar forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 811

1.1 Introduction: structural similarity . . . . . . . . . . . . . . . . . . . . . . . . . . 8111.2 Interpretations and grammatical families . . . . . . . . . . . . . . . . . . . . 8131.3 Closure properties and normal forms . . . . . . . . . . . . . . . . . . . . . . . 8181.4 Completeness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8211.5 Linguistical families and undecidability . . . . . . . . . . . . . . . . . . . . . 825

2. L forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8292.1 E0L and ET0L forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8292.2 Good and very complete forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8342.3 PD0L forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 835

3. Density . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8383.1 Dense hierarchies of grammatical families . . . . . . . . . . . . . . . . . . . 8383.2 Color families of graphs and language interpretations . . . . . . . . . 8433.3 Maximal dense intervals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 847

4. Extensions and variations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8514.1 Context-dependent grammar and L forms . . . . . . . . . . . . . . . . . . . 8514.2 Matrix forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8534.3 Further variants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 856

References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 859

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 863

Page 10: Handbook of Formal Languages Vol. 1-3digitale-objekte.hbz-nrw.de/storage/2006/07/07/file_110/1472075.pdf · x Contents 5. Complexityissues..... 96 5.1 Statecomplexityissues..... 96

Authors’ Addresses

Jean-Michel AutebertUFR d’Informatique, Universite Denis Diderot-Paris 72, place Jussieu, F-75005 Paris, Cedex 05, [email protected]

Jean BerstelLITP, IBP, Universite Pierre et Marie CurieLaboratoire LITP, Institut Blaise Pascal4, place Jussieu, F-75252 Paris, Cedex 05, [email protected]

Luc BoassonLITP, IBP, Universite Denis Diderot2, place Jussieu, F-75251 Paris Cedex 05, [email protected]

Christian ChoffrutLITP, Universite de Paris VI4, place Jussieu, F-75252 Paris Cedex 05, [email protected]

Tero HarjuDepartment of Mathematics, University of TurkuFIN-20014 Turku, [email protected]

Helmut JurgensenDepartment of Computer Science, The University of Western OntarioLondon, Ontario N6A 5B7, [email protected] Institut fur Informatik, Universitat PotsdamAm Neuen Palais 10, D-14469 Potsdam, [email protected]

Juhani KarhumakiDepartment of Mathematics, University of TurkuFIN-20014 Turku, [email protected]

Lila KariDepartment of Computer Science, University of Western OntarioLondon, Ontario N6A 5B7, [email protected]

Page 11: Handbook of Formal Languages Vol. 1-3digitale-objekte.hbz-nrw.de/storage/2006/07/07/file_110/1472075.pdf · x Contents 5. Complexityissues..... 96 5.1 Statecomplexityissues..... 96

xxiv Authors’ Addresses

Stavros KonstantinidisDepartment of Mathematics and Computer Science, University of Lethbridge4401 University Drive, Lethbridge, Alberta T1K 3M4 [email protected]

Werner KuichAbteilung fur Theoretische Informatik, Institut fur Algebraund Diskrete Mathematik, Technische Universitat WienWiedner Hauptstrasse 8-10, A-1040 Wien, [email protected]

Aldo de LucaDipartimento di Matematica, Universita di Roma “La Sapienza”Piazzale Aldo Moro 2, I-00185 Roma, [email protected]

Alexandru MateescuFaculty of Mathematics, University of BucharestAcademiei 14, RO-70109 Bucharest, Romaniaand Turku Centre for Computer Science (TUCS)Lemninkaisenkatu 14 A, FIN-20520 Turku, [email protected]

Gheorghe PaunInstitute of Mathematics of the Romanian AcademyP.O. Box 1-764, RO-70700 Bucharest, [email protected]

Jean-Eric PinLITP, IBP, CNRS, Universite Paris VI4, place Jussieu, F-75252 Paris Cedex 05, [email protected]

Grzegorz RozenbergDepartment of Computer Science, Leiden UniversityP.O. Box 9512, NL-2300 RA Leiden, The Netherlandsand Department of Computer ScienceUniversity of Colorado at Boulder, Campus 430Boulder, CO 80309, [email protected]

Arto SalomaaAcademy of Finland and Turku Centre for Computer Science (TUCS)Lemninkaisenkatu 14 A, FIN-20520 Turku, [email protected]

Stefano VarricchioDipartimento di Matematica, Universita di L’AquilaVia Vetoio Loc. Coppito, I-67100 L’Aquila, [email protected]

Sheng YuDepartment of Computer Science, University of Western OntarioLondon, Ontario N6A 5B7, [email protected]

Page 12: Handbook of Formal Languages Vol. 1-3digitale-objekte.hbz-nrw.de/storage/2006/07/07/file_110/1472075.pdf · x Contents 5. Complexityissues..... 96 5.1 Statecomplexityissues..... 96

Contents of Volume 2

Chapter 1. Complexity: A Language-Theoretic Point of ViewCristian Calude and Juraj Hromkovic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12. Theory of computation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2.1 Computing fallibilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32.2 Turing machines, Chaitin computers, and Chomsky grammars . 72.3 Universality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82.4 Silencing a universal computer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.5 Digression: A simple grammatical model of brain behaviour . . . 122.6 The halting problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132.7 The Church–Turing Thesis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142.8 Digression: mind, brain, and computers . . . . . . . . . . . . . . . . . . . . . 15

3. Computational complexity measures and complexity classes . . . . . . . 163.1 Time and space complexities and their properties . . . . . . . . . . . . 163.2 Classification of problems according to computational difficulty

and nondeterminism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253.3 Hard problems and probabilistic computations . . . . . . . . . . . . . . . 31

4. Program-size complexity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364.1 Dynamic versus program-size complexities . . . . . . . . . . . . . . . . . . 364.2 The halting problem revisited . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384.3 Random strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394.4 From random to regular languages . . . . . . . . . . . . . . . . . . . . . . . . . 414.5 Trade-offs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454.6 More about P =?NP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

5. Parallelism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475.1 Parallel computation thesis and alternation . . . . . . . . . . . . . . . . . 475.2 Limits to parallel computation and P -completeness . . . . . . . . . . . 515.3 Communication in parallel and distributive computing . . . . . . . . 52

References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

Chapter 2. Parsing of Context-Free LanguagesKlaas Sikkel and Anton Nijholt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 611. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

1.1 Parsing algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 621.2 Parsing technology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 631.3 About this chapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64

2. An informal introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

Page 13: Handbook of Formal Languages Vol. 1-3digitale-objekte.hbz-nrw.de/storage/2006/07/07/file_110/1472075.pdf · x Contents 5. Complexityissues..... 96 5.1 Statecomplexityissues..... 96

x Contents

3. Parsing schemata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 703.1 Parsing systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 703.2 Parsing schemata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 713.3 Correctness of parsing schemata . . . . . . . . . . . . . . . . . . . . . . . . . . . 72

4. Generalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 744.1 Some examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 744.2 Formalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 754.3 Properties of generalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77

5. Filtering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 795.1 Static filtering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 795.2 Dynamic filtering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 805.3 Step contraction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 825.4 Properties of filtering relations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83

6. Some larger examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 836.1 Left-corner parsing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 846.2 De Vreught and Honig’s algorithm . . . . . . . . . . . . . . . . . . . . . . . . . 866.3 Rytter’s algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 906.4 Some general remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92

7. From schemata to algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 938. Beyond context-free grammars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 969. Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97

Chapter 3. Grammars with Controlled DerivationsJurgen Dassow, Gheorghe Paun, and Arto Salomaa . . . . . . . . . . . . . . . . . 1011. Introduction and notations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1012. Some types of controlled derivations and their power . . . . . . . . . . . . . 103

2.1 Prescribed sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1032.2 Control by context conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1152.3 Grammars with partial parallelism . . . . . . . . . . . . . . . . . . . . . . . . . 1242.4 Indexed grammars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1342.5 Hierarchies of families with controlled derivations . . . . . . . . . . . . 135

3. Basic properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1393.1 Operations on language families . . . . . . . . . . . . . . . . . . . . . . . . . . . 1393.2 Decision problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1413.3 Descriptional complexity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145

4. Further topics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150

Chapter 4. Grammar SystemsJurgen Dassow, Gheorghe Paun, and Grzegorz Rozenberg . . . . . . . . . . . . 1551. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1552. Formal language prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1573. CD grammar systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158

3.1 Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158

Page 14: Handbook of Formal Languages Vol. 1-3digitale-objekte.hbz-nrw.de/storage/2006/07/07/file_110/1472075.pdf · x Contents 5. Complexityissues..... 96 5.1 Statecomplexityissues..... 96

Contents xi

3.2 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1603.3 On the generative capacity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1623.4 Hybrid systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1643.5 Increasing the power by teams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1673.6 Descriptional complexity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1693.7 Other classes of CD grammar systems . . . . . . . . . . . . . . . . . . . . . . 172

4. PC grammar systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1734.1 Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1734.2 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1774.3 On the generative capacity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1804.4 The context-sensitive case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1844.5 Non-synchronized PC grammar systems . . . . . . . . . . . . . . . . . . . . . 1854.6 Descriptional and communication complexity . . . . . . . . . . . . . . . . 1864.7 PC grammar systems with communication by command . . . . . . 1894.8 Further variants and results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194

5. Related models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1965.1 Eco-grammar systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1965.2 Test tube systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201

References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207

Chapter 5. Contextual Grammars and Natural LanguagesSolomon Marcus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215The year 1957: two complementary strategies . . . . . . . . . . . . . . . . . . . . . . . 215The origin of contextual grammars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216Motivation of simple contextual grammars and of contextual

grammars with choice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216The duality between strings and contexts

and the Sestier closure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218Steps in modelling morphological categories . . . . . . . . . . . . . . . . . . . . . . . . 219The contextual approach in a generative perspective . . . . . . . . . . . . . . . . . 221Contextual grammars can generate both strings and contexts . . . . . . . . . 223Interplay of strings, contexts and contextual grammars with choice . . . . 225Going deeper in the interplay strings-contexts . . . . . . . . . . . . . . . . . . . . . . 227A higher level of abstraction: parts of speech . . . . . . . . . . . . . . . . . . . . . . . 228Generative power of contextual grammars . . . . . . . . . . . . . . . . . . . . . . . . . . 229Further suggestions: restricted contextual grammars, grammar

systems and splicing contextual schemes . . . . . . . . . . . . . . . . . . . . . . . . 230References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232

Chapter 6. Contextual Grammars and Formal LanguagesAndrzej Ehrenfeucht, Gheorghe Paun, and Grzegorz Rozenberg . . . . . . . . 2371. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2372. Contextual grammars with unrestricted choice . . . . . . . . . . . . . . . . . . . 238

2.1 Preliminaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2382.2 Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238

Page 15: Handbook of Formal Languages Vol. 1-3digitale-objekte.hbz-nrw.de/storage/2006/07/07/file_110/1472075.pdf · x Contents 5. Complexityissues..... 96 5.1 Statecomplexityissues..... 96

xii Contents

2.3 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2412.4 Necessary conditions and counterexamples . . . . . . . . . . . . . . . . . . 2432.5 Generative capacity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2472.6 Closure properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2492.7 Decidability properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253

3. Contextual grammars with restricted choice . . . . . . . . . . . . . . . . . . . . . 2563.1 Definitions and basic results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2563.2 Internal contextual grammars with finite choice . . . . . . . . . . . . . . 2613.3 External contextual grammars with regular choice . . . . . . . . . . . . 264

4. Variants of contextual grammars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2754.1 Deterministic grammars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2754.2 One-sided contexts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2774.3 Leftmost derivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2814.4 Parallel derivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2824.5 Maximal/minimal use of selectors . . . . . . . . . . . . . . . . . . . . . . . . . . 284

5. Bibliographical notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290

Chapter 7. Language Theory and Molecular GeneticsThomas Head, Gheorghe Paun, and Dennis Pixton . . . . . . . . . . . . . . . . . . 2951. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2952. Formal language theory prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . 2983. The splicing operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298

3.1 The uniterated case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2983.2 The iterated case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3063.3 The case of multisets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319

4. Generative mechanisms based on splicing . . . . . . . . . . . . . . . . . . . . . . . 3254.1 Simple H systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3264.2 Extended H systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333

5. Splicing circular words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3355.1 Circular words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3355.2 Circular splicing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3365.3 Mixed splicing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342

6. Computing by splicing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3447. Bibliographical notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348

Appendix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358

Chapter 8. String Editing and Longest Common SubsequencesAlberto Apostolico . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3611. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361

1.1 Approximate string searching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3631.2 Local similarity searches in DNA and protein sequences . . . . . . . 3631.3 Longest common subsequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364

Page 16: Handbook of Formal Languages Vol. 1-3digitale-objekte.hbz-nrw.de/storage/2006/07/07/file_110/1472075.pdf · x Contents 5. Complexityissues..... 96 5.1 Statecomplexityissues..... 96

Contents xiii

2. Two basic paradigms for the LCS problem . . . . . . . . . . . . . . . . . . . . . . 3662.1 Hirschberg’s paradigm: finding antichains one at a time . . . . . . . 3682.2 Incremental antichain decompositions and the Hunt-Szymanski

paradigm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3713. A speed-up for HS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3724. Finger trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3755. Linear space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379

5.1 Computing the length of a solution . . . . . . . . . . . . . . . . . . . . . . . . . 3805.2 Computing an LCS in O(n(m − l)) time and linear space . . . . . 382

6. Combining few and diverse tools: Hirschberg’s paradigm in linearspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386

7. Parallel algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395

Chapter 9. Automata for Matching PatternsMaxime Crochemore and Christophe Hancart . . . . . . . . . . . . . . . . . . . . . . . 3991. Pattern matching and automata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3992. Notations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400

2.1 Alphabet and words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4012.2 Languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4012.3 Regular expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4012.4 Finite automata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4022.5 Algorithms for matching patterns . . . . . . . . . . . . . . . . . . . . . . . . . . 403

3. Representations of deterministic automata . . . . . . . . . . . . . . . . . . . . . . 4053.1 Transition matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4053.2 Adjacency lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4063.3 Transition list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4073.4 Failure function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4073.5 Table-compression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408

4. Matching regular expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4084.1 Outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4084.2 Regular-expression-matching automata . . . . . . . . . . . . . . . . . . . . . 4094.3 Searching with regular-expression-matching automata . . . . . . . . 4114.4 Time-space trade-off . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414

5. Matching finite sets of words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4145.1 Outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4145.2 Dictionary-matching automata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4155.3 Linear dictionary-matching automata . . . . . . . . . . . . . . . . . . . . . . . 4165.4 Searching with linear dictionary-matching automata . . . . . . . . . . 420

6. Matching words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4226.1 Outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4226.2 String-matching automata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4236.3 Linear string-matching automata . . . . . . . . . . . . . . . . . . . . . . . . . . . 4266.4 Properties of string-matching automata . . . . . . . . . . . . . . . . . . . . . 4286.5 Searching with linear string-matching automata . . . . . . . . . . . . . . 431

Page 17: Handbook of Formal Languages Vol. 1-3digitale-objekte.hbz-nrw.de/storage/2006/07/07/file_110/1472075.pdf · x Contents 5. Complexityissues..... 96 5.1 Statecomplexityissues..... 96

xiv Contents

7. Suffix automata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4347.1 Outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4347.2 Sizes and properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435

7.2.1 End-positions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4357.2.2 Suffix function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4367.2.3 State splitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4377.2.4 Sizes of suffix automata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439

7.3 Construction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4417.3.1 Suffix links and suffix paths . . . . . . . . . . . . . . . . . . . . . . . . . . 4417.3.2 On-line construction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4427.3.3 Complexity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446

7.4 As indexes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4477.4.1 Membership . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4487.4.2 First position . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4487.4.3 Occurrence number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4497.4.4 List of positions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4507.4.5 Longest repeated factor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 450

7.5 As string-matching automata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4517.5.1 Ending factors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4517.5.2 Optimization of suffix links . . . . . . . . . . . . . . . . . . . . . . . . . . 4527.5.3 Searching for rotations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453

7.6 Factor automata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4547.6.1 Relation to suffix automata . . . . . . . . . . . . . . . . . . . . . . . . . . 4547.6.2 Size of factor automata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4557.6.3 On-line construction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456

Bibliographic notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461

Chapter 10. Symbolic Dynamics and Finite AutomataMarie-Pierre Beal and Dominique Perrin . . . . . . . . . . . . . . . . . . . . . . . . . . 4631. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4632. Symbolic dynamical systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4643. Recurrence and minimality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4704. Sofic systems and shifts of finite type . . . . . . . . . . . . . . . . . . . . . . . . . . . 4725. Minimal automaton of a subshift . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4776. Codes and finite-to-one maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4807. State splitting and merging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4848. Shift equivalence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4879. Entropy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49010. The road coloring problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49611. The zeta function of a subshift . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49812. Circular codes, shifts of finite type and Krieger embedding theorem 500References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503

Page 18: Handbook of Formal Languages Vol. 1-3digitale-objekte.hbz-nrw.de/storage/2006/07/07/file_110/1472075.pdf · x Contents 5. Complexityissues..... 96 5.1 Statecomplexityissues..... 96

Contents xv

Chapter 11. Cryptology: Language-Theoretic AspectsValtteri Niemi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5071. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5072. Basic notions in cryptology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5073. Connections between cryptology and language theory . . . . . . . . . . . . . 5104. Public-key systems based on language theory . . . . . . . . . . . . . . . . . . . . 511

4.1 Wagner-Magyarik system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5114.2 Salomaa–Welzl system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5124.3 Subramanian et al. system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5134.4 Siromoney–Mathew system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5144.5 Niemi system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5144.6 Oleshchuk system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515

5. Cryptosystems based on automata theory . . . . . . . . . . . . . . . . . . . . . . . 5165.1 Wolfram system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5165.2 Guan public-key system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5165.3 Tao-Chen public-key system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517

6. Theoretical cryptologic research based on language theory . . . . . . . . . 5187. Cryptanalysis based on language theory . . . . . . . . . . . . . . . . . . . . . . . . . 5198. Language-theoretic research inspired by cryptology . . . . . . . . . . . . . . . 5209. Research associated with language theory and cryptology . . . . . . . . . 521References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525

Page 19: Handbook of Formal Languages Vol. 1-3digitale-objekte.hbz-nrw.de/storage/2006/07/07/file_110/1472075.pdf · x Contents 5. Complexityissues..... 96 5.1 Statecomplexityissues..... 96

Authors’ Addresses

Alberto ApostolicoDipartimento di Elettronica e Informatica, Universita di PadovaVia Gradenigo 6/a, I-35131 Padova, Italyand Department of Computer Science, Purdue University1398 Computer Science Building, West Lafayette, IN 47907-1398, [email protected]

Marie-Pierre BealInstitut Gaspard Monge, Universite de Marne-la-Vallee2, rue de la Butte verte, F-93166 Noisy-le-Grand, [email protected]

Cristian CaludeCentre for Discrete Mathematics and Theoretical Computer ScienceThe University of Auckland, Private Bag 92019, Auckland, New Zealandc [email protected]

Maxime CrochemoreInstitut Gaspard Monge, Universite de Marne-la-Vallee2, rue de la Butte verte, F-93166 Noisy-le-Grand, [email protected]

Jurgen DassowFaculty of Computer Science, Otto-von-Guericke-University of MagdeburgP.O. Box 4120, D-39016 Magdeburg, [email protected]

Andrzej EhrenfeuchtDepartment of Computer Science, University of Colorado at BoulderCampus 430, Boulder, CO 80309, [email protected]

Christophe HancartLaboratoire d’Informatique de Rouen, Faculte des Sciences et TechniquesUniversite de Rouen, F-76821 Mont-Saint-Aignan Cedex, [email protected]

Thomas HeadDepartment of Mathematics, University of BinghamtonP.O. Box 6000, Binghamton, NY 13902, [email protected]

Page 20: Handbook of Formal Languages Vol. 1-3digitale-objekte.hbz-nrw.de/storage/2006/07/07/file_110/1472075.pdf · x Contents 5. Complexityissues..... 96 5.1 Statecomplexityissues..... 96

xxii Authors’ Addresses

Juraj HromkovicInstitut fur Informatik und Praktische Mathematik, Universitat KielOlshausenstrasse 40, D-24098 Kiel, [email protected]

Solomon MarcusFaculty of Mathematics, University of BucharestStr. Academiei, RO-70109 Bucharest, [email protected]

Valtteri NiemiDepartment of Mathematics and Statistics, University of VaasaFIN-65101 Vaasa, [email protected]

Anton NijholtComputer Science Department, University of TwenteP.O. Box 217, NL-7500 AE Enschede, The [email protected]

Gheorghe PaunInstitute of Mathematics of the Romanian AcademyP.O. Box 1-764, RO-70700 Bucharest, [email protected]

Dominique PerrinInstitut Gaspard Monge, Universite de Marne-la-Vallee2, rue de la Butte verte, F-93166 Noisy-le-Grand, [email protected]

Dennis PixtonDepartment of Mathematics, University of BinghamtonP.O. Box 6000, Binghamton, New York 13902, [email protected]

Grzegorz RozenbergDepartment of Computer Science, Leiden UniversityP.O. Box 9512, NL-2300 RA Leiden, The Netherlandsand Department of Computer Science, University of Colorado at BoulderCampus 430, Boulder, CO 80309, [email protected]

Arto SalomaaAcademy of Finland and Turku Centre for Computer Science (TUCS)Lemninkaisenkatu 14 A, FIN-20520 Turku, [email protected]

Klaas SikkelFIT, CSCW, German National Research Centre for Information Technology (GMD)Schloß Birlinghoven, D-53757 Sankt Augustin, [email protected]

Page 21: Handbook of Formal Languages Vol. 1-3digitale-objekte.hbz-nrw.de/storage/2006/07/07/file_110/1472075.pdf · x Contents 5. Complexityissues..... 96 5.1 Statecomplexityissues..... 96

Contents of Volume 3

Chapter 1. Tree LanguagesFerenc Gecseg and Magnus Steinby . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12. Trees and terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23. Algebraic preliminaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54. Term rewriting systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85. Finite tree recognizers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96. Regular tree grammars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147. Tree language operations and closure properties of Rec . . . . . . . . . . . 158. Local tree languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199. A Kleene theorem for tree languages . . . . . . . . . . . . . . . . . . . . . . . . . . . 2010. Regular tree systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2211. Algebraic characterizations of recognizability . . . . . . . . . . . . . . . . . . . . 2412. Monadic second-order logic and regular tree languages . . . . . . . . . . . . 2713. Families of special regular tree languages . . . . . . . . . . . . . . . . . . . . . . . . 2914. The yield-function and context-free languages . . . . . . . . . . . . . . . . . . . 3115. Context-free tree grammars and pushdown tree recognizers . . . . . . . . 3516. Tree transformations and tree transducers . . . . . . . . . . . . . . . . . . . . . . . 3817. Composition and decomposition of tree transformations . . . . . . . . . . . 4218. Tree transducers with regular look-ahead . . . . . . . . . . . . . . . . . . . . . . . . 4319. Generalized syntax directed translations . . . . . . . . . . . . . . . . . . . . . . . . 4420. Surface tree languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4521. The hierarchies of surface tree languages and transformational

languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4922. Some further topics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

Chapter 2. Tree-Adjoining GrammarsAravind K. Joshi and Yves Schabes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 691. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 692. Tree-adjoining grammars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

2.1 Adjoining constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 722.2 Derivation in TAG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 742.3 Some properties of the string languages and tree sets . . . . . . . . . 76

3. Lexicalized grammars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 794. ‘Lexicalization’ of CFGs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81

4.1 Substitution and lexicalization of CFGs . . . . . . . . . . . . . . . . . . . . . 824.2 Lexicalization of CFGs with TAGs . . . . . . . . . . . . . . . . . . . . . . . . . 86

Page 22: Handbook of Formal Languages Vol. 1-3digitale-objekte.hbz-nrw.de/storage/2006/07/07/file_110/1472075.pdf · x Contents 5. Complexityissues..... 96 5.1 Statecomplexityissues..... 96

x Contents

5. Closure of TAGs under lexicalization . . . . . . . . . . . . . . . . . . . . . . . . . . . 896. Summary of lexicalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 907. Embedded push-down automaton (EPDA) . . . . . . . . . . . . . . . . . . . . . . 91

7.1 Crossed dependencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 938. Linguistic relevance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 959. Some variants of TAGs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101

9.1 Feature structure based TAGs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1019.2 Synchronous TAGs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1019.3 Probabilistic LTAGs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1019.4 Using description trees in TAG . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1029.5 Muti-component TAGs (MCTAG) . . . . . . . . . . . . . . . . . . . . . . . . . 102

10. Parsing lexicalized tree-adjoining grammars (LTAG) . . . . . . . . . . . . . . 10210.1 Left to right parsing of TAGs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10310.2 The algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11110.3 An example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11110.4 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11410.5 Complexity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11410.6 The parser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11510.7 Parsing substitution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11510.8 The valid prefix property and parsing of tree-adjoining

grammar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11611. Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120

Chapter 3. Context-Free Graph GrammarsJoost Engelfriet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1251. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1252. Node and edge replacement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1263. Hyperedge replacement grammars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130

3.1 Definitions and examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1303.2 Normal forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1523.3 Subclasses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157

4. Node replacement grammars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1654.1 Definitions and examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1654.2 Subclasses and normal forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1774.3 Comparison of HR and NR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181

5. Monadic second order logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1886. Graph grammars generating strings and trees . . . . . . . . . . . . . . . . . . . . 1967. Tree grammars generating graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208

Chapter 4. Two-Dimensional LanguagesDora Giammarresi and Antonio Restivo . . . . . . . . . . . . . . . . . . . . . . . . . . . 2151. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2152. Preliminaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2183. Regular expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222

Page 23: Handbook of Formal Languages Vol. 1-3digitale-objekte.hbz-nrw.de/storage/2006/07/07/file_110/1472075.pdf · x Contents 5. Complexityissues..... 96 5.1 Statecomplexityissues..... 96

Contents xi

4. Automata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2244.1 Four-way automata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2244.2 On-line tesselation automata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227

5. Grammars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2296. Logic formulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2327. Tiling systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234

7.1 Local two-dimensional languages . . . . . . . . . . . . . . . . . . . . . . . . . . . 2347.2 Tiling recognizable languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2367.3 Closure properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2387.4 Domino systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2427.5 Generalizations of local languages . . . . . . . . . . . . . . . . . . . . . . . . . . 246

8. Equivalence theorems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2478.1 Tiling systems and automata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2478.2 Tiling systems and logic formulas . . . . . . . . . . . . . . . . . . . . . . . . . . 2498.3 Tiling systems and regular expressions . . . . . . . . . . . . . . . . . . . . . . 2518.4 Comparing all families . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253

9. Properties of recognizable languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2549.1 Necessary conditions for recognizability . . . . . . . . . . . . . . . . . . . . . 2549.2 Undecidability results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256

10. Recognizable functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25811. Beyond finite state recognizability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265

Chapter 5. Basics of Term RewritingMatthias Jantzen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2691. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2692. Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2703. Church–Rosser properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2804. Orderings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2845. Completion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2956. Rewriting modulo a relation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3027. Sundries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311References and further reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313

Chapter 6. ω-LanguagesLudwig Staiger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3391. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3392. Topology for languages and ω-languages . . . . . . . . . . . . . . . . . . . . . . . . 341

2.1 Cantor topology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3412.2 Continuous mappings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3432.3 Wadge’s hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3452.4 Joint topologies on X∗ ∪ Xω . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346

3. The Chomsky hierarchy of ω-languages . . . . . . . . . . . . . . . . . . . . . . . . . 3483.1 Acceptance of ω-languages by automata . . . . . . . . . . . . . . . . . . . . 3483.2 Finite automata and regular ω-languages . . . . . . . . . . . . . . . . . . . . 3533.3 Context-free ω-languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3563.4 ω-languages accepted by Turing machines . . . . . . . . . . . . . . . . . . . 361

Page 24: Handbook of Formal Languages Vol. 1-3digitale-objekte.hbz-nrw.de/storage/2006/07/07/file_110/1472075.pdf · x Contents 5. Complexityissues..... 96 5.1 Statecomplexityissues..... 96

xii Contents

4. Languages and ω-languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3684.1 ω-Kleene closure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3684.2 ω-power languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3704.3 a-transducers, gsm-mappings, and ω-transductions . . . . . . . . . . . 3724.4 Limit-closure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375

5. Wagner’s hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3785.1 Wagner classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3785.2 gsm-reducibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381

References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383

Chapter 7. Languages, Automata, and LogicWolfgang Thomas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3891. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3892. Models and formulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390

2.1 Words, trees, and graphs as models . . . . . . . . . . . . . . . . . . . . . . . . 3912.2 First-order logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3932.3 Monadic second-order logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395

3. Automata and MSO-logic on finite words and trees . . . . . . . . . . . . . . . 3963.1 MSO-logic on words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3963.2 MSO-logic on traces and trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401

4. First-order definability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4054.1 The Ehrenfeucht–Fraısse game . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4054.2 Locally threshold testable sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4094.3 Star-free languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412

5. Automata and MSO-logic on infinite words . . . . . . . . . . . . . . . . . . . . . . 4155.1 ω-automata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4165.2 Determinization of ω-automata . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4195.3 Applications to definability and decision problems . . . . . . . . . . . . 425

6. Automata and MSO-logic on infinite trees . . . . . . . . . . . . . . . . . . . . . . . 4316.1 Automata on infinite trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4316.2 Determinacy and complementation . . . . . . . . . . . . . . . . . . . . . . . . . 4356.3 Applications to decision problems of MSO-logic . . . . . . . . . . . . . . 444

References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449

Chapter 8. Partial Commutation and TracesVolker Diekert and Yves Metivier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4571. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4572. Free partially commutative monoids . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458

2.1 First definitions and basic properties . . . . . . . . . . . . . . . . . . . . . . . 4582.2 Projection techniques and Levi’s lemma . . . . . . . . . . . . . . . . . . . . . 4612.3 Normal forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4632.4 A simple algorithm to compute normal forms . . . . . . . . . . . . . . . . 4652.5 Mobius functions and normal forms . . . . . . . . . . . . . . . . . . . . . . . . 4652.6 Bibliographical remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470

3. Combinatorial properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4703.1 Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4703.2 Strong homomorphisms and codings . . . . . . . . . . . . . . . . . . . . . . . . 473

Page 25: Handbook of Formal Languages Vol. 1-3digitale-objekte.hbz-nrw.de/storage/2006/07/07/file_110/1472075.pdf · x Contents 5. Complexityissues..... 96 5.1 Statecomplexityissues..... 96

Contents xiii

3.3 Trace codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4763.4 Bibliographical remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477

4. Recognizable trace languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4784.1 Basic facts about recognizable and rational sets . . . . . . . . . . . . . . 4784.2 Recognizability and rational operations . . . . . . . . . . . . . . . . . . . . . 4794.3 The rank . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4804.4 Recognizability and the lexicographic normal form . . . . . . . . . . . 4834.5 The star problem and the finite power property . . . . . . . . . . . . . . 4844.6 An algorithm to compute closures . . . . . . . . . . . . . . . . . . . . . . . . . . 4874.7 Bibliographical remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492

5. Rational trace languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4925.1 Unambiguous languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4925.2 Decidability results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4945.3 Bibliographical remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 496

6. Dependence graphs and logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4976.1 Dependence graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4976.2 Traces and logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5006.3 Ehrenfeucht–Fraısse games . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5036.4 Bibliographical remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 506

7. Asynchronous automata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5067.1 Zielonka’s theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5067.2 Asynchronous cellular automata . . . . . . . . . . . . . . . . . . . . . . . . . . . 5087.3 Changing concurrent-read to exclusive-read . . . . . . . . . . . . . . . . . 5087.4 Changing exclusive-write to owner-write . . . . . . . . . . . . . . . . . . . . 5097.5 The construction for triangulated dependence alphabets . . . . . . 5107.6 Bounded time-stamps in a distributed system . . . . . . . . . . . . . . . . 5127.7 Bibliographical remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516

8. Infinite traces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5168.1 Real traces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5168.2 Asynchronous Buchi and Muller automata . . . . . . . . . . . . . . . . . . 5208.3 Complex traces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5218.4 Topological properties and the domain of δ-traces . . . . . . . . . . . . 5238.5 Bibliographical remarks and further reading . . . . . . . . . . . . . . . . . 526

References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527

Chapter 9. Visual Models of Plant DevelopmentPrzemyslaw Prusinkiewicz, Mark Hammel,Jim Hanan, and Radomır Mech . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535

1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5352. Developmental models of plant architecture . . . . . . . . . . . . . . . . . . . . . 536

2.1 The modular structure of plants . . . . . . . . . . . . . . . . . . . . . . . . . . . 5362.2 Plant development as a rewriting process . . . . . . . . . . . . . . . . . . . 538

3. Formal description of branching structures . . . . . . . . . . . . . . . . . . . . . . 5403.1 Axial trees and bracketed strings . . . . . . . . . . . . . . . . . . . . . . . . . . . 5403.2 The bracketed string notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5413.3 The turtle interpretation of bracketed strings . . . . . . . . . . . . . . . . 542

Page 26: Handbook of Formal Languages Vol. 1-3digitale-objekte.hbz-nrw.de/storage/2006/07/07/file_110/1472075.pdf · x Contents 5. Complexityissues..... 96 5.1 Statecomplexityissues..... 96

xiv Contents

4. Fundamentals of modeling using L-systems . . . . . . . . . . . . . . . . . . . . . . 5464.1 Parametric D0L-systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5464.2 Examples of parametric D0L-system models . . . . . . . . . . . . . . . . . 548

4.2.1 Fractal generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5494.2.2 Simulation of development . . . . . . . . . . . . . . . . . . . . . . . . . . . 5494.2.3 Exploration of parameter space . . . . . . . . . . . . . . . . . . . . . . . 5504.2.4 Modeling mesotonic and acrotonic structures . . . . . . . . . . . 552

5. Random factors in development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5545.1 The role of randomness in the description of development . . . . . 5545.2 Stochastic 0L-systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5545.3 A stochastic tree model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 556

6. Life, death, and reproduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5586.1 Non-propagating L-systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5586.2 L-systems with a cut symbol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5596.3 Fragmentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 560

7. Development controlled by endogenous mechanisms . . . . . . . . . . . . . . 5627.1 Information flow in growing plants . . . . . . . . . . . . . . . . . . . . . . . . . 5627.2 Context-sensitive L-systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5637.3 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 566

7.3.1 Development of a mesotonic structure . . . . . . . . . . . . . . . . . 5677.3.2 Attack of a plant by an insect . . . . . . . . . . . . . . . . . . . . . . . . 5687.3.3 Development controlled by resource allocation . . . . . . . . . . 570

8. Development controlled by exogenous mechanisms . . . . . . . . . . . . . . . 5768.1 Plants and their environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5768.2 Environmentally-sensitive L-systems . . . . . . . . . . . . . . . . . . . . . . . . 5778.3 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 579

8.3.1 A deterministic model of plant response to pruning . . . . . 5798.3.2 A stochastic model of tree response to pruning . . . . . . . . . 5808.3.3 Plant climbing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5838.3.4 Directional cues in development . . . . . . . . . . . . . . . . . . . . . . 583

9. Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58710. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 590References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 591

Chapter 10. Digital Images and Formal LanguagesKarel Culik II and Jarkko Kari . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5991. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5992. Black and white images and finite automata . . . . . . . . . . . . . . . . . . . . . 6003. Grayscale images and WFA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6034. Weighted finite transducers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6095. Examples of WFT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 614References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 615Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 617

Page 27: Handbook of Formal Languages Vol. 1-3digitale-objekte.hbz-nrw.de/storage/2006/07/07/file_110/1472075.pdf · x Contents 5. Complexityissues..... 96 5.1 Statecomplexityissues..... 96

Authors’ Addresses

Karel Culik IIDepartment of Computer Science, University of South CarolinaColumbia, SC 29208, [email protected]

Volker DiekertInstitut fur Informatik, Universitat StuttgartBreitwiesenstraße 20-22, D-70565 Stuttgart, [email protected]

Joost EngelfrietDepartment of Computer Science, Leiden UniversityP.O. Box 9512, NL-2300 RA Leiden, The [email protected]

Ferenc GecsegDepartment of Informatics, Jozsef Attila UniversityAradi vertanuk tere 1, H-6720 Szeged, [email protected]

Dora GiammarresiDipartimento di Matematica, Applicata e Informatica,Universita Cu’ Foscari di VeneziaVia Torino 155, I-30173 Venezia Mestre, [email protected]

Mark HammelDepartment of Computer Science, The University of Calgary2500 University Drive N.W., Calgary, Alberta T2N 1N4, [email protected]

Jim HananCooperative Research Centre for Tropical Pest ManagementCSIRO Long Pocket LaboratoriesPrivate Bag # 3, Indooroopilly, Queensland, Australia [email protected]

Matthias JantzenFachbereich Informatik, Universitat HamburgVogt-Kolln-Straße 30, D-22527 Hamburg, [email protected]

Aravind K. JoshiDepartment of Computer and Information Science andThe Institute for Research in Cognitive ScienceThe Moore School of Electronical Engineering, University of PennsylvaniaPhiladelphia, PA 19104, [email protected]

Page 28: Handbook of Formal Languages Vol. 1-3digitale-objekte.hbz-nrw.de/storage/2006/07/07/file_110/1472075.pdf · x Contents 5. Complexityissues..... 96 5.1 Statecomplexityissues..... 96

xx Authors’ Addresses

Jarkko KariDepartment of Computer Science, University of Iowa101E MacLean Hall, Iowa City, IA 52242-1419, [email protected]

Radomır MechDepartment of Computer Science, The University of Calgary2500 University Drive N.W., Calgary, Alberta T2N 1N4, [email protected]

Yves MetivierlaBRI, Universite de Bordeaux I, ENSERB351 cours de la Liberation, F-33405 Talence, [email protected]

Przemyslaw PrusinkiewiczDepartment of Computer Science, The University of Calgary2500 University Drive N.W., Calgary, Alberta T2N 1N4, [email protected]

Antonio RestivoDipartimento di Matematica ed Applicazioni, Universita di PalermoVia Archirafi 34, I-90123 Palermo, [email protected]

Yves SchabesMitsubishi Electric Research Laboratories, Cambridge Research Center201 Broadway, Cambridge, MA 02139, [email protected]

Ludwig StaigerInstitut fur Informatik derMartin-Luther-Universitat Halle-WittenbergKurt-Mothes-Straße 1, D-06099 Halle (Saale), [email protected]

Magnus SteinbyDepartment of Mathematics, University of TurkuFIN-0014 Turku, [email protected]

Wolfgang ThomasInstitut fur Informatik und Praktische Mathematik, Universitat KielOlshausenstraße 40, D-24098 Kiel, [email protected]