Regular Expressions • Equivalence Of Reg. Exps. And Finite Automata

Slides:



Advertisements
Similar presentations
Lecture 8 From NFA to Regular Language. Induction on k= # of states other than initial and final states K=0 a a* b a c d c*a(d+bc*a)*
Advertisements

Transparency No. 2-1 Formal Language and Automata Theory Homework 3.
CMSC Spring Finite Automaton: Example accepted.
FORMAL LANGUAGES, AUTOMATA, AND COMPUTABILITY
CSCI 2670 Introduction to Theory of Computing September 13, 2005.
1 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY (For next time: Read Chapter 1.3 of the book)
Transparency No. 4-1 Formal Language and Automata Theory Chapter 4 Patterns, Regular Expressions and Finite Automata (include lecture 7,8,9) Transparency.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Regular.
Fall 2004COMP 3351 Single Final State for NFA. Fall 2004COMP 3352 Any NFA can be converted to an equivalent NFA with a single final state.
1 Single Final State for NFAs and DFAs. 2 Observation Any Finite Automaton (NFA or DFA) can be converted to an equivalent NFA with a single final state.
Lecture 7 Sept 22, 2011 Goals: closure properties regular expressions.
CS5371 Theory of Computation Lecture 6: Automata Theory IV (Regular Expression = NFA = DFA)
1 Finite state automaton (FSA) LING 570 Fei Xia Week 2: 10/07/09 TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAA.
Transparency No. ?-0 Formal Language and Automata Theory Chapter 6 Homomorphisms (lecture 10) Transparency No. 6-1.
CS5371 Theory of Computation Lecture 4: Automata Theory II (DFA = NFA, Regular Language)
Lecture 8 Sept 29, 2011 Regular expressions – examples Converting DFA to regular expression. (same works for NFA to r.e. conversion.) Converting R.E. to.
1 Regular Expressions/Languages Regular languages –Inductive definitions –Regular expressions syntax semantics Not covered in lecture.
1 A Single Final State for Finite Accepters. 2 Observation Any Finite Accepter (NFA or DFA) can be converted to an equivalent NFA with a single final.
Fall 2004COMP 3351 Regular Expressions. Fall 2004COMP 3352 Regular Expressions Regular expressions describe regular languages Example: describes the language.
Thopson NFA Presenter: Yuen-Shuo Li Date: 2014/5/7 Department of Computer Science and Information Engineering National Cheng Kung University, Taiwan R.O.C.
Theory of Computation, Feodor F. Dragan, Kent State University 1 Regular expressions: definition An algebraic equivalent to finite automata. We can build.
1 State SymbolRead- Q E(Q) a b a b a b Convert to a DFA: Start state: Final States:
1 Module 14 Regular languages –Inductive definitions –Regular expressions syntax semantics.
MA/CSSE 474 Theory of Computation Regular Expressions Intro.
Regular Expressions and Languages A regular expression is a notation to represent languages, i.e. a set of strings, where the set is either finite or contains.
CHAPTER 1 Regular Languages
1 A well-parenthesized string is a string with the same number of (‘s as )’s which has the property that every prefix of the string has at least as many.
Chapter 6 Properties of Regular Languages. 2 Regular Sets and Languages  Claim(1). The family of languages accepted by FSAs consists of precisely the.
1 Regular Expressions Reading: Chapter 3. 2 Regular Expressions vs. Finite Automata Offers a declarative way to express the pattern of any string we want.
CS 3813: Introduction to Formal Languages and Automata
Regular Language Algorithms. Algorithms We have seen many algorithms for manipulating computational systems for the regular languages. Each treats these.
Transparency No. 4-1 Formal Language and Automata Theory Chapter 4 Patterns, Regular Expressions and Finite Automata (include lecture 7,8,9) Transparency.
Recap: Transformation NFA  DFA  s s1s1... snsn p1p1 p2p2... pmpm >...  p1p1  p2p2  pipi s e s1s1 e s2s2 e sisi >
Transparency No. 2-1 Formal Language and Automata Theory Homework 2.
1 Language Recognition (11.4) Longin Jan Latecki Temple University Based on slides by Costas Busch from the courseCostas Busch
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
1 A well-parenthesized string is a string with the same number of (‘s as )’s which has the property that every prefix of the string has at least as many.
1 Chapter 3 Regular Languages.  2 3.1: Regular Expressions (1)   Regular Expression (RE):   E is a regular expression over  if E is one of:
 2004 SDU Lecture4 Regular Expressions.  2004 SDU 2 Regular expressions A third way to view regular languages. Say that R is a regular expression if.
