Mildly Context-Sensitive Grammar Formalisms: Introduction
|
|
- Annabella Hill
- 6 years ago
- Views:
Transcription
1 CFG nd nturl lnguges (1) Mildly Context-ensitive Grmmr Formlisms: Introduction Lur Kllmeyer Heinrich-Heine-Universität Düsseldorf A context-free grmmr (CFG) is set of rewriting rules tht tell us how to replce non-terminl y sequence of non-terminl nd terminl symols. Exmple: The string lnguge generted y this grmmr is { n n n 1}. ommersemester 2011 Grmmr Formlisms 1 Introduction Grmmr Formlisms 3 Introduction CFG nd nturl lnguges (2) mple CFG G telescope : Overview 1. CFG nd nturl lnguges 2. Polynomil extensions of CFG 3. Bsic definitions NP VP NP D N VP VP PP V NP N N PP PP P NP N mn girl telescope D the N John P with V sw Grmmr Formlisms 2 Introduction Grmmr Formlisms 4 Introduction
2 CFG nd nturl lnguges (3) Context-free lnguges (CFLs) cn e recognized in polynomil time (O(n 3 )); re ccepted y push-down utomt; hve nice closure properties (e.g., closure under homomorphisms, intersection with regulr lnguges...); stisfy pumping lemm; cn descrie nested dependencies ({ww R w T }). (Hopcroft nd Ullmn, 1979) Grmmr Formlisms 5 Introduction CFG nd nturl lnguges (5) wiss Germn: (2) (3)... ds mer em Hns es huus hälfed striiche... tht we Hns Dt house Acc helped pint... tht we helped Hns pint the house... ds mer d chind em Hns es huus lönd hälfe striiche... tht we the children Acc Hns Dt house Acc let help pint... tht we let the children help Hns pint the house wiss Germn uses cse mrking nd displys cross-seril dependencies. (hieer, 1985) shows tht wiss Germn is not context-free. Grmmr Formlisms 7 Introduction CFG nd nturl lnguges (4) Question: Is CFG powerful enough to descrie ll nturl lnguge phenome? Answer: No. There re constructions in nturl lnguges tht cnnot e dequtely descried with context-free grmmr. Exmple: cross-seril dependencies in Dutch nd in wiss Germn. Dutch: (1)... dt Wim Jn Mrie de kinderen zg helpen leren zwemmen... tht Wim Jn Mrie the children sw help tech swim... tht Wim sw Jn help Mrie tech the children to swim CFG nd nturl lnguges (6) In generl, ecuse of the closure properties, the following holds: A formlism tht cn generte cross-seril dependencies cn lso generte the copy lnguge {ww w {, } }. The copy lnguge is not context-free. Therefore we re interested in extensions of CFG in order to descrie ll nturl lnguge phenomen. Grmmr Formlisms 6 Introduction Grmmr Formlisms 8 Introduction
3 CFG nd nturl lnguges (7) Polynomil extensions of CFG (2) Ide (Joshi, 1985): chrcterize the mount of context-sensitivity necessry for nturl lnguges. Mildly context-sensitive formlisms hve the following properties: 1. They generte (t lest) ll CFLs. 2. They cn descrie limited mount of cross-seril dependencies. In other words, there is n 2 up to which the formlism cn generte ll string lnguges {w n w T }. 3. They re polynomilly prsle. 4. Their string lnguges re of constnt growth. In other words, the length of the words generted y the grmmr grows in liner wy, e.g., { 2n n 0} does not hve tht property. Exmple: TAG derivtion of : Grmmr Formlisms 9 Introduction Grmmr Formlisms 11 Introduction Polynomil extensions of CFG (1) Tree Adjoining Grmmrs (TAG), (Joshi, Levy, nd Tkhshi, 1975; Joshi nd ches, 1997): Tree-rewriting grmmr. Extension of CFG tht llows to replce not only leves ut lso internl nodes with new trees. Cn generte the copy lnguge. Exmple: TAG for the copy lnguge Grmmr Formlisms 10 Introduction Polynomil extensions of CFG (3) Liner Context-free rewriting systems (LCFR) nd the equivlent Multiple Context-Free Grmmrs (MCFG), (Vijy-hnker, Weir, nd Joshi, 1987; Weir, 1988; eki et l., 1991) Ide: extension of CFG where non-terminls cn spn tuples of non-djcent strings. Exmple: yield(a) = n n, c n d n, with n 1. The rewriting rules tell us how to compute the spn of the lefthnd side non-terminl from the spns of the righthnd side non-terminls. A(, cd) ε A(X, cy d) A(X, Y ) (XY ) A(X, Y ) Generted string lnguge: { n n c n d n n 1}. LCFR is more powerful thn TAG ut still mildly context-sensitive. Grmmr Formlisms 12 Introduction
4 Polynomil extensions of CFG (4) Rnge Conctention Grmmr (RCG) (Boullier, 2000) RCG contins cluses of the form A(...) A 1 (...)...A k (...) where A, A 1,..., A k re predictes. Their rguments re words over the terminl nd nonterminl lphets. Intuition: The predictes chrcterize properties of strings. A derivtion strts with (w) where is strt predicte. If this cn e reduced to the empty word (i.e., property is true for w), then w is in the lnguge. Exmple: RCG for { 2n n 0}. () ε (XY ) E(X, Y )(X) E(, ) ε E(X, Y ) E(X, Y ) Grmmr Formlisms 13 Introduction Polynomil extensions of CFG (6) ummry: CFG TAG LCFR, MCFG, simple RCG RCG (= PTIME) mildly context-sensitive In this course, we re interested in mildly context-sensitive formlisms. Grmmr Formlisms 15 Introduction Polynomil extensions of CFG (5) RCGs re simple if the rguments in the right-hnd sides of the cluses re single vriles. no vrile ppers more thn once in the left-hnd side of cluse or more thn once in the right-hnd side of cluse. ech vrile occurring in the left-hnd side of cluse occurs lso in its right-hnd side nd vice vers. imple RCG re equivlent to LCFR nd MCFG. RCG in generl re more powerful; they generte exctly the clss PTIME of polynomilly prsle lnguges. (They properly include the clss of MC formlisms.) Bsic Definitions: Lnguges (1) Definition 1 (Alphet, word, lnguge) 1. An lphet is nonempty finite set X. 2. A string x 1...x n with n 1 nd x i X for 1 i n is clled nonempty word on the lphet X. X + is defined s the set of ll nonempty words on X. 3. A new element ε / X + is dded: X := x + {ε}. For ech w X, the conctention of w nd ε is defined s follows: wε = εw = w. ε is clled the empty word, nd ech w X is clled word on X. 4. A set L is clled lnguge iff there is n lphet X such tht L X. Grmmr Formlisms 14 Introduction Grmmr Formlisms 16 Introduction
5 Bsic Definitions: Lnguges (2) Definition 2 (Homomorphism) For two lphets X nd Y, function f : X Y is homomorphism iff for ll v, w X : f(vw) = f(v)f(w). Definition 3 (Length of word) Let X e n lphet, w X. 1. The length of w, w is defined s follows: if w = ε, then w = 0. If w = xw for some x X, then w = 1 + w. 2. For every X, we define w s the numer of s occurring in w: If w = ε, then w = 0, if w = w then w = w + 1 nd if w = w for some X \ {}, then w = w. Grmmr Formlisms 17 Introduction Bsic Definitions: CFG (2) Definition 5 (Lnguge of CFG) Let G = N, T, P, e CFG. The (string) lnguge L(G) of G is the set {w T w} where for w, w (N T) : w w iff there is A α P nd there re v, u (N T) such tht w = vau nd w = vαu. is the reflexive trnsitive closure of : w 0 w for ll w (N T), nd for ll w, w (N T) : w n w iff there is v such tht w v nd v n 1 w. for ll w, w (N T) : w w iff there is i IN such tht w i w. A lnguge L is clled context-free iff there is CFG G such tht L = L(G). Grmmr Formlisms 19 Introduction Bsic Definitions: CFG (1) Definition 4 (Context-free grmmr) A context-free grmmr (CFG) is tuple G = N, T, P, such tht 1. N nd T re disjoint lphets, the nonterminls nd terminls of G, 2. P N (N T) is finite set of productions (lso clled rewriting rules). A production A, α is usully written A α. 3. N is the strt symol. Bsic Definitions: CFG (3) Proposition 1 (Pumping lemm for context-free lnguges) Let L e context-free lnguge. Then there is constnt c such tht for ll w L with w c: w = xv 1 yv 2 z with v 1 v 2 1, v 1 yv 2 c, nd for ll i 0: xv i 1 yvi 2 z L. Grmmr Formlisms 18 Introduction Grmmr Formlisms 20 Introduction
6 Bsic Definitions: CFG (4) Proposition 2 Context-free lnguges re closed under homomorphisms, i.e., for lphets T 1, T 2 nd for every context-free lnguge L 1 T 1 nd every homomorphism h : T 1 T 2, h(l 1 ) = {h(w) w L 1 } is context-free lnguge. Proposition 3 Context-free lnguges re closed under intersection with regulr lnguges, i.e., for every context-free lnguge L nd every regulr lnguge L r, L L r is context-free lnguge. Proposition 4 The copy lnguge {ww w {, } } is not context-free. Bsic Definitions: Trees (2) Definition 7 (Tree) A tree is triple γ = V, E, r such tht V, E is directed grph nd r V is specil node, the root node. γ contins no cycles, i.e., there is no v V such tht v, v E +, only the root r V hs in-degree 0, every vertex v V is ccessile from r, i.e., r, v E, nd ll nodes v V {r} hve in-degree 1. A vertex with out-degree 0 is clled lef. The vertices in tree re lso clled nodes. Grmmr Formlisms 21 Introduction Grmmr Formlisms 23 Introduction Bsic Definitions: Trees (1) Definition 6 (Directed Grph) 1. A directed grph is pir V, E where V is finite set of vertices nd E V V is set of edges. 2. For every v V, we define the in-degree of v s {v V v, v E} nd the out-degree of v s {v V v, v E}. E + is the trnsitive closure of E nd E is the reflexive trnsitive closure of E. Bsic Definitions: Trees (3) Definition 8 (Ordered Tree) A tree is ordered if it hs n dditionl liner precedence reltion V V such tht is irreflexive, ntisymmetric nd trnsitive, for ll v 1, v 2 with { v 1, v 2, v 2, v 1 } E = : either v 1 v 2 or v 2 v 1 nd if there is either v 3, v 1 E with v 3 v 2 or v 4, v 2 E with v 1 v 4, then v 1 v 2, nd nothing else is in. We use Gorn ddresses for nodes in ordered trees: The root ddress is ε, nd the jth child of node with ddress p hs ddress pj. Grmmr Formlisms 22 Introduction Grmmr Formlisms 24 Introduction
7 Bsic Definitions: Trees (4) Definition 9 (Leling) A leling of grph γ = V, E over signture A 1, A 2 is pir of functions l : V A 1 nd g : E A 2 with A 1, A 2 possily distinct. Definition 10 (yntctic tree) Let N nd T e disjoint lphets of non-terminl nd terminl symols. A syntctic tree (over N nd T) is n ordered finite leled tree such tht l(v) N for ech vertex v with out-degree t lest 1 nd l(v) (N T {ε}) for ech lef v. Bsic Definitions: Trees (6) Definition 12 (Wek nd trong Equivlence) Let F 1, F 2 e two grmmr formlisms. F 1 nd F 2 re wekly equivlent iff for ech instnce G 1 of F 1 there is n instnce G 2 of F 2 tht genertes the sme string lnguge nd vice vers. F 1 nd F 2 re strongly equivlent iff for oth formlisms the notion of tree lnguge is defined nd, furthermore, for ech instnce G 1 of F 1 there is n instnce G 2 of F 2 tht genertes the sme tree lnguge nd vice vers. Grmmr Formlisms 25 Introduction Grmmr Formlisms 27 Introduction Bsic Definitions: Trees (5) Definition 11 (Tree Lnguge of CFG) Let G = N, T, P, e CFG. 1. A syntctic tree V, E, r over N nd T is prse tree in G iff l(v) (T {ε}) for ech lef v, for every v 0, v 1,..., v n V, n 1 such tht v 0, v i E for 1 i n nd v i, v i+1 for 1 i < n, l(v 0 ) l(v 1 )...l(v n ) P. 2. A prse tree V, E, r is derivtion tree in G iff l(r) =. 3. The tree lnguge of G is L T (G) = {γ γ is derivtion tree in G} Grmmr Formlisms 26 Introduction References Boullier, Pierre Rnge Conctention Grmmrs. In Proceedings of the ixth Interntionl Workshop on Prsing Technologies (IWPT2000), pges 53 64, Trento, Itly, Ferury. Hopcroft, John E. nd Jeffrey D. Ullmn Introduction to Automt Theory, Lnguges nd Computtion. Addison Wesley. Joshi, Arvind K Tree djoining grmmrs: How much contextsensitivity is required to provide resonle structurl descriptions? In D. Dowty, L. Krttunen, nd A. Zwicky, editors, Nturl Lnguge Prsing. Cmridge University Press, pges Joshi, Arvind K., Leon. Levy, nd Msko Tkhshi Tree Adjunct Grmmrs. Journl of Computer nd ystem cience, 10: Joshi, Arvind K. nd Yves ches Tree-Adjoning Grmmrs. In G. Rozenerg nd A. lom, editors, Hndook of Forml Lnguges. pringer, Berlin, pges Grmmr Formlisms 28 Introduction
8 vitch, Wlter J., Emmon Bch, Willim Mrxh, nd Gil frn-nveh, editors The Forml Complexity of Nturl Lnguge. tudies in Linguistics nd Philosophy. Reidel, Dordrecht, Hollnd. eki, Hiroyuki, Tkhshi Mtsumur, Mmoru Fujii, nd Tdo Ksmi On multiple context-free grmmrs. Theoreticl Computer cience, 88(2): hieer, turt M Evidence ginst the context-freeness of nturl lnguge. Linguistics nd Philosophy, 8: Reprinted in (vitch et l., 1987). Vijy-hnker, K., Dvid J. Weir, nd Arvind K. Joshi Chrcterizing structurl descriptions produced y vrious grmmticl formlisms. In Proceedings of ACL, tnford. Weir, Dvid J Chrcterizing Mildly Context-ensitive Grmmr Formlisms. Ph.D. thesis, University of Pennsylvni. Grmmr Formlisms 29 Introduction
Closure Properties of Regular Languages
Closure Properties of Regulr Lnguges Regulr lnguges re closed under mny set opertions. Let L 1 nd L 2 e regulr lnguges. (1) L 1 L 2 (the union) is regulr. (2) L 1 L 2 (the conctention) is regulr. (3) L
More informationCS 275 Automata and Formal Language Theory
CS 275 utomt nd Forml Lnguge Theory Course Notes Prt II: The Recognition Prolem (II) Chpter II.5.: Properties of Context Free Grmmrs (14) nton Setzer (Bsed on ook drft y J. V. Tucker nd K. Stephenson)
More informationIntroduction to Lexicalized Tree Adjoining Grammar (LTAG)
Introduction to Lexiclized Tree Adjoining Grmmr (LTAG) Mchine Lnguge Processing eminr Jnury 29, 2008 1 Tble of Contents 1.The forml relevnce of LTAG: From CFG to LTAG - Context-Free Grmmrs (CFG) - Lexicliztion,
More informationCS 275 Automata and Formal Language Theory
CS 275 Automt nd Forml Lnguge Theory Course Notes Prt II: The Recognition Problem (II) Chpter II.5.: Properties of Context Free Grmmrs (14) Anton Setzer (Bsed on book drft by J. V. Tucker nd K. Stephenson)
More informationHarvard University Computer Science 121 Midterm October 23, 2012
Hrvrd University Computer Science 121 Midterm Octoer 23, 2012 This is closed-ook exmintion. You my use ny result from lecture, Sipser, prolem sets, or section, s long s you quote it clerly. The lphet is
More information5. (±±) Λ = fw j w is string of even lengthg [ 00 = f11,00g 7. (11 [ 00)± Λ = fw j w egins with either 11 or 00g 8. (0 [ ffl)1 Λ = 01 Λ [ 1 Λ 9.
Regulr Expressions, Pumping Lemm, Right Liner Grmmrs Ling 106 Mrch 25, 2002 1 Regulr Expressions A regulr expression descries or genertes lnguge: it is kind of shorthnd for listing the memers of lnguge.
More informationAUTOMATA AND LANGUAGES. Definition 1.5: Finite Automaton
25. Finite Automt AUTOMATA AND LANGUAGES A system of computtion tht only hs finite numer of possile sttes cn e modeled using finite utomton A finite utomton is often illustrted s stte digrm d d d. d q
More information1.4 Nonregular Languages
74 1.4 Nonregulr Lnguges The number of forml lnguges over ny lphbet (= decision/recognition problems) is uncountble On the other hnd, the number of regulr expressions (= strings) is countble Hence, ll
More informationFinite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018
Finite Automt Theory nd Forml Lnguges TMV027/DIT321 LP4 2018 Lecture 10 An Bove April 23rd 2018 Recp: Regulr Lnguges We cn convert between FA nd RE; Hence both FA nd RE ccept/generte regulr lnguges; More
More informationGrammar. Languages. Content 5/10/16. Automata and Languages. Regular Languages. Regular Languages
5//6 Grmmr Automt nd Lnguges Regulr Grmmr Context-free Grmmr Context-sensitive Grmmr Prof. Mohmed Hmd Softwre Engineering L. The University of Aizu Jpn Regulr Lnguges Context Free Lnguges Context Sensitive
More informationParse trees, ambiguity, and Chomsky normal form
Prse trees, miguity, nd Chomsky norml form In this lecture we will discuss few importnt notions connected with contextfree grmmrs, including prse trees, miguity, nd specil form for context-free grmmrs
More information1.3 Regular Expressions
56 1.3 Regulr xpressions These hve n importnt role in describing ptterns in serching for strings in mny pplictions (e.g. wk, grep, Perl,...) All regulr expressions of lphbet re 1.Ønd re regulr expressions,
More informationCHAPTER 1 Regular Languages. Contents
Finite Automt (FA or DFA) CHAPTE 1 egulr Lnguges Contents definitions, exmples, designing, regulr opertions Non-deterministic Finite Automt (NFA) definitions, euivlence of NFAs nd DFAs, closure under regulr
More informationContext-Free Grammars and Languages
Context-Free Grmmrs nd Lnguges (Bsed on Hopcroft, Motwni nd Ullmn (2007) & Cohen (1997)) Introduction Consider n exmple sentence: A smll ct ets the fish English grmmr hs rules for constructing sentences;
More informationLecture 08: Feb. 08, 2019
4CS4-6:Theory of Computtion(Closure on Reg. Lngs., regex to NDFA, DFA to regex) Prof. K.R. Chowdhry Lecture 08: Fe. 08, 2019 : Professor of CS Disclimer: These notes hve not een sujected to the usul scrutiny
More informationFirst Midterm Examination
24-25 Fll Semester First Midterm Exmintion ) Give the stte digrm of DFA tht recognizes the lnguge A over lphet Σ = {, } where A = {w w contins or } 2) The following DFA recognizes the lnguge B over lphet
More informationFormal languages, automata, and theory of computation
Mälrdlen University TEN1 DVA337 2015 School of Innovtion, Design nd Engineering Forml lnguges, utomt, nd theory of computtion Thursdy, Novemer 5, 14:10-18:30 Techer: Dniel Hedin, phone 021-107052 The exm
More informationTheory of Computation Regular Languages. (NTU EE) Regular Languages Fall / 38
Theory of Computtion Regulr Lnguges (NTU EE) Regulr Lnguges Fll 2017 1 / 38 Schemtic of Finite Automt control 0 0 1 0 1 1 1 0 Figure: Schemtic of Finite Automt A finite utomton hs finite set of control
More informationCSC 311 Theory of Computation
CSC 11 Theory of Computtion Tutoril on DFAs, NFAs, regulr expressions, regulr grmmr, closure of regulr lnguges, context-free grmmrs, non-deterministic push-down utomt, Turing mchines,etc. Tutoril 2 Second
More informationRevision Sheet. (a) Give a regular expression for each of the following languages:
Theoreticl Computer Science (Bridging Course) Dr. G. D. Tipldi F. Bonirdi Winter Semester 2014/2015 Revision Sheet University of Freiurg Deprtment of Computer Science Question 1 (Finite Automt, 8 + 6 points)
More informationTalen en Automaten Test 1, Mon 7 th Dec, h45 17h30
Tlen en Automten Test 1, Mon 7 th Dec, 2015 15h45 17h30 This test consists of four exercises over 5 pges. Explin your pproch, nd write your nswer to ech exercise on seprte pge. You cn score mximum of 100
More informationCISC 4090 Theory of Computation
9/6/28 Stereotypicl computer CISC 49 Theory of Computtion Finite stte mchines & Regulr lnguges Professor Dniel Leeds dleeds@fordhm.edu JMH 332 Centrl processing unit (CPU) performs ll the instructions
More informationCS375: Logic and Theory of Computing
CS375: Logic nd Theory of Computing Fuhu (Frnk) Cheng Deprtment of Computer Science University of Kentucky 1 Tle of Contents: Week 1: Preliminries (set lger, reltions, functions) (red Chpters 1-4) Weeks
More informationExercises Chapter 1. Exercise 1.1. Let Σ be an alphabet. Prove wv = w + v for all strings w and v.
1 Exercises Chpter 1 Exercise 1.1. Let Σ e n lphet. Prove wv = w + v for ll strings w nd v. Prove # (wv) = # (w)+# (v) for every symol Σ nd every string w,v Σ. Exercise 1.2. Let w 1,w 2,...,w k e k strings,
More informationTheory of Computation Regular Languages
Theory of Computtion Regulr Lnguges Bow-Yw Wng Acdemi Sinic Spring 2012 Bow-Yw Wng (Acdemi Sinic) Regulr Lnguges Spring 2012 1 / 38 Schemtic of Finite Automt control 0 0 1 0 1 1 1 0 Figure: Schemtic of
More informationCS 314 Principles of Programming Languages
C 314 Principles of Progrmming Lnguges Lecture 6: LL(1) Prsing Zheng (Eddy) Zhng Rutgers University Ferury 5, 2018 Clss Informtion Homework 2 due tomorrow. Homework 3 will e posted erly next week. 2 Top
More informationDesigning finite automata II
Designing finite utomt II Prolem: Design DFA A such tht L(A) consists of ll strings of nd which re of length 3n, for n = 0, 1, 2, (1) Determine wht to rememer out the input string Assign stte to ech of
More informationI. Theory of Automata II. Theory of Formal Languages III. Theory of Turing Machines
CI 3104 /Winter 2011: Introduction to Forml Lnguges Chpter 16: Non-Context-Free Lnguges Chpter 16: Non-Context-Free Lnguges I. Theory of utomt II. Theory of Forml Lnguges III. Theory of Turing Mchines
More informationMinimal DFA. minimal DFA for L starting from any other
Miniml DFA Among the mny DFAs ccepting the sme regulr lnguge L, there is exctly one (up to renming of sttes) which hs the smllest possile numer of sttes. Moreover, it is possile to otin tht miniml DFA
More informationCHAPTER 1 Regular Languages. Contents. definitions, examples, designing, regular operations. Non-deterministic Finite Automata (NFA)
Finite Automt (FA or DFA) CHAPTER Regulr Lnguges Contents definitions, exmples, designing, regulr opertions Non-deterministic Finite Automt (NFA) definitions, equivlence of NFAs DFAs, closure under regulr
More informationFor convenience, we rewrite m2 s m2 = m m m ; where m is repeted m times. Since xyz = m m m nd jxyj»m, we hve tht the string y is substring of the fir
CSCI 2400 Models of Computtion, Section 3 Solutions to Homework 4 Problem 1. ll the solutions below refer to the Pumping Lemm of Theorem 4.8, pge 119. () L = f n b l k : k n + lg Let's ssume for contrdiction
More informationCMPSCI 250: Introduction to Computation. Lecture #31: What DFA s Can and Can t Do David Mix Barrington 9 April 2014
CMPSCI 250: Introduction to Computtion Lecture #31: Wht DFA s Cn nd Cn t Do Dvid Mix Brrington 9 April 2014 Wht DFA s Cn nd Cn t Do Deterministic Finite Automt Forml Definition of DFA s Exmples of DFA
More informationCS 301. Lecture 04 Regular Expressions. Stephen Checkoway. January 29, 2018
CS 301 Lecture 04 Regulr Expressions Stephen Checkowy Jnury 29, 2018 1 / 35 Review from lst time NFA N = (Q, Σ, δ, q 0, F ) where δ Q Σ P (Q) mps stte nd n lphet symol (or ) to set of sttes We run n NFA
More informationPostprint.
http://www.div-portl.org Postprint This is the ccepted version of pper presented t Eighth Workshop on Non-Clssicl Models of utomt nd pplictions(ncm 2016). Cittion for the originl pulished pper: ensch,
More informationFinite Automata-cont d
Automt Theory nd Forml Lnguges Professor Leslie Lnder Lecture # 6 Finite Automt-cont d The Pumping Lemm WEB SITE: http://ingwe.inghmton.edu/ ~lnder/cs573.html Septemer 18, 2000 Exmple 1 Consider L = {ww
More informationFundamentals of Computer Science
Fundmentls of Computer Science Chpter 3: NFA nd DFA equivlence Regulr expressions Henrik Björklund Umeå University Jnury 23, 2014 NFA nd DFA equivlence As we shll see, it turns out tht NFA nd DFA re equivlent,
More informationFirst Midterm Examination
Çnky University Deprtment of Computer Engineering 203-204 Fll Semester First Midterm Exmintion ) Design DFA for ll strings over the lphet Σ = {,, c} in which there is no, no nd no cc. 2) Wht lnguge does
More informationSpeech Recognition Lecture 2: Finite Automata and Finite-State Transducers
Speech Recognition Lecture 2: Finite Automt nd Finite-Stte Trnsducers Eugene Weinstein Google, NYU Cournt Institute eugenew@cs.nyu.edu Slide Credit: Mehryr Mohri Preliminries Finite lphet, empty string.
More informationChapter Five: Nondeterministic Finite Automata. Formal Language, chapter 5, slide 1
Chpter Five: Nondeterministic Finite Automt Forml Lnguge, chpter 5, slide 1 1 A DFA hs exctly one trnsition from every stte on every symol in the lphet. By relxing this requirement we get relted ut more
More informationFormal Languages and Automata
Moile Computing nd Softwre Engineering p. 1/5 Forml Lnguges nd Automt Chpter 2 Finite Automt Chun-Ming Liu cmliu@csie.ntut.edu.tw Deprtment of Computer Science nd Informtion Engineering Ntionl Tipei University
More informationSpeech Recognition Lecture 2: Finite Automata and Finite-State Transducers. Mehryar Mohri Courant Institute and Google Research
Speech Recognition Lecture 2: Finite Automt nd Finite-Stte Trnsducers Mehryr Mohri Cournt Institute nd Google Reserch mohri@cims.nyu.com Preliminries Finite lphet Σ, empty string. Set of ll strings over
More informationPART 2. REGULAR LANGUAGES, GRAMMARS AND AUTOMATA
PART 2. REGULAR LANGUAGES, GRAMMARS AND AUTOMATA RIGHT LINEAR LANGUAGES. Right Liner Grmmr: Rules of the form: A α B, A α A,B V N, α V T + Left Liner Grmmr: Rules of the form: A Bα, A α A,B V N, α V T
More informationa,b a 1 a 2 a 3 a,b 1 a,b a,b 2 3 a,b a,b a 2 a,b CS Determinisitic Finite Automata 1
CS4 45- Determinisitic Finite Automt -: Genertors vs. Checkers Regulr expressions re one wy to specify forml lnguge String Genertor Genertes strings in the lnguge Deterministic Finite Automt (DFA) re nother
More informationChapter 2 Finite Automata
Chpter 2 Finite Automt 28 2.1 Introduction Finite utomt: first model of the notion of effective procedure. (They lso hve mny other pplictions). The concept of finite utomton cn e derived y exmining wht
More informationLet's start with an example:
Finite Automt Let's strt with n exmple: Here you see leled circles tht re sttes, nd leled rrows tht re trnsitions. One of the sttes is mrked "strt". One of the sttes hs doule circle; this is terminl stte
More informationNormal Forms for Context-free Grammars
Norml Forms for Context-free Grmmrs 1 Linz 6th, Section 6.2 wo Importnt Norml Forms, pges 171--178 2 Chomsky Norml Form All productions hve form: A BC nd A vrile vrile terminl 3 Exmples: S AS S AS S S
More informationCS 330 Formal Methods and Models
CS 330 Forml Methods nd Models Dn Richrds, George Mson University, Spring 2017 Quiz Solutions Quiz 1, Propositionl Logic Dte: Ferury 2 1. Prove ((( p q) q) p) is tutology () (3pts) y truth tle. p q p q
More informationɛ-closure, Kleene s Theorem,
DEGefW5wiGH2XgYMEzUKjEmtCDUsRQ4d 1 A nice pper relevnt to this course is titled The Glory of the Pst 2 NICTA Resercher, Adjunct t the Austrlin Ntionl University nd Griffith University ɛ-closure, Kleene
More information1 Nondeterministic Finite Automata
1 Nondeterministic Finite Automt Suppose in life, whenever you hd choice, you could try oth possiilities nd live your life. At the end, you would go ck nd choose the one tht worked out the est. Then you
More informationCoalgebra, Lecture 15: Equations for Deterministic Automata
Colger, Lecture 15: Equtions for Deterministic Automt Julin Slmnc (nd Jurrin Rot) Decemer 19, 2016 In this lecture, we will study the concept of equtions for deterministic utomt. The notes re self contined
More informationParsing Directed Acyclic Graphs with Range Concatenation Grammars
Prsing Directed Acyclic Grphs with Rnge Conctention Grmmrs Pierre Boullier nd Benoît Sgot Alpge, INRIA Pris-Rocquencourt & Université Pris 7 Domine de Voluceu Rocquencourt, BP 105 78153 Le Chesny Cedex,
More informationHomework 3 Solutions
CS 341: Foundtions of Computer Science II Prof. Mrvin Nkym Homework 3 Solutions 1. Give NFAs with the specified numer of sttes recognizing ech of the following lnguges. In ll cses, the lphet is Σ = {,1}.
More informationThe University of Nottingham SCHOOL OF COMPUTER SCIENCE A LEVEL 2 MODULE, SPRING SEMESTER LANGUAGES AND COMPUTATION ANSWERS
The University of Nottinghm SCHOOL OF COMPUTER SCIENCE LEVEL 2 MODULE, SPRING SEMESTER 2016 2017 LNGUGES ND COMPUTTION NSWERS Time llowed TWO hours Cndidtes my complete the front cover of their nswer ook
More informationAssignment 1 Automata, Languages, and Computability. 1 Finite State Automata and Regular Languages
Deprtment of Computer Science, Austrlin Ntionl University COMP2600 Forml Methods for Softwre Engineering Semester 2, 206 Assignment Automt, Lnguges, nd Computility Smple Solutions Finite Stte Automt nd
More informationAutomata and Languages
Automt nd Lnguges Prof. Mohmed Hmd Softwre Engineering Lb. The University of Aizu Jpn Grmmr Regulr Grmmr Context-free Grmmr Context-sensitive Grmmr Regulr Lnguges Context Free Lnguges Context Sensitive
More informationTHEOTY OF COMPUTATION
Pushdown utomt nd Prsing lgorithms: Pushdown utomt nd context-free lnguges; Deterministic PDNondeterministic PD- Equivlence of PD nd CFG-closure properties of CFL. PUSHDOWN UTOMT ppliction: Regulr lnguges
More informationRegular expressions, Finite Automata, transition graphs are all the same!!
CSI 3104 /Winter 2011: Introduction to Forml Lnguges Chpter 7: Kleene s Theorem Chpter 7: Kleene s Theorem Regulr expressions, Finite Automt, trnsition grphs re ll the sme!! Dr. Neji Zgui CSI3104-W11 1
More informationName Ima Sample ASU ID
Nme Im Smple ASU ID 2468024680 CSE 355 Test 1, Fll 2016 30 Septemer 2016, 8:35-9:25.m., LSA 191 Regrding of Midterms If you elieve tht your grde hs not een dded up correctly, return the entire pper to
More informationFABER Formal Languages, Automata and Models of Computation
DVA337 FABER Forml Lnguges, Automt nd Models of Computtion Lecture 5 chool of Innovtion, Design nd Engineering Mälrdlen University 2015 1 Recp of lecture 4 y definition suset construction DFA NFA stte
More informationNondeterminism and Nodeterministic Automata
Nondeterminism nd Nodeterministic Automt 61 Nondeterminism nd Nondeterministic Automt The computtionl mchine models tht we lerned in the clss re deterministic in the sense tht the next move is uniquely
More informationTable of contents: Lecture N Summary... 3 What does automata mean?... 3 Introduction to languages... 3 Alphabets... 3 Strings...
Tle of contents: Lecture N0.... 3 ummry... 3 Wht does utomt men?... 3 Introduction to lnguges... 3 Alphets... 3 trings... 3 Defining Lnguges... 4 Lecture N0. 2... 7 ummry... 7 Kleene tr Closure... 7 Recursive
More informationCS 310 (sec 20) - Winter Final Exam (solutions) SOLUTIONS
CS 310 (sec 20) - Winter 2003 - Finl Exm (solutions) SOLUTIONS 1. (Logic) Use truth tles to prove the following logicl equivlences: () p q (p p) (q q) () p q (p q) (p q) () p q p q p p q q (q q) (p p)
More informationHomework 4. 0 ε 0. (00) ε 0 ε 0 (00) (11) CS 341: Foundations of Computer Science II Prof. Marvin Nakayama
CS 341: Foundtions of Computer Science II Prof. Mrvin Nkym Homework 4 1. UsetheproceduredescriedinLemm1.55toconverttheregulrexpression(((00) (11)) 01) into n NFA. Answer: 0 0 1 1 00 0 0 11 1 1 01 0 1 (00)
More informationSWEN 224 Formal Foundations of Programming WITH ANSWERS
T E W H A R E W Ā N A N G A O T E Ū P O K O O T E I K A A M Ā U I VUW V I C T O R I A UNIVERSITY OF WELLINGTON Time Allowed: 3 Hours EXAMINATIONS 2011 END-OF-YEAR SWEN 224 Forml Foundtions of Progrmming
More informationNFAs and Regular Expressions. NFA-ε, continued. Recall. Last class: Today: Fun:
CMPU 240 Lnguge Theory nd Computtion Spring 2019 NFAs nd Regulr Expressions Lst clss: Introduced nondeterministic finite utomt with -trnsitions Tody: Prove n NFA- is no more powerful thn n NFA Introduce
More information1 From NFA to regular expression
Note 1: How to convert DFA/NFA to regulr expression Version: 1.0 S/EE 374, Fll 2017 Septemer 11, 2017 In this note, we show tht ny DFA cn e converted into regulr expression. Our construction would work
More informationThoery of Automata CS402
Thoery of Automt C402 Theory of Automt Tle of contents: Lecture N0. 1... 4 ummry... 4 Wht does utomt men?... 4 Introduction to lnguges... 4 Alphets... 4 trings... 4 Defining Lnguges... 5 Lecture N0. 2...
More informationFinite-State Automata: Recap
Finite-Stte Automt: Recp Deepk D Souz Deprtment of Computer Science nd Automtion Indin Institute of Science, Bnglore. 09 August 2016 Outline 1 Introduction 2 Forml Definitions nd Nottion 3 Closure under
More informationConvert the NFA into DFA
Convert the NF into F For ech NF we cn find F ccepting the sme lnguge. The numer of sttes of the F could e exponentil in the numer of sttes of the NF, ut in prctice this worst cse occurs rrely. lgorithm:
More informationCSC 473 Automata, Grammars & Languages 11/9/10
CSC 473 utomt, Grmmrs & Lnguges 11/9/10 utomt, Grmmrs nd Lnguges Discourse 06 Decidbility nd Undecidbility Decidble Problems for Regulr Lnguges Theorem 4.1: (embership/cceptnce Prob. for DFs) = {, w is
More informationTypes of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. Comparing DFAs and NFAs (cont.) Finite Automata 2
CMSC 330: Orgniztion of Progrmming Lnguges Finite Automt 2 Types of Finite Automt Deterministic Finite Automt () Exctly one sequence of steps for ech string All exmples so fr Nondeterministic Finite Automt
More informationOverview HC9. Parsing: Top-Down & LL(1) Context-Free Grammars (1) Introduction. CFGs (3) Context-Free Grammars (2) Vertalerbouw HC 9: Ch.
Overview H9 Vertlerouw H 9: Prsing: op-down & LL(1) do 3 mei 2001 56 heo Ruys h. 8 - Prsing 8.1 ontext-free Grmmrs 8.2 op-down Prsing 8.3 LL(1) Grmmrs See lso [ho, Sethi & Ullmn 1986] for more thorough
More informationRegular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Kleene-*
Regulr Expressions (RE) Regulr Expressions (RE) Empty set F A RE denotes the empty set Opertion Nottion Lnguge UNIX Empty string A RE denotes the set {} Alterntion R +r L(r ) L(r ) r r Symol Alterntion
More informationDeterministic Finite Automata
Finite Automt Deterministic Finite Automt H. Geuvers nd J. Rot Institute for Computing nd Informtion Sciences Version: fll 2016 J. Rot Version: fll 2016 Tlen en Automten 1 / 21 Outline Finite Automt Finite
More informationCMSC 330: Organization of Programming Languages
CMSC 330: Orgniztion of Progrmming Lnguges Finite Automt 2 CMSC 330 1 Types of Finite Automt Deterministic Finite Automt (DFA) Exctly one sequence of steps for ech string All exmples so fr Nondeterministic
More informationFormal Languages and Automata Theory. D. Goswami and K. V. Krishna
Forml Lnguges nd Automt Theory D. Goswmi nd K. V. Krishn Novemer 5, 2010 Contents 1 Mthemticl Preliminries 3 2 Forml Lnguges 4 2.1 Strings............................... 5 2.2 Lnguges.............................
More informationCSE : Exam 3-ANSWERS, Spring 2011 Time: 50 minutes
CSE 260-002: Exm 3-ANSWERS, Spring 20 ime: 50 minutes Nme: his exm hs 4 pges nd 0 prolems totling 00 points. his exm is closed ook nd closed notes.. Wrshll s lgorithm for trnsitive closure computtion is
More informationLecture 6 Regular Grammars
Lecture 6 Regulr Grmmrs COT 4420 Theory of Computtion Section 3.3 Grmmr A grmmr G is defined s qudruple G = (V, T, S, P) V is finite set of vribles T is finite set of terminl symbols S V is specil vrible
More informationCS 373, Spring Solutions to Mock midterm 1 (Based on first midterm in CS 273, Fall 2008.)
CS 373, Spring 29. Solutions to Mock midterm (sed on first midterm in CS 273, Fll 28.) Prolem : Short nswer (8 points) The nswers to these prolems should e short nd not complicted. () If n NF M ccepts
More information3 Regular expressions
3 Regulr expressions Given n lphet Σ lnguge is set of words L Σ. So fr we were le to descrie lnguges either y using set theory (i.e. enumertion or comprehension) or y n utomton. In this section we shll
More informationTypes of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. NFA for (a b)*abb.
CMSC 330: Orgniztion of Progrmming Lnguges Finite Automt 2 Types of Finite Automt Deterministic Finite Automt () Exctly one sequence of steps for ech string All exmples so fr Nondeterministic Finite Automt
More informationCS 275 Automata and Formal Language Theory
CS 275 Automt nd Forml Lnguge Theory Course Notes Prt II: The Recognition Problem (II) Chpter II.6.: Push Down Automt Remrk: This mteril is no longer tught nd not directly exm relevnt Anton Setzer (Bsed
More informationFormal Languages Simplifications of CFGs
Forml Lnguges implifictions of CFGs ubstitution Rule Equivlent grmmr b bc ubstitute b bc bbc b 2 ubstitution Rule b bc bbc ubstitute b bc bbc bc Equivlent grmmr 3 In generl: xz y 1 ubstitute y 1 xz xy1z
More informationLecture 09: Myhill-Nerode Theorem
CS 373: Theory of Computtion Mdhusudn Prthsrthy Lecture 09: Myhill-Nerode Theorem 16 Ferury 2010 In this lecture, we will see tht every lnguge hs unique miniml DFA We will see this fct from two perspectives
More informationThe size of subsequence automaton
Theoreticl Computer Science 4 (005) 79 84 www.elsevier.com/locte/tcs Note The size of susequence utomton Zdeněk Troníček,, Ayumi Shinohr,c Deprtment of Computer Science nd Engineering, FEE CTU in Prgue,
More informationSome Theory of Computation Exercises Week 1
Some Theory of Computtion Exercises Week 1 Section 1 Deterministic Finite Automt Question 1.3 d d d d u q 1 q 2 q 3 q 4 q 5 d u u u u Question 1.4 Prt c - {w w hs even s nd one or two s} First we sk whether
More informationNFAs continued, Closure Properties of Regular Languages
Algorithms & Models of Computtion CS/ECE 374, Fll 2017 NFAs continued, Closure Properties of Regulr Lnguges Lecture 5 Tuesdy, Septemer 12, 2017 Sriel Hr-Peled (UIUC) CS374 1 Fll 2017 1 / 31 Regulr Lnguges,
More informationTutorial Automata and formal Languages
Tutoril Automt nd forml Lnguges Notes for to the tutoril in the summer term 2017 Sestin Küpper, Christine Mik 8. August 2017 1 Introduction: Nottions nd sic Definitions At the eginning of the tutoril we
More informationLecture 3: Equivalence Relations
Mthcmp Crsh Course Instructor: Pdric Brtlett Lecture 3: Equivlence Reltions Week 1 Mthcmp 2014 In our lst three tlks of this clss, we shift the focus of our tlks from proof techniques to proof concepts
More informationI. Theory of Automata II. Theory of Formal Languages III. Theory of Turing Machines
CI 3104 /Winter 2011: Introduction to Forml Lnguges Chter 13: Grmmticl Formt Chter 13: Grmmticl Formt I. Theory of Automt II. Theory of Forml Lnguges III. Theory of Turing Mchines Dr. Neji Zgui CI3104-W11
More informationAutomata Theory 101. Introduction. Outline. Introduction Finite Automata Regular Expressions ω-automata. Ralf Huuck.
Outline Automt Theory 101 Rlf Huuck Introduction Finite Automt Regulr Expressions ω-automt Session 1 2006 Rlf Huuck 1 Session 1 2006 Rlf Huuck 2 Acknowledgement Some slides re sed on Wolfgng Thoms excellent
More informationAgenda. Agenda. Regular Expressions. Examples of Regular Expressions. Regular Expressions (crash course) Computational Linguistics 1
Agend CMSC/LING 723, LBSC 744 Kristy Hollingshed Seitz Institute for Advnced Computer Studies University of Mrylnd HW0 questions? Due Thursdy before clss! When in doubt, keep it simple... Lecture 2: 6
More information1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.
York University CSE 2 Unit 3. DFA Clsses Converting etween DFA, NFA, Regulr Expressions, nd Extended Regulr Expressions Instructor: Jeff Edmonds Don t chet y looking t these nswers premturely.. For ech
More informationConverting Regular Expressions to Discrete Finite Automata: A Tutorial
Converting Regulr Expressions to Discrete Finite Automt: A Tutoril Dvid Christinsen 2013-01-03 This is tutoril on how to convert regulr expressions to nondeterministic finite utomt (NFA) nd how to convert
More informationScanner. Specifying patterns. Specifying patterns. Operations on languages. A scanner must recognize the units of syntax Some parts are easy:
Scnner Specifying ptterns source code tokens scnner prser IR A scnner must recognize the units of syntx Some prts re esy: errors mps chrcters into tokens the sic unit of syntx x = x + y; ecomes
More informationModel Reduction of Finite State Machines by Contraction
Model Reduction of Finite Stte Mchines y Contrction Alessndro Giu Dip. di Ingegneri Elettric ed Elettronic, Università di Cgliri, Pizz d Armi, 09123 Cgliri, Itly Phone: +39-070-675-5892 Fx: +39-070-675-5900
More informationNFAs continued, Closure Properties of Regular Languages
lgorithms & Models of omputtion S/EE 374, Spring 209 NFs continued, losure Properties of Regulr Lnguges Lecture 5 Tuesdy, Jnury 29, 209 Regulr Lnguges, DFs, NFs Lnguges ccepted y DFs, NFs, nd regulr expressions
More informationLexical Analysis Finite Automate
Lexicl Anlysis Finite Automte CMPSC 470 Lecture 04 Topics: Deterministic Finite Automt (DFA) Nondeterministic Finite Automt (NFA) Regulr Expression NFA DFA A. Finite Automt (FA) FA re grph, like trnsition
More informationFormal Language and Automata Theory (CS21004)
Forml Lnguge nd Automt Forml Lnguge nd Automt Theory (CS21004) Khrgpur Khrgpur Khrgpur Forml Lnguge nd Automt Tle of Contents Forml Lnguge nd Automt Khrgpur 1 2 3 Khrgpur Forml Lnguge nd Automt Forml Lnguge
More informationCS103B Handout 18 Winter 2007 February 28, 2007 Finite Automata
CS103B ndout 18 Winter 2007 Ferury 28, 2007 Finite Automt Initil text y Mggie Johnson. Introduction Severl childrens gmes fit the following description: Pieces re set up on plying ord; dice re thrown or
More information