NFAs accept the Regular Languages

Slides:



Advertisements
Similar presentations
CS2303-THEORY OF COMPUTATION Closure Properties of Regular Languages
Advertisements

1 Introduction to Computability Theory Lecture3: Regular Expressions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture4: Regular Expressions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture3: Regular Expressions Prof. Amos Israeli.
Prof. Busch - LSU1 Properties of Context-Free 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 Regular Expressions. 2 Regular expressions describe regular languages Example: describes the language.
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...
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.
1 NFAs accept the Regular Languages. 2 Equivalence of Machines Definition: Machine is equivalent to machine if.
Fall 2006Costas Busch - RPI1 Properties of Regular Languages.
Fall 2006Costas Busch - RPI1 Non-Deterministic Finite Automata.
1 Non-Deterministic Automata Regular Expressions.
Fall 2004COMP 3351 Another NFA Example. Fall 2004COMP 3352 Language accepted (redundant state)
Fall 2006Costas Busch - RPI1 PDAs Accept Context-Free Languages.
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.
1 A Non Context-Free Language (We will prove it at the next class)
Fall 2004COMP 3351 Regular Expressions. Fall 2004COMP 3352 Regular Expressions Regular expressions describe regular languages Example: describes the language.
NFA Closure Properties. NFAs also have closure properties We have given constructions for showing that DFAs are closed under 1.Complement 2.Intersection.
NFA Closure Properties Sipser pages pages NFAs also have closure properties We have given constructions for showing that DFAs are closed under.
1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 5 School of Innovation, Design and Engineering Mälardalen University 2012.
1 State SymbolRead- Q E(Q) a b a b a b Convert to a DFA: Start state: Final States:
Prof. Busch - LSU1 NFAs accept the Regular Languages.
INHERENT LIMITATIONS OF COMPUTER PROGAMS CSci 4011.
Regular Expressions Costas Busch - LSU.
Costas Busch - LSU1 Properties of Context-Free languages.
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.
Complexity and Computability Theory I Lecture #5 Rina Zviel-Girshin Leah Epstein Winter
Costas Busch - LSU1 PDAs Accept Context-Free Languages.
P Symbol Q E(Q) a b a b a b Convert to a DFA: Start state: Final States:
Lecture 15: Theory of Automata:2014 Finite Automata with Output.
Languages.
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)
Closure Properties for Regular Languages
Non-Deterministic Finite Automata
CSE322 PROPERTIES OF REGULAR LANGUAGES
Properties of Regular Languages
CS 154, Lecture 3: DFANFA, Regular Expressions.
COSC 3340: Introduction to Theory of Computation
CSE322 CONSTRUCTION OF FINITE AUTOMATA EQUIVALENT TO REGULAR EXPRESSION Lecture #9.
Non-Deterministic Finite Automata
Non Deterministic Automata
Deterministic PDAs - DPDAs
Closure Properties of Context-Free languages
CSCI 2670 Introduction to Theory of Computing
Undecidable problems:
Properties of Context-Free languages
Language Recognition (12.4)
CS21 Decidability and Tractability
Convert to a DFA: Start state: Final States: State Symbol Read- Q E(Q)
Convert to a DFA: Start state: Final States: P Symbol Q E(Q) a b.
Chapter 1 Regular Language
Lecture # 13.
CSC312 Automata Theory Kleene’s Theorem Lecture # 12
CSCI 2670 Introduction to Theory of Computing
Presentation transcript:

NFAs accept the Regular Languages

Equivalence of Machines Definition: Machine is equivalent to machine if

Example of equivalent machines NFA FA

same computation power We will prove: Languages accepted by NFAs Regular Languages Languages accepted by FAs NFAs and FAs have the same computation power

We will show: Languages accepted by NFAs Regular Languages Languages accepted by NFAs Regular Languages

Proof-Step 1 Languages accepted by NFAs Regular Languages Proof: Every FA is trivially an NFA Any language accepted by a FA is also accepted by an NFA

Proof-Step 2 Languages accepted by NFAs Regular Languages Proof: Any NFA can be converted to an equivalent FA Any language accepted by an NFA is also accepted by a FA

Convert NFA to FA NFA FA

Convert NFA to FA NFA FA

Convert NFA to FA NFA FA

Convert NFA to FA NFA FA

Convert NFA to FA NFA FA

Convert NFA to FA NFA FA

Convert NFA to FA NFA FA

NFA to FA: Remarks We are given an NFA We want to convert it to an equivalent FA With

If the NFA has states the FA has states in the powerset

Procedure NFA to FA 1. Initial state of NFA: Initial state of FA:

Example NFA FA

Procedure NFA to FA 2. For every FA’s state Compute in the NFA Add transition to FA

Exampe NFA FA

Procedure NFA to FA Repeat Step 2 for all letters in alphabet, until no more transitions can be added.

Example NFA FA

Procedure NFA to FA 3. For any FA state If is accepting state in NFA Then, is accepting state in FA

Example NFA FA

Theorem Take NFA Apply procedure to obtain FA Then and are equivalent :

Proof AND

First we show: Take arbitrary: We will prove:

denotes

We will show that if then

More generally, we will show that if in : (arbitrary string) then

Proof by induction on Induction Basis: Is true by construction of

Induction hypothesis:

Induction Step:

Induction Step:

Therefore if then

We have shown: We also need to show: (proof is similar)

Single Accepting State for NFAs

Any NFA can be converted to an equivalent NFA with a single accepting state

Example NFA Equivalent NFA

In General NFA Equivalent NFA Single accepting state

Extreme Case NFA without accepting state Add an accepting state without transitions

Properties of Regular Languages

For regular languages and we will prove that: Union: Are regular Languages Concatenation: Star: Reversal: Complement: Intersection:

We say: Regular languages are closed under Union: Concatenation: Star: Reversal: Complement: Intersection:

Regular language Regular language NFA NFA Single aceepting state Single accepting state NFA

Example

Union NFA for

Example NFA for

Concatenation NFA for

Example NFA for

Star Operation NFA for

Example NFA for

Reverse NFA for 1. Reverse all transitions 2. Make initial state accepting state and vice versa

Example

Complement 1. Take the FA that accepts 2. Make final states non-final, and vice-versa

Example

Intersection regular We show regular regular

DeMorgan’s Law: regular

Example regular regular regular

Another Proof for Intersection Closure Machine Machine FA for FA for Construct a new FA that accepts simulates in parallel and

States in State in State in

FA FA transition transition FA transition

FA FA initial state initial state FA Initial state

FA FA accept state accept states FA accept states Both constituents must be accepting states

Example:

Automaton for intersection

simulates in parallel and accepts string if and only if accepts string and accepts string