1 Introduction to the Theory of Computation Regular Expressions.
What do we know? DFA = NFA =  -NFA We have seen algorithms to transform DFA to NFA (trival) NFA to  NFA (trivial) NFA to DFA (subset construction)
P Symbol Q E(Q) a b a b a b Convert to a DFA: Start state: Final States:
MA/CSSE 474 Theory of Computation Regular Expressions Intro.
Lecture #5 Advanced Computation Theory Finite Automata.
Page 1. 1)Let B n = { a k | where k is a multiple of n}. I.e. B 1 = { a k | where k is a multiple of 1} = { a k | k Є {0,1,2,3,…}} = {‘’, a, aa, aaa, aaaa,
Cpt S 317: Spring 2009 Reading: Chapter 3
Language Recognition MSU CSE 260.
Foundations of Computing Science
Formal Language & Automata Theory
Theory of Automata.
Formal Language & Automata Theory
Complexity and Computability Theory I
Single Final State for NFA
Language Recognition (12.4)
CSC312 Automata Theory Lecture # 4 Languages-III.
More on DFA minimization and DFA equivalence
Recap lecture 29 Example of prefixes of a language, Theorem: pref(Q in R) is regular, proof, example, Decidablity, deciding whether two languages are equivalent.
Definitions Equivalence to Finite Automata
Definitions Equivalence to Finite Automata
Discrete Math II Howon Kim
Regular Languages ภาษาปกติ.
Language Recognition (12.4)
Convert to a DFA: Start state: Final States: State Symbol Read- Q E(Q)
Instructor: Aaron Roth
Definitions Equivalence to Finite Automata
MA/CSSE 474 DFSM to RE Theory of Computation
Convert to a DFA: Start state: Final States: P Symbol Q E(Q) a b.
Chapter 1 Regular Language
Converting Reg. Exps. To -NFAs: An Example
Announcements - P1 part 1 due Today - P1 part 2 due on Friday Feb 1st
Presentation transcript:

Regular Expressions • Equivalence Of Reg. Exps. And Finite Automata • Kleenex Algebra • Languages defined by regular expressions are called REGULAR SETS. 004 Regular Expressions

Regular Expressions Over Alphabet  1.  is a Reg. Exp. |||| =  2.  is a Reg. Exp. |||| = {} 3. a  a is a Reg. Exp. ||a|| = {a} 4. , : Reg. Exp.  (+), (), (*) : Reg. Exp. ||+|| = ||||||||, |||| = |||||||| ||*|| = (||||)* 5. Nothing else is a Reg. Exp. Over . 004 Regular Expressions

From Reg. Exps. To -NFAs (1) Algorithm REtoNFA 1a: If =, then M accepts . 1b: If =, then M accepts {}. 1c: If =a, then Ma accepts {a}. 2a: If =, then s f sf a s f  s f s f M M M

From Reg. Exps. To -NFAs (2) 2b: If =+, then 2c: If =*, then   s f M s f  s f  M M+    f s s f M M* 

From DFAs To Reg. Exps. Rijk={x* | (i) *(qi,x)=qj, Rijk= Let M=({q1,..,qn},,,q1,F) be a DFA. For 1i,jk; 0kn, define Rijk={x* | (i) *(qi,x)=qj, (ii) x=yz & y+ & z+& & *(qi,y)=qm  mk}. Then {a | (qi,a)=qj} if ij, {a | (qi,a)=qj}{} if i=j, and if k>0, then Rijk=Rikk-1(Rkkk-1)*Rkjk-1Rjjk-1. Rijk= 004 Regular Expressions

Regular Expressions = Finite Automata THEOREM L(DFA)=L(Reg Exp). Proof: : Reg.Exp., -NFA M [ L(M)=|||| ] by Algorithm REtoNFA. : DFA M, Reg.Exp. [ ||||=L(M) ] i) Prove by Induction on k that Rijk, Reg.Exp.ijk [ ||ijk||=Rijk ]. ii) L(M)=||1f1n+ 1f2n+…+ 1fmn||, where F={qf1, …, qfm}. 004 Regular Expressions

Kleene Algebra A Complete Axiom System for Regular Expressions Axioms for K=(,+,,0,1) A1 a+(b+c)=(a+b)+c, a(bc)=(ab)c A2 a+b=b+a A3 a+a=a A4 a+0=a, a1=1a=a A5 a0=0a=0 A6 a(b+c)=ab+ac, (a+b)c=ac+bc A7 1+aa*=a*, 1+a*a=a* A8 abb  a*bb, and bab  ba*b, where ab  a+b=b for all a,b,c in . ( is omitted from xy.) def 004 Regular Expressions

The Axiom System is Complete and Sound. THEOREM All and only properties of reg. exps. over  can be derived from axioms A1 to A8. Ex. (1) a*a*=a*, since a*+a*a* = a*+a*(1+aa*) = a*+(a*+a*aa*) = (a*+a*)+a*aa* = a*+a*aa* = a*(1+aa*) = a*a*. (2) a* = 1+aa* = (1+1)+aa* = 1+(1+aa*) = 1+a*. (3) ab & cd  a+b=b & c+d=d  ac+bd = ac+(a+b)(c+d) = ac+(ac+ad+bc+bd) = (ac+ac)+ad+bc+bd = ac+ad+bc+bd =(a+b)(c+d) = bd  acbd. A7 A6,A4    L A1 A4,A6 A7 A3 A3 A1 A7 A7 def of  A6,A2,A1 A1 A3 A1,A6 def of 