CSCI 2670 Introduction to Theory of Computing

Slides:



Advertisements
Similar presentations
CSCI 2670 Introduction to Theory of Computing September 13, 2005.
Advertisements

Regular expressions Regular languages Sipser 1.3 (pages 63-76)
1 Introduction to Computability Theory Lecture3: Regular Expressions Prof. Amos Israeli.
Regular expressions Regular languages Sipser 1.3 (pages 63-76)
1 Introduction to Computability Theory Lecture4: Regular Expressions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture3: Regular Expressions Prof. Amos Israeli.
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.
CS 310 – Fall 2006 Pacific University CS310 Regular Expressions Sections:1.3 page 63 September 18, 2006 September 20, 2006.
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.
CS5371 Theory of Computation Lecture 6: Automata Theory IV (Regular Expression = NFA = DFA)
Fall 2006Costas Busch - RPI1 Non-Deterministic Finite Automata.
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 Non-Deterministic Automata Regular Expressions.
CS 310 – Fall 2006 Pacific University CS310 Homework 2 & JFLAP September 22, 2006.
Fall 2004COMP 3351 Another NFA Example. Fall 2004COMP 3352 Language accepted (redundant state)
Costas Busch - LSU1 Non-Deterministic Finite Automata.
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.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
Theory of Languages and Automata
Theory of Computation, Feodor F. Dragan, Kent State University 1 Regular expressions: definition An algebraic equivalent to finite automata. We can build.
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.
CHAPTER 1 Regular Languages
CSCI 2670 Introduction to Theory of Computing September 13.
Regular Expressions Costas Busch - LSU.
Finite Automata Chapter 1. Automatic Door Example Top View.
 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.
CSCI 2670 Introduction to Theory of Computing September 7, 2004.
CSCI 2670 Introduction to Theory of Computing September 11, 2007.
Regular Languages Chapter 1 Giorgi Japaridze Theory of Computability.
Theory of Computation Automata Theory Dr. Ayman Srour.
CSE 105 theory of computation
Lexical analysis Finite Automata
Non Deterministic Automata
Properties of Regular Languages
Regular Expressions Sections:1.3 page 63 September 17, 2008
Single Final State for NFA
Language Recognition (12.4)
Intro to Theory of Computation
Non-Deterministic Finite Automata
Properties of Regular Languages
CS 154, Lecture 3: DFANFA, Regular Expressions.
Non-Deterministic Finite Automata
Non Deterministic Automata
4b Lexical analysis Finite Automata
CSCI 2670 Introduction to Theory of Computing
CSCI 2670 Introduction to Theory of Computing
Chapter 1 Regular Language - 02
Language Recognition (12.4)
CS21 Decidability and Tractability
CSCI 2670 Introduction to Theory of Computing
CSCI 2670 Introduction to Theory of Computing
Chapter 1 Regular Language
CSCI 2670 Introduction to Theory of Computing
Teori Bahasa dan Automata Lecture 6: Regular Expression
NFAs accept the Regular Languages
CSCI 2670 Introduction to Theory of Computing
CSCI 2670 Introduction to Theory of Computing
CSCI 2670 Introduction to Theory of Computing
CSCI 2670 Introduction to Theory of Computing
Intro to Theory of Computation
CSCI 2670 Introduction to Theory of Computing
COSC 3340: Introduction to Theory of Computation
COSC 3340: Introduction to Theory of Computation
Presentation transcript:

CSCI 2670 Introduction to Theory of Computing September 12, 2007

Agenda Last class Today Tomorrow Further exploration of equivalence of DFA’s and NFA’s Closure of regular languages under regular operators Regular expressions Today Equivalence of RE’s and regular languages Tomorrow Another method for describing regular languages

RE inductive definition R is a regular expression if R is a for some a   ε  R1  R2 where R1 and R2 are both regular expressions R1  R2 where R1 and R2 are both regular expressions (R1*) where R1 is a regular expression Abuse of notation. These should be sets!

RE’s and regular languages Theorem: A language is regular if and only if some regular expression describes it. i.e., every regular expression has a corresponding DFA and vice versa

RE’s and regular languages Lemma: If a language is described by a regular expression, then it is regular. find an NFA corresponding to any regular expression use inductive definition of RE’s Proved yesterday

Equivalence of RE’s and DFA’s We have seen that every RE has a corresponding NFA Therefore, every RE has a corresponding DFA I.e, every RE describes a regular language We need to show that every regular language can be described by a RE Begin by converting all DFA’s into GNFA’s Generalized Non-deterministic Finite Automata

GNFA’s A GNFA is an NFA with the following properties: The start state has transition arrows going to every other state, but no arrows coming in from any other state There is exactly one accept state and there is an arrow from every other state to this state, but no arrows to any other state from the accept state The start state is not the accept state

GNFA’s (continued) Except for the start and accept states, one arrow goes from every state to every other state and also from each state to itself Instead of being labeled with symbols from the alphabet, transitions are labeled with regular expressions

Example GNFA  01  1 10

Equivalence of DFA’s and RE’s First show every DFA can be converted into a GNFA that accepts the same language Then show that any GNFA has a corresponding RE that accepts the same language

Converting a DFA into a GNFA Add two new states New start state with an ε jump to the original DFA’s start state New accept state with an ε jump from each of the original DFA’s accept states This new state will be the only accept state All transition labels with multiple labels are relabeled with the union of the previous labels All pairs of states without transitions get a transition labeled 

Converting a DFA to a GNFA 1 q1 q2 q3 q4 0,1 qs qt ε ε Add two new states

Converting a DFA to a GNFA q2 1 qs qt q1 1 ε ε q3 q4 0,1 01 0,1 01 All transition labels with multiple labels are relabeled with the union of the previous labels

Converting a DFA to a GNFA q2 1 qs qt q1 1 ε ε q3 q4 01 01 All pairs of states without transitions get a transition labeled 

Converting a DFA to a GNFA q2 1 qs qt q1 1 ε ε q3 q4 01 01 The resulting state diagram is a GNFA All GNFA properties are satisfied

Converting a DFA to a GNFA q2 1 qs qt q1 1 ε ε q3 q4 01 01 No step changed the strings accepted by the machine

Converting a GNFA to a RE If the GNFA has two states, then the label connecting the states is the RE Otherwise, remove one state at a time without changing the language accepted by the machine until the GNFA has two states