Converting Reg. Exps. To -NFAs: An Example

Slides:



Advertisements
Similar presentations
Lecture 6 Nondeterministic Finite Automata (NFA)
Advertisements

Complexity and Computability Theory I Lecture #4 Rina Zviel-Girshin Leah Epstein Winter
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)*
Regular Expressions and DFAs COP 3402 (Summer 2014)
CMSC Spring Finite Automaton: Example accepted.
8.4 Closures of Relations. Intro Consider the following example (telephone line, bus route,…) abc d Is R, defined above on the set A={a, b, c, d}, transitive?
1.  We have studied groups, which is an algebraic structure equipped with one binary operation. Now we shall study rings which is an algebraic structure.
Lecture 3UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 3.
1 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY (For next time: Read Chapter 1.3 of the book)
CS 310 – Fall 2006 Pacific University CS310 Regular Expressions Sections:1.3 page 63 September 18, 2006 September 20, 2006.
Lecture 7 Sept 22, 2011 Goals: closure properties regular expressions.
CS5371 Theory of Computation Lecture 6: Automata Theory IV (Regular Expression = NFA = DFA)
CS 310 – Fall 2006 Pacific University CS310 Homework 2 & JFLAP September 22, 2006.
Lecture 5UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 5.
1 Regular Expressions/Languages Regular languages –Inductive definitions –Regular expressions syntax semantics Not covered in lecture.
Formal Language Finite set of alphabets Σ: e.g., {0, 1}, {a, b, c}, { ‘{‘, ‘}’ } Language L is a subset of strings on Σ, e.g., {00, 110, 01} a finite language,
Regular Expressions (RE) Empty set Φ A RE denotes the empty set Empty string λ A RE denotes the set {λ} Symbol a A RE denotes the set {a} Alternation M.
Basics of automata theory
1 Language Definitions Lecture # 2. Defining Languages The languages can be defined in different ways, such as Descriptive definition, Recursive definition,
Module 2 How to design Computer Language Huma Ayub Software Construction Lecture 8.
6.6 Rings and fields Rings  Definition 21: A ring is an Abelian group [R, +] with an additional associative binary operation(denoted · such that.
1 Module 14 Regular languages –Inductive definitions –Regular expressions syntax semantics.
MA/CSSE 474 Theory of Computation Regular Expressions Intro.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 2 Mälardalen University 2010.
Conversions & Pumping Lemma CPSC 388 Fall 2001 Ellen Walker Hiram College.
Regular Languages ภาษาปกติ. Jaruloj Chongstitvatana Outline Regular expressions Regular languages Equivalence between languages accepted by.
Theory of Computing CSCI 356/541 Lab Session. Outline Lab 1: Finite Automata  Construct and Run Construct and Run  Manipulating Transitions Manipulating.
§R1∪R2§R1∪R2 §R 1 ∩R 2 R1-R2R1-R2 2.4 Operations on Relations.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
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.
Set, Alphabets, Strings, and Languages. The regular languages. Clouser properties of regular sets. Finite State Automata. Types of Finite State 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,
Animated Conversion of Regular Expressions to C Code On the regular expression: ((a ⋅ b)|c) *
Recap lecture 5 Different notations of transition diagrams, languages of strings of even length, Odd length, starting with b, ending in a (with different.
CS314 – Section 5 Recitation 2
3. Regular Expressions and Languages
Regular Expressions.
Formal Language & Automata Theory
Chapter 2 Finite Automata
Regular Expressions Sections:1.3 page 63 September 17, 2008
Examples for Finite Automata
Chapter 2 FINITE AUTOMATA.
CSC312 Automata Theory Lecture # 4 Languages-III.
CSC 4170 Theory of Computation Nondeterminism Section 1.2.
Hierarchy of languages
Chapter Seven: Regular Expressions
Non-Deterministic Finite Automata
Principles of Computing – UFCFA3-30-1
COSC 3340: Introduction to Theory of Computation
Non-Deterministic Finite Automata
Regular Expressions • Equivalence Of Reg. Exps. And Finite Automata
Definitions Equivalence to Finite Automata
CS 350 — Fall 2018 gilray.org/classes/fall2018/cs350/
Finite Automata Reading: Chapter 2.
CSE 2001: Introduction to Theory of Computation Fall 2009
I. Finite Field Algebra.
Lecture 43 Section 10.1 Wed, Apr 6, 2005
Regular Languages ภาษาปกติ.
CS21 Decidability and Tractability
NFA to DFA conversion and regular expressions
CSC 4170 Theory of Computation Nondeterminism Section 1.2.
MA/CSSE 474 DFSM to RE Theory of Computation
CSC312 Automata Theory Lecture # 5 Chapter # 4 Cont…
Recap Lecture 3 RE, Recursive definition of RE, defining languages by RE, { x}*, { x}+, {a+b}*, Language of strings having exactly one aa, Language of.
Announcements - P1 part 1 due Today - P1 part 2 due on Friday Feb 1st
COSC 3340: Introduction to Theory of Computation
Finite Automata Part Three
COSC 3340: Introduction to Theory of Computation
Presentation transcript:

Converting Reg. Exps. To -NFAs: An Example a•b+c*  a  b      •  L ¢   c   a b c c 004-01

What is Rijk ? In any DFA, xRijk  *(qi,x)=qj with the following properties: A similar relation holds also for –NFAs. 1) Whole x is consumed on the path going out of qi and entering qj ,and 2) The suffix of any state on the path (except for qi and qj) is at most k. •  L ¢  x qi qj 004-01

