Second Course in Formal Languages and Automata Theory

Total Page:16

File Type:pdf, Size:1020Kb

Second Course in Formal Languages and Automata Theory 1 2FLT transparencies made for Second Course in Formal Languages and Automata Theory based on the book by Jeffrey Shallit of the same title Hendrik Jan Hoogeboom, Leiden http://www.liacs.nl/~hoogeboo/second/ LIACS — Second Course ... I Chapter 1 Review of Formal Languages and Automata Theory I 1 Chomsky hierarchy grammar automaton 3 regular right-linear finite state A aB a → 2 context-free A α pushdown → (+lifo stack) 1 context-sensitive (β ,A,βr) α linear bounded ℓ → α β β α → | |≥| | monotone 0 recursively enumerable α β turing machine → I 2 review of formal languages and automata theory 1.1 Sets 1.2 Symbols, strings, and languages 1.3 Regular expressions and regular languages 1.4 Finite automata 1.5 Context-free grammars and languages 1.6 Turing machines 1.7 Unsolvability 1.8 Complexity theory Moved to respective chapters LIACS — Second Course ... III Chapter 3 Finite Automata and Regular Languages III 1 finite automata and regular languages 3.0 Review 3.1 Moore and Mealy machines closure 3.2 Quotients 3.3 Morphisms and substitutions 3.4 Advanced closure properties of regular lan- guages 3.5 Transducers machines 3.6 Two-way finite automata 3.7 The transformation automaton 3.8 Automata, graphs, and Boolean matrices algebra 3.9 The Myhill-Nerode theorem 3.10 Minimization of finite automata 3.11 State complexity 3.12 Partial orders and regular languages 3.0 Review III 2 deterministic finite automaton = (Q, Σ, δ, q , F ) A 0 finite Q states p, q control δ q Q initial state 0 ∈ p F Q final states Σ ⊆ input alphabet a,b w,x δ : Q Σ Q transition function a × → ··· ··· input tape δ : Q Σ Q ∗ × ∗ → b δ∗(q,ε)= q b p q δ∗(q,xa)= δ( δ∗(q,x), a) a a b L( )= x Σ∗ δ(q0,x) F b A { ∈ | ∈ } r s a a III 3 run run on aababb b a a b a b b b p q p r s q r q p a a b does not accept b r s a a a b p r p q r p r s q s s q initial state p final states q, s III 4 nondeterministic finite automaton = (Q, Σ, δ, q , F ) A 0 finite Q states p, q control δ q Q initial state 0 ∈ p F Q final states Σ ⊆ input alphabet a,b w,x δ : Q Σ 2Q transition function a × → ··· ··· input tape δ : Q Σ 2Q ∗ × ∗ → a,b δ (q,ε)= q ∗ { } δ∗(q,xa)= δ(r, a) a,b r δ∗(q,x) 0 a 1 2 ∈ L( )= x Σ δ(q ,x) F = ∅ A { ∈ ∗ | 0 ∩ } Q Q δ(0, a) = 0, 1 δ′ : 2 Σ 2 (deterministic) { } × → (2 a) = ∅ δ , δ′(U, a)= p U δ(p, a) ∈ III 5 subset construction a,b a a,b 0 1 2 b b 0 0, 2 { } { } a a b a b b a 0 0 0 0 0 0 0 a b a a a b 1 1 1 0, 1 0, 1, 2 a a b b { } { } 2 2 2 a 0 0 0 0 0 0 0 1 1 1 a,b 2 2 2 1 2 { } { } deterministic δ : 2Q Σ 2Q a,b ′ × → δ′(U, a)= p U δ(p, a) a,b ∈ 1, 2 a,b { } ∅ III 6 nfa regular expression E E + E E E p 0 q p 0 1 · 2∗ · 3 q E1 E3 r r E2 bb a a p q p q a a a+b(aa)*ab b b b b b ab p q b ba a a+ba(aa)*b r s r b(aa)*b bb+ba(aa)*ab a aa III 7 pumping lemma long words ’loop’ and can be pumped for every regular language L ∀ there exists a constant n 1 ∃ ≥ such that for every z L ∀ ∈ with z n | |≥ there exists a decomposition z = uvw ∃ with uv n, v 1 | |≤ | |≥ such that for all i 0, uviw L ∀ ≥ ∈ Lemma 1.4.4 III 8 proofs - clever idea, intuition - formal construction, specification - show it works, e.g., induction once the idea is understood, the other parts might be boring but essential to test intuition examples help to get the message III 9 closure properties RLIN CF MON TYPE0 REG DPDA PDAe DLBA LBA REC RE intersection + – – +++ + complement + + – +++ – union + – + +++ + concatenation + – + +++ + star, plus + – + +++ + ε-free morphism + – + +++ + morphism + – + ––– + inverse morphism + + + +++ + intersect reg lang + + + +++ + mirror + – + +++ + fAFL fAFL AFL AFL AFL fAFL , c, boolean operations ∩ ∪ , , regular operations ∪ · ∗ h, h 1, R (full) trio operations − ∩ 3.1 Moore and Mealy machines 3.2 Quotients III 10 quotient L 1 L , L Σ 1 2 ⊆ ∗ L /L = x Σ xy L for some y L x 1 2 { ∈ ∗ | ∈ 1 ∈ 2 } L2 + + + + Ex. L1 = a bc , L2 = bc , L3 = c + L1/L2 = a + L1/L3 = a bc∗ Ex. Pref(L)= L/Σ∗ Example 3.2.1 and 3.2.5 III 11 quotient L 1 L , L Σ 1 2 ⊆ ∗ L /L = x Σ xy L for some y L x 1 2 { ∈ ∗ | ∈ 1 ∈ 2 } L2 2 Ex. L = an n 0 { | ≥ } 2 2 L/L = an m n m 0 = a(aa) +(a4) { − | ≥ ≥ } ∗ ∗ ‘ ’ m2 n2 = (m + n)(m n) ⊆ − − m n m + n m n m2 n2 − − ee e e mult four eo o o odd oe o o odd oo e e mult four ‘ ’ (k + 1)2 k2 = 2k + 1 odd ⊇ − (k + 2)2 k2 = 4k +4 multipleoffour − Example 3.2.2 III 12 example L 1 L , L Σ 1 2 ⊆ ∗ L /L = x Σ xy L for some y L x 1 2 { ∈ ∗ | ∈ 1 ∈ 2 } L2 can ’hide’ computations Ex. L = a2ncban n 1 ba2nban n 1 ba 1 { | ≥ }{ | ≥ }∗ L = c banban n 1 2 ·{ | ≥ }∗ n L /L = a2 n 1 1 2 { | ≥ } a16 c ba8 ba8 ba4 ba4 ba2 ba2 ba ba cf. Thm 4.1.6 III 13 quotient Thm. L, R Σ If R regular, then R/L regular. ⊆ ∗ F = q Q δ(q,y) F for some y L . ′ { ∈ | ∈ ∈ } noncomputable ! (L arbitrary) REG closed under quotient REG / REG = REG (see Ch.4) CF not closed, even CF / CF = RE CF / REG = CF Theorem 3.2.2 3.3 Morphisms and substitutions III 14 morphism ‘monoid’ h : Σ ∆ → ∗ h : Σ ∆ h(xy)= h(x)h(y), h(ε)= ε ∗ → ∗ Σ ∆ h : 2 ∗ 2 ∗ h(L)= x L h(x) → ∈ 0 ab, 1 ba, 2 ε → → → 00212 ababba → 0n21n n 0 (ab)n(ba)n n 0 { | ≥ } → { | ≥ } Thm. h(K L)= h(K) h(L) ∪ ∪ h(K L)= h(K) h(L) · · h(K∗)= h(K)∗ REG closed under morphisms Theorem 3.3.1 III 15 substitution bb a a p q p q a a a+b(aa)*ab b b b b b ab p q b ba a a+ba(aa)*b r s r b(aa)*b bb+ba(aa)*ab a aa 1 p q 1 0 0 0 b(aa)*b → 1 a+b(aa)*ab → K = x 0, 1 # x is even { ∈{ }∗ | 1 } s(K)= x a, b #ax, # x are even { ∈{ }∗ | b } III 16 inverse morphism h : Σ ∆ , K ∆ → ∗ ⊆ ∗ h 1(K)= x Σ h(x) K − { ∈ ∗ | ∈ } Thm. REG closed under inverse morphism a h(a) δ′(p, a)= δ(p, h(a)) h : 0 ab, 1 ba → → h 1( bb, aba )= 0011 − { }∗ { }∗ a 1 b 1 b 0 b a 0 Theorem 3.3.9 III 17 shuffle shuff(K, L)= K L shuffle abb aca = aabbca, aabcba, aabcab, aacabb, aacbab, aacbba, abbaca, { ababca, abacba, abacab, acabba, acabab, acaabb } x ε = ε x = x { } ax by = a(x by) b(ax y) ∪ K L = x K,y L x y ∈ ∈ Thm. K, L regular, then K L regular. but where is that stated? Ex. 3.3.8 III 18 shuffle abbba acac abacbacba ∋ K L using morphisms, intersection copies of alphabet Σ, Σ = a a Σ , Σ = a a Σ 1 { 1 | ∈ } 2 { 2 | ∈ } h : Σ Σ Σ a a a ε 1 1 ∪ 2 → ∗ 1 → 2 → h : Σ Σ Σ a ε a a 2 1 ∪ 2 → ∗ 1 → 2 → g : Σ Σ Σ a a a a 1 ∪ 2 → ∗ 1 → 2 → h h abbba 1 a b a c b a c b a 2 acac ← 1 1 2 2 1 2 2 1 1 → K g L ∈ ↓ ∈ abacbacba 1 1 K L = g( h− (K) h− (L) ) 1 ∩ 2 Ex. 3.3.8 3.4 Advanced closure properties of regular languages III 19 exotic: halve, sqrt 1L = x Σ xy L for y with y = x . 2 { ∈ ∗ | ∈ | | | |} 1 Thm. L regular, then 2L regular guess middle state, simulate halves in parallel Q = q Q Q Q middle, 1st, 2nd ′ { 0′ } ∪ × × δ (q ,ε)= [q, q , q] q Q ε-move ′ 0′ { 0 | ∈ } δ ([q, p, r], a)= [q,δ(p, a),δ(r, b)] b Σ ′ { | ∈ } F = [q,q,p] q Q, p F ′ { | ∈ ∈ } √ L = x Σ xx L . { ∈ ∗ | ∈ } Theorem 3.4.1 III 20 cutting cut L = x xy L for y with y = f( x ) . f { | ∈ | | | | } 1 f(n)= n 2L f(n) = 2n log L p.76 f(n)= n2 which f ? see: transition matrix (Ch. 3.8) III 21 cyclic closure cyc(L)= x x x x L . { 1 2 | 2 1 ∈ } Thm. If L is regular, then so is cyc(L) guess middle, simulate halves in opposite order Q = q Q Q 0, 1 ′ { 0′ } ∪ × ×{ } middle, state, phase δ (q ,ε)= [q,q, 0] q Q ε-move ′ 0′ { | ∈ } δ ([q,p,i], a)= [q,δ(p, a),i] ′ { } δ ([q, q , 0],ε)= [q, q , 1] q Q ′ f { 0 | f ∈ } F = [q,q, 1] q Q ′ { | ∈ } Theorem 3.4.3 ⊲ In informal notation, (1) Note that the construction introduces x y ε-moves.
Recommended publications
  • Extended Finite Autómata O Ver Group S
    Extended finite autómata o ver group s Víctor Mitrana , Ralf Stiebe Abstract Some results from Dassow and Mitrana (Internat. J. Comput. Algebra (2000)), Griebach (Theoret. Comput. Sci. 7 (1978) 311) and Ibarra et al. (Theoret. Comput. Sci. 2 (1976) 271) are generalized for finite autómata over arbitrary groups. The closure properties of these autómata are poorer and the accepting power is smaller when abelian groups are considered. We prove that the addition of any abelian group to a finite automaton is less powerful than the addition of the multiplicative group of rational numbers. Thus, each language accepted by a finite au­ tomaton over an abelian group is actually a unordered vector language. Characterizations of the context-free and recursively enumerable languages classes are set up in the case of non-abelian groups. We investigate also deterministic finite autómata over groups, especially over abelian groups. Keywords: Finite autómata over groups; Closure properties; Accepting capacity; Interchange lemma; Free groups 1. Introduction One of the oldest and most investigated device in the autómata theory is the finite automaton. Many fundamental properties have been established and many problems are still open. Unfortunately, the finite autómata without any external control have a very limited accepting power. DirTerent directions of research have been considered for overcoming this limitation. The most known extensión added to a finite autómata is the pushdown memory. In this way, a considerable increasing of the accepting capacity has been achieved: the pushdown autómata are able to recognize all context-free languages. Another simple and natural extensión, related somehow to the pushdown memory, was considered in a series of papers [2,4,5], namely to associate an element of a given group to each configuration, but no information regarding the associated element is allowed.
    [Show full text]
  • A Second Course in Formal Languages and Automata Theory Jeffrey Shallit Index More Information
    Cambridge University Press 978-0-521-86572-2 - A Second Course in Formal Languages and Automata Theory Jeffrey Shallit Index More information Index 2DFA, 66 Berstel, J., 48, 106 2DPDA, 213 Biedl, T., 135 3-SAT, 21 Van Biesbrouck, M., 139 Birget, J.-C., 107 abelian cube, 47 blank symbol, B, 14 abelian square, 47, 137 Blum, N., 106 Ackerman, M., xi Boolean closure, 221 Adian, S. I., 43, 47, 48 Boolean grammar, 223 Aho, A. V., 173, 201, 223 Boolean matrices, 73, 197 Alces, A., 29 Boonyavatana, R., 139 alfalfa, 30, 34, 37 border, 35, 104 Allouche, J.-P., 48, 105 bordered, 222 alphabet, 1 bordered word, 35 unary, 1 Borges, M., xi always-halting TM, 209 Borwein, P., 48 ambiguous, 10 Boyd, D., 223 NFA, 102 Brady, A. H., 200 Angluin, D., 105 branch point, 113 angst Brandenburg, F.-J., 139 existential, 54 Brauer, W., 106 antisymmetric, 92 Brzozowski, J., 27, 106 assignment Bucher, W., 138 satisfying, 20 Buntrock, J., 200 automaton Burnside problem for groups, 42 pushdown, 11 Buss, J., xi, 223 synchronizing, 105 busy beaver problem, 183, 184, 200 two-way, 66 Axelrod, R. M., 105 calliope, 3 Cantor, D. C., 201 Bader, C., 138 Cantor set, 102 balanced word, 137 cardinality, 1 Bar-Hillel, Y., 201 census generating function, 133 Barkhouse, C., xi Cerny’s conjecture, 105 base alphabet, 4 Chaitin, G. J., 200 Berman, P., 200 characteristic sequence, 28 233 © Cambridge University Press www.cambridge.org Cambridge University Press 978-0-521-86572-2 - A Second Course in Formal Languages and Automata Theory Jeffrey Shallit Index More information 234 Index chess,
    [Show full text]
  • Applications of an Infinite Square-Free Co-Cfl”
    View metadata, citation and similar papers at core.ac.uk brought to you by CORE provided by Elsevier - Publisher Connector Theoretical Computer Science 49 (1987) 113-119 113 North-Holland APPLICATIONS OF AN INFINITE SQUARE-FREE CO-CFL” Michael G. MAIN Department of Computer Science, University of Colorado, Boulder, CO 80309, U.S.A. Walter BUCHER Institutes for information Processing, Technical Universify sf Graz, A-8010 Graz, Austria David HAUSSLER Department of Mathematics and Computer Science, University of Denver, Denver, CO 80208, U.S.A. Abstract. We disprove several conjectures about context-free languages. The proofs use the set of all strings which are nor prefixes of Thue’s infinite square-free sequence. This is a context-free language with an infinite square-free complement. 1. Introduction A square is an immediately repeated nonempty string, e.g., au, abub, newyorknewyork. A string x is called square-conruining if it contains a substring which is a square. For example, the string mississippi contains the segment iss twice in a row; in fact, mississippi contains a total of five squares. On the other hand, colorudo contains no squares (the character o appears several times, but not consecu- tively). A string without squares is called square-free. In a study of context-free languages, Autebert et al. [2,3] collected several conjectures about square-containing strings. One of the weakest conjectures was that no context-free language (CFL) could include all of the square-containing strings and still have an infinite complement. Contrary to this conjecture, such a language has recently been constructed [ 141.
    [Show full text]
  • CDM Context-Sensitive Grammars
    CDM Context-Sensitive Grammars 1 Context-Sensitive Grammars Klaus Sutner Carnegie Mellon Universality Linear Bounded Automata 70-cont-sens 2017/12/15 23:17 LBA and Counting Where Are We? 3 Postfix Calculators 4 Hewlett-Packard figured out 40 years ago the reverse Polish notation is by far the best way to perform lengthy arithmetic calculations. Very easy to implement with a stack. Context-free languages based on grammars with productions A α are very → important since they describe many aspects of programming languages and The old warhorse dc also uses RPN. admit very efficient parsers. 10 20 30 + * n CFLs have a natural machine model (PDA) that is useful e.g. to evaluate 500 arithmetic expressions. 10 20 30 f Properties of CFLs are mostly undecidable, Emptiness and Finiteness being 30 notable exceptions. 20 10 ^ n 1073741824000000000000000000000000000000 Languages versus Machines 5 Languages versus Machines 6 Why the hedging about “aspects of programming languages”? To deal with problems like this one we need to strengthen our grammars. The Because some properties of programming language lie beyond the power of key is to remove the constraint of being “context-free.” CFLs. Here is a classical example: variables must be declared before they can be used. This leads to another important grammar based class of languages: context-sensitive languages. As it turns out, CSL are plenty strong enough to begin describe programming languages—but in the real world it does not matter, it is int x; better to think of programming language as being context-free, plus a few ... extra constraints. x = 17; ..
    [Show full text]
  • On the Language of Primitive Words*
    CORE Metadata, citation and similar papers at core.ac.uk Provided by Elsevier - Publisher Connector Theoretical Computer Science ELSEVIER Theoretical Computer Science 161 (1996) 141-156 On the language of primitive words* H. Petersen *J Universitiit Stuttgart, Institut fiir Informatik, Breitwiesenstr. 20-22, D-70565 Stuttgart, Germany Received April 1994; revised June 1995 Communicated by P. Enjalbert Abstract A word is primitive if it is not a proper power of a shorter word. We prove that the set Q of primitive words over an alphabet is not an unambiguous context-free language. This strengthens the previous result that Q cannot be deterministic context-free. Further we show that the same holds for the set L of Lyndon words. We investigate the complexity of Q and L. We show that there are families of constant-depth, polynomial-size, unbounded fan-in boolean circuits and two-way deterministic pushdown automata recognizing both languages. The latter result implies efficient decidability on the RAM model of computation and we analyze the number of comparisons required for deciding Q. Finally we give a new proof showing a related language not to be context-free, which only relies on properties of semi-linear and regular sets. 1. Introduction This paper presents some further steps towards characterizing the set of primitive words over some fixed alphabet in terms of classical formal language theory and com- plexity. The notion of primitivity of words plays a central role in algebraic coding theory [28] and combinatorial theory of words [23,24]. Recently attention has been drawn to the language Q of all primitive words over an alphabet with at least two symbols.
    [Show full text]
  • Theory of Computation
    Theory of Computation Todd Gaugler December 14, 2011 2 Contents 1 Mathematical Background 5 1.1 Overview . .5 1.2 Number System . .5 1.3 Functions . .6 1.4 Relations . .6 1.5 Recursive Definitions . .8 1.6 Mathematical Induction . .9 2 Languages and Context-Free Grammars 11 2.1 Languages . 11 2.2 Counting the Rational Numbers . 13 2.3 Grammars . 14 2.4 Regular Grammar . 15 3 Normal Forms and Finite Automata 17 3.1 Review of Grammars . 17 3.2 Normal Forms . 18 3.3 Machines . 20 3.3.1 An NFA λ ..................................... 22 4 Regular Languages 23 4.1 Computation . 24 4.2 The Extended Transition Function . 24 4.3 Algorithms . 26 4.3.1 Removing Non-Determinism . 26 4.3.2 State Minimization . 26 4.3.3 Expression Graph . 26 4.4 The Relationship between a Regular Grammar and the Finite Automaton . 26 4.4.1 Building an NFA corresponding to a Regular Grammar . 27 4.4.2 Closure . 27 4.5 Review for the First Exam . 28 4.6 The Pumping Lemma . 28 5 Pushdown Automata and Context-Free Languages 31 5.1 Pushdown Automata . 31 5.2 Variations on the PDA Theme . 34 5.3 Acceptance of Context-Free Languages . 36 3 CONTENTS CONTENTS 5.4 The Pumping Lemma for Context-Free Languages . 36 5.5 Closure Properties of Context- Free Languages . 37 6 Turing Machines 39 6.1 The Standard Turing Machine . 39 6.2 Turing Machines as Language Acceptors . 40 6.3 Alternative Acceptance Criteria . 41 6.4 Multitrack Machines . 42 6.5 Two-Way Tape Machines .
    [Show full text]
  • Pattern Selector Grammars and Several Parsing Algorithms in the Context-Free Style
    View metadata, citation and similar papers at core.ac.uk brought to you by CORE provided by Elsevier - Publisher Connector JOURNAL OF COMPUTER AND SYSTEM SCIENCES 30, 249-273 (1985) Pattern Selector Grammars and Several Parsing Algorithms in the Context-free Style J. GONCZAROWSKI AND E. SHAMIR* Institute of Mathematics and Computer Science, The Hebrew University of Jerusalem, Jerusalem 91904, Israel Received March 30, 1982; accepted March 5, 1985 Pattern selector grammars are defined in general. We concentrate on the study of special grammars, the pattern selectors of which contain precisely k “one% (0*( 10*)k) or k adjacent “one? (O*lkO*). This means that precisely k symbols (resp. k adjacent symbols) in each sen- tential form are rewritten. The main results concern parsing algorithms and the complexity of the membership problem. We first obtain a polynomial bound on the shortest derivation and hence an NP time bound for parsing. In the case k = 2, we generalize the well-known context- free dynamic programming type algorithms, which run in polynomial time. It is shown that the generated languages, for k = 2, are log-space reducible to the context-free languages. The membership problem is thus solvable in log2 space. 0 1985 Academic Press, Inc. 1. INTRODUCTION The parsing and membership testing algorithms for context-free (CF) grammars occupy a peculiar border position in the complexity hierarchy. The dynamic programming algorithm runs in 0(n3) steps [21], but more relined methods reduce the problem to matrix multiplication with O(n*+‘) run-time, where a < 1 ([20]. Earley’s algorithm runs in time O(n*) for grammars with bounded ambiguity [4].
    [Show full text]
  • Comparisons of Parikh's Condition
    J. Lopez, G. Ramos, and R. Morales, \Comparaci´onde la Condici´onde Parikh con algunas Condiciones de los Lenguajes de Contexto Libre", II Jornadas de Inform´atica y Autom´atica, pp. 305-314, 1996. NICS Lab. Publications: https://www.nics.uma.es/publications COMPARISONS OF PARIKH’S CONDITION TO OTHER CONDITIONS FOR CONTEXT-FREE LANGUAGES G. Ramos-Jiménez, J. López-Muñoz and R. Morales-Bueno E.T.S. de Ingeniería Informática - Universidad de Málaga Dpto. Lenguajes y Ciencias de la Computación P.O.B. 4114, 29080 - Málaga (SPAIN) e-mail: [email protected] Abstract: In this paper we first compare Parikh’s condition to various pumping conditions - Bar-Hillel’s pumping lemma, Ogden’s condition and Bader-Moura’s condition; secondly, to interchange condition; and finally, to Sokolowski’s and Grant’s conditions. In order to carry out these comparisons we present some properties of Parikh’s languages. The main result is the orthogonality of the previously mentioned conditions and Parikh’s condition. Keywords: Context-Free Languages, Parikh’s Condition, Pumping Lemmas, Interchange Condition, Sokolowski’s and Grant’s Condition. 1. INTRODUCTION The context-free grammars and the family of languages they describe, context free languages, were initially defined to formalize the grammatical properties of natural languages. Afterwards, their considerable practical importance was noticed, specially for defining programming languages, formalizing the notion of parsing, simplifying the translation of programming languages and in other string-processing applications. It’s very useful to discover the internal structure of a formal language class during its study. The determination of structural properties allows us to increase our knowledge about this language class.
    [Show full text]
  • Extended Finite Automata Over Groups
    View metadata, citation and similar papers at core.ac.uk brought to you by CORE provided by Elsevier - Publisher Connector Discrete Applied Mathematics 108 (2001) 287–300 Extended ÿnite automata over groups Victor Mitranaa;∗;1, Ralf Stiebeb aFaculty of Mathematics, University of Bucharest, Str. Academiei 14, 70109, Bucharest, Romania bFaculty of Computer Science, University of Magdeburg, P.O. Box 4120, D-39016, Magdeburg, Germany Received 18 November 1998; revised 4 October 1999; accepted 31 January 2000 Abstract Some results from Dassow and Mitrana (Internat. J. Comput. Algebra (2000)), Griebach (Theoret. Comput. Sci. 7 (1978) 311) and Ibarra et al. (Theoret. Comput. Sci. 2 (1976) 271) are generalized for ÿnite automata over arbitrary groups. The closure properties of these automata are poorer and the accepting power is smaller when abelian groups are considered. We prove that the addition of any abelian group to a ÿnite automaton is less powerful than the addition of the multiplicative group of rational numbers. Thus, each language accepted by a ÿnite au- tomaton over an abelian group is actually a unordered vector language. Characterizations of the context-free and recursively enumerable languages classes are set up in the case of non-abelian groups. We investigate also deterministic ÿnite automata over groups, especially over abelian groups. ? 2001 Elsevier Science B.V. All rights reserved. Keywords: Finite automata over groups; Closure properties; Accepting capacity; Interchange lemma; Free groups 1. Introduction One of the oldest and most investigated device in the automata theory is the ÿnite automaton. Many fundamental properties have been established and many problems are still open.
    [Show full text]
  • Automata Theory and Formal Languages
    Alberto Pettorossi Automata Theory and Formal Languages Third Edition ARACNE Contents Preface 7 Chapter 1. Formal Grammars and Languages 9 1.1. Free Monoids 9 1.2. Formal Grammars 10 1.3. The Chomsky Hierarchy 13 1.4. Chomsky Normal Form and Greibach Normal Form 19 1.5. Epsilon Productions 20 1.6. Derivations in Context-Free Grammars 24 1.7. Substitutions and Homomorphisms 27 Chapter 2. Finite Automata and Regular Grammars 29 2.1. Deterministic and Nondeterministic Finite Automata 29 2.2. Nondeterministic Finite Automata and S-extended Type 3 Grammars 33 2.3. Finite Automata and Transition Graphs 35 2.4. Left Linear and Right Linear Regular Grammars 39 2.5. Finite Automata and Regular Expressions 44 2.6. Arden Rule 56 2.7. Equations Between Regular Expressions 57 2.8. Minimization of Finite Automata 59 2.9. Pumping Lemma for Regular Languages 72 2.10. A Parser for Regular Languages 74 2.10.1. A Java Program for Parsing Regular Languages 82 2.11. Generalizations of Finite Automata 90 2.11.1. Moore Machines 91 2.11.2. Mealy Machines 91 2.11.3. Generalized Sequential Machines 92 2.12. Closure Properties of Regular Languages 94 2.13. Decidability Properties of Regular Languages 96 Chapter 3. Pushdown Automata and Context-Free Grammars 99 3.1. Pushdown Automata and Context-Free Languages 99 3.2. From PDA’s to Context-Free Grammars and Back: Some Examples 111 3.3. Deterministic PDA’s and Deterministic Context-Free Languages 117 3.4. Deterministic PDA’s and Grammars in Greibach Normal Form 121 3.5.
    [Show full text]
  • Context-Sensitive Grammars and Linear- Bounded Automata
    I. J. Computer Network and Information Security, 2016, 1, 61-66 Published Online January 2016 in MECS (http://www.mecs-press.org/) DOI: 10.5815/ijcnis.2016.01.08 Context-Sensitive Grammars and Linear- Bounded Automata Prem Nath The Patent Office, CP-2, Sector-5, Salt Lake, Kolkata-700091, India Email: [email protected] Abstract—Linear-bounded automata (LBA) accept The head moves left or right on the tape utilizing finite context-sensitive languages (CSLs) and CSLs are number of states. A finite contiguous portion of the tape generated by context-sensitive grammars (CSGs). So, for whose length is a linear function of the length of the every CSG/CSL there is a LBA. A CSG is converted into initial input can be accessed by the read/write head. This normal form like Kuroda normal form (KNF) and then limitation makes LBA a more accurate model of corresponding LBA is designed. There is no algorithm or computers that actually exists than a Turing machine in theorem for designing a linear-bounded automaton (LBA) some respects. for a context-sensitive grammar without converting the LBA are designed to use limited storage (limited tape). grammar into some kind of normal form like Kuroda So, as a safety feature, we shall employ end markers normal form (KNF). I have proposed an algorithm for ($ on the left and on the right) on tape and the head this purpose which does not require any modification or never goes past these markers. This will ensure that the normalization of a CSG. storage bound is maintained and helps to keep LBA from leaving their tape.
    [Show full text]
  • Position-And-Length-Dependent Context-Free Grammars – a New Type of Restricted Rewriting
    Position-and-Length-Dependent Context-Free Grammars – A New Type of Restricted Rewriting fCFL flCFL fldCFL eREG fedREG REG feREG CFL lCFL feCFL fedCFL fledCFL fleCFL fREG eCFL leCFL ledCFL Vom Fachbereich Informatik der Technischen Universität Kaiserslautern zur Erlangung des akademischen Grades Doktor der Naturwissenschaften (Dr. rer. nat) genehmigte Dissertation von Frank Weinberg Dekan: Prof. Dr. Klaus Schneider Vorsitzender der Prüfungskommission: Prof. Dr. Hans Hagen 1. Berichterstatter: Prof. Dr. Markus Nebel 2. Berichterstatter: Prof. Dr. Hening Fernau Datum der wissenschaftlichen Aussprache: 3. März 2014 D 386 Abstract For many decades, the search for language classes that extend the context-free laguages enough to include various languages that arise in practice, while still keeping as many of the useful properties that context-free grammars have – most notably cubic parsing time – has been one of the major areas of research in formal language theory. In this thesis we add a new family of classes to this field, namely position-and-length- dependent context-free grammars. Our classes use the approach of regulated rewriting, where derivations in a context-free base grammar are allowed or forbidden based on, e.g., the sequence of rules used in a derivation or the sentential forms, each rule is applied to. For our new classes we look at the yield of each rule application, i.e. the subword of the final word that eventually is derived from the symbols introduced by the rule application. The position and length of the yield in the final word define the position and length of the rule application and each rule is associated a set of positions and lengths where it is allowed to be applied.
    [Show full text]