1 Regular Expressions. 2 Regular expressions describe regular languages Example: describes the language.

Slides:



Advertisements
Similar presentations
1 Let’s Recapitulate. 2 Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
Advertisements

Lecture 24 MAS 714 Hartmut Klauck
1 Languages. 2 A language is a set of strings String: A sequence of letters Examples: “cat”, “dog”, “house”, … Defined over an alphabet: Languages.
Costas Busch - RPI1 Single Final State for NFAs. Costas Busch - RPI2 Any NFA can be converted to an equivalent NFA with a single final state.
Courtesy Costas Busch - RPI1 Non Deterministic Automata.
Fall 2006Costas Busch - RPI1 Regular Expressions.
1 Positive Properties of Context-Free languages. 2 Context-free languages are closed under: Union is context free is context-free.
1 More Properties of Regular Languages. 2 We have proven Regular languages are closed under: Union Concatenation Star operation Reverse.
Transparency No. 4-1 Formal Language and Automata Theory Chapter 4 Patterns, Regular Expressions and Finite Automata (include lecture 7,8,9) Transparency.
Costas Busch - RPI1 Standard Representations of Regular Languages Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
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 Languages and Finite Automata or how to talk to machines...
Fall 2003Costas Busch - RPI1 Decidable Problems of Regular Languages.
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.
Costas Busch - RPI1 Standard Representations of Regular Languages Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
1 NFAs accept the Regular Languages. 2 Equivalence of Machines Definition: Machine is equivalent to machine if.
Courtesy Costas Busch - RPI1 Non-regular languages.
Fall 2006Costas Busch - RPI1 Non-Deterministic Finite Automata.
Fall 2004COMP 3351 Standard Representations of Regular Languages Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
CS5371 Theory of Computation Lecture 4: Automata Theory II (DFA = NFA, Regular Language)
1 Non-Deterministic Automata Regular Expressions.
Fall 2004COMP 3351 Another NFA Example. Fall 2004COMP 3352 Language accepted (redundant state)
Costas Busch - LSU1 Non-Deterministic Finite Automata.
Prof. Busch - RPI1 Decidable Problems of Regular Languages.
1 Non-regular languages. 2 Regular languages Non-regular languages.
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.
1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 5 School of Innovation, Design and Engineering Mälardalen University 2012.
1 Regular Expressions. 2 Regular expressions describe regular languages Example: describes the language.
Prof. Busch - LSU1 NFAs accept the Regular Languages.
CSCI 2670 Introduction to Theory of Computing September 1, 2005.
Lecture 5 Sept 06, 2012 Regular expressions – examples Converting DFA to regular expression. (same works for NFA to r.e. conversion.) Converting R.E. to.
Lesson No.6 Naveen Z Quazilbash. Overview Attendance and lesson plan sharing Assignments Quiz (10 mins.). Some basic ideas about this course Regular Expressions.
Lecture # 12. Nondeterministic Finite Automaton (NFA) Definition: An NFA is a TG with a unique start state and a property of having single letter as label.
CS 203: Introduction to Formal Languages and Automata
Regular Expressions Costas Busch - LSU.
1 Language Recognition (11.4) Longin Jan Latecki Temple University Based on slides by Costas Busch from the courseCostas Busch
CS 154 Formal Languages and Computability February 11 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
 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 Some Properties of Regular Languages. 2 Properties Concatenation:Star: Union: Are regular Languages For regular languages and.
P Symbol Q E(Q) a b a b a b Convert to a DFA: Start state: Final States:
Languages.
Formal Language & Automata Theory
Standard Representations of Regular Languages
CSE322 PUMPING LEMMA FOR REGULAR SETS AND ITS APPLICATIONS
Non Deterministic Automata
Properties of Regular Languages
PROPERTIES OF REGULAR LANGUAGES
Formal Language & Automata Theory
Formal Language & Automata Theory
PDAs Accept Context-Free Languages
Single Final State for NFA
Language Recognition (12.4)
REGULAR LANGUAGES AND REGULAR GRAMMARS
Regular Expressions Prof. Busch - LSU.
Non-Deterministic Finite Automata
4. Properties of Regular Languages
Non-Deterministic Finite Automata
Non Deterministic Automata
Deterministic PDAs - DPDAs
Closure Properties of Context-Free languages
Elementary Questions about Regular Languages
Decidable Problems of Regular Languages
Language Recognition (12.4)
Chapter 1 Regular Language
NFAs accept the Regular Languages
Presentation transcript:

1 Regular Expressions

2 Regular expressions describe regular languages Example: describes the language

3 Recursive Definition Are regular expressions Primitive regular expressions: Given regular expressions and

4 Examples A regular expression: Not a regular expression:

5 Languages of Regular Expressions : language of regular expression Example

6 Definition For primitive regular expressions:

7 Definition (continued) For regular expressions and

8 Example Regular expression:

9 Example Regular expression

10 Example Regular expression

11 Example Regular expression = { all strings with at least two consecutive 0 }

12 Example Regular expression = { all strings without two consecutive 0 }

13 Equivalent Regular Expressions Definition: Regular expressions and are equivalent if

14 Example = { all strings without two consecutive 0 } and are equivalent regular expr.

15 Regular Expressions and Regular Languages

16 Theorem Languages Generated by Regular Expressions Regular Languages

17 Languages Generated by Regular Expressions Regular Languages Generated by Regular Expressions Regular Languages We will show:

18 Proof - Part 1 For any regular expression the language is regular Languages Generated by Regular Expressions Regular Languages Proof by induction on the size of

19 Induction Basis Primitive Regular Expressions: NFAs regular languages

20 Inductive Hypothesis Assume for regular expressions and that and are regular languages

21 Inductive Step We will prove: Are regular Languages

22 By definition of regular expressions:

23 By inductive hypothesis we know: and are regular languages Regular languages are closed under: Union Concatenation Star We also know:

24 Therefore: Are regular languages

25 And trivially: is a regular language

26 Proof - Part 2 Languages Generated by Regular Expressions Regular Languages For any regular language there is a regular expression with Proof by construction of regular expression

27 Since is regular take the NFA that accepts it Single final state

28 From construct the equivalent Generalized Transition Graph in which transition labels are regular expressions Example:

29 Another Example:

30 Reducing the states:

31 Resulting Regular Expression:

32 In General Removing states:

33 The final transition graph: The resulting regular expression:

34 Standard Representations of Regular Languages Regular Languages FAs NFAs Regular Expressions

35 When we say: We are given a Regular Language We mean:Language is in a standard representation

36 Elementary Questions about Regular Languages

37 Membership Question Question:Given regular language and string how can we check if ? Answer:Take the DFA that accepts and check if is accepted

38 DFA

39 Given regular language how can we check if is empty: ? Take the DFA that accepts Check if there is any path from the initial state to a final state Question: Answer:

40 DFA

41 Given regular language how can we check if is finite? Take the DFA that accepts Check if there is a walk with cycle from the initial state to a final state Question: Answer:

42 DFA is infinite DFA is finite

43 Given regular languages and how can we check if ? Question: Find if Answer:

44 and

45 or