Converting DFAs To Reg. Exps: Example 1 (Based on the construction of the proof of the theorem) R110={}, R120={a,b}, R130={c}, R210= , R220={}, R230=, R310= , R320=, R330={d,}, R111=R110R110(R110)*R110 ={}{}{}*{}={}, R121=R120R110(R110)*R120={a,b}, R131=R130R110(R110)*R130={c}, R211=, R221={}, R231=R311=R321= , R331={d,}, R112={} , R122={a,b}, R132={c}, R212=, R222={}, R232=, R312=R322=, R332={d,}, R113={}, R123={a,b}, R133=R132R132(R332)*R332={c}{c}{d,}*{d,}={c}{d}*, L(M)=R113 R133={}{c}{d}*. =||+cd*|| •  L ¢  q1 q2 a,b c d q3 004-01

Converting -NFAs To Reg. Exps: Example 2 Based on the meaning of Rijk R114=R113=R112=R111=R110={}, R124={a}, R130=R131={c}, R132={a,c}, R144=R143={,ab}, R444=R443={}, R434=R433=, R221={}, R231={e}, R321=, R332=R331=R330R310(R110)*R130={,d}, R133=R132R132(R332)*R332 ={a,c}{a,c}{,d}*{,d}={a,c}{d}*, R134=R133R143(R443)*R433 ={a,c}{d}*{,ab}{}*={a,c}{d}*. L(M)=R134 R144={a,c}{d}*{,ab} =||(a+c)d*++ab||. •  L ¢   q1 q2 q4 a b  c d 004-01 q3

Regular Sets L is called a regular set if L=|||| for some reg. exp. ;  is said to denote L. If L and L’ are regular sets, then so are LL’, LL’, and L*. Why? THEOREM (S.C.Kleene) The class of regular sets, which we denote by R, is the smallest class of languages that contains all finite languages and closed under , •, and *. THEOREM R=L(DFA)=L(NFA)= L(-NFA)=L(Reg. Exp.). •  L ¢  004-01

Examples & Exercises =  ||||=|||| Examples Excercises def =  ||||=|||| Examples 1. a*+a*=a*, 2. a*a*=a*, 3. (a*)*=a*, 4. (a+b)*=(b+a)*, 5. (ab)*=a(ba)*b+, 5. (ab*+a*b+)(a+)+a*b* =(ab*a+a*ba+ab*+a*b)+a*b* =ab*a+a*ba+a*b*a*b*(a+) ||ab*a+a*ba+a*b*|| is a proper subset of ||a*b*(a+)|| (Consider aabba). 6. ||a(b+c)+ab||=||a(b+c)||||ab||= ||a||•||b+c||||a||•||b||={a}(||b||||c||) {a}{b}={a}{b,c}{ab}={ab,ac}. Excercises 1. (a+b)*(b+a)*=(a+b)*? 2. (a+b)*(a+b)+=(a+b)*? 3. (ab+ba)*=(ab)*+(ba)*? 4. (a*+b*)*=(a*b*)*? 5. ||**+aa*||=?, 6. ||0*10*10*||=?, 7. Give reg. exps. for (a) the set of words over {0,1} containing 000 as a subword, (b) the set of odd nonnegative integers over {0,1,2,…,9}, (c) the set of words over {a,b} containing even number of a’s and b’s, (d) the set of integers which are multiples of 3, (e) the set of positive integers over {0,1,…,9} that are dividable by 10. •    L ¢  004-01