Lecture # 13.

Slides:



Advertisements
Similar presentations
CSC 361NFA vs. DFA1. CSC 361NFA vs. DFA2 NFAs vs. DFAs NFAs can be constructed from DFAs using transitions: Called NFA- Suppose M 1 accepts L 1, M 2 accepts.
Advertisements

Lecture # 11 Theory Of Automata By Dr. MM Alam 1.
Lecture # 10 Theory Of Automata By Dr. MM Alam 1.
Lecture 9,10 Theory of AUTOMATA
1 Introduction to Computability Theory Lecture3: Regular Expressions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture4: Regular Expressions Prof. Amos Israeli.
Fall 2006Costas Busch - RPI1 Regular Expressions.
Finite Automata Finite-state machine with no output. FA consists of States, Transitions between states FA is a 5-tuple Example! A string x is recognized.
Lecture 3: Closure Properties & Regular Expressions Jim Hook Tim Sheard Portland State University.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Regular.
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 2004COMP 3351 Another NFA Example. Fall 2004COMP 3352 Language accepted (redundant state)
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.
Lecture 05: Theory of Automata:08 Kleene’s Theorem and NFA.
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.
Kleene’s Theorem Group No. 3 Presented To Mam Amina Presented By Roll No Roll No Roll No Roll No Group No. 3 Presented To Mam.
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.
Regular Expressions Costas Busch - LSU.
Lecture # 15. Mealy machine A Mealy machine consists of the following 1. A finite set of states q 0, q 1, q 2, … where q 0 is the initial state. 2. An.
Conversions Regular Expression to FA FA to Regular Expression.
1 Recap lecture 28 Examples of Myhill Nerode theorem, Quotient of a language, examples, Pseudo theorem: Quotient of a language is regular, prefixes of.
Lecture 09: Theory of Automata:2014 Asif NawazUIIT, PMAS-Arid Agriclture University Rawalpindi. Kleene’s Theorem and NFA.
Lecture # 8 (Transition Graphs). Example Consider the language L of strings, defined over Σ={a, b}, having (containing) triple a or triple b. Consider.
Lecture # 16. Applications of Incrementing and Complementing machines 1’s complementing and incrementing machines which are basically Mealy machines are.
Lecture 15: Theory of Automata:2014 Finite Automata with Output.
1/29/02CSE460 - MSU1 Nondeterminism-NFA Section 4.1 of Martin Textbook CSE460 – Computability & Formal Language Theory Comp. Science & Engineering Michigan.
Recap lecture 5 Different notations of transition diagrams, languages of strings of even length, Odd length, starting with b, ending in a (with different.
CIS Automata and Formal Languages – Pei Wang
Kleene’s Theorem and NFA
Non Deterministic Automata
Properties of Regular Languages
Theory of Computation Lecture # 9-10.
Lecture 9 Theory of AUTOMATA
Single Final State for NFA
Jaya Krishna, M.Tech, Assistant Professor
Non-deterministic Finite Automata (NFA)
CSE322 PROPERTIES OF REGULAR LANGUAGES
CSE322 CONSTRUCTION OF FINITE AUTOMATA EQUIVALENT TO REGULAR EXPRESSION Lecture #9.
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.
Kleene’s Theorem Muhammad Arif 12/6/2018.
CSCI 2670 Introduction to Theory of Computing
Recap Lecture 16 Examples of Kleene’s theorem part III (method 3), NFA, examples, avoiding loop using NFA, example, converting FA to NFA, examples, applying.
Lecture 5 Theory of AUTOMATA
ReCap Chomsky Normal Form, Theorem regarding CNF, examples of converting CFG to be in CNF, Example of an FA corresponding to Regular CFG, Left most and.
Recap lecture 10 Definition of GTG, examples of GTG accepting the languages of strings:containing aa or bb, beginning with and ending in same letters,
Chapter 1 Regular Language
Recap lecture 18 NFA corresponding to union of FAs,example, NFA corresponding to concatenation of FAs,examples, NFA corresponding to closure of an FA,examples.
Recap Lecture 17 converting NFA to FA (method 3), example, NFA and Kleene’s theorem method 1, examples, NFA and Kleene’s theorem method 2 , NFA corresponding.
Recap lecture 11 Proof of Kleene’s theorem part II (method with different steps), particular examples of TGs to determine corresponding REs.
Recap lecture 25 Intersection of two regular languages is regular, examples, non regular languages, example.
Recap lecture 19 NFA corresponding to Closure of FA, Examples, Memory required to recognize a language, Example, Distinguishing one string from another,
RECAP Lecture 7 FA of EVEN EVEN, FA corresponding to finite languages(using both methods), Transition graphs.
Recap lecture 23 Mealy machines in terms of sequential circuit.
Recap Lecture 15 Examples of Kleene’s theorem part III (method 3), NFA, examples, avoiding loop using NFA, example, converting FA to NFA, examples, applying.
Finite-State Machines with No Output
Recap lecture 20 Recap Theorem, Example, Finite Automaton with output, Moore machine, Examples.
Kleene’s Theorem (Part-3)
Finite Automaton with output
CSC312 Automata Theory Kleene’s Theorem Lecture # 12
Kleene’s Theorem (Part-3)
Irum Feroz Kleene Theorem Irum Feroz
Recap Lecture 4 Regular expression of EVEN-EVEN language, Difference between a* + b* and (a+b)*, Equivalent regular expressions; sum, product and closure.
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.
LECTURE # 07.
Mealy and Moore Machines
NFAs accept the Regular Languages
Presentation transcript:

Lecture # 13

NFA and Kleene’s Theorem It has been discussed that, by Kleene’s theorem part III, there exists an FA corresponding to a given RE. If the given RE is as simple as r=aa+bbb or r=a(a+b)*, the corresponding FAs can easily be constructed. However, for a complicated RE, the RE can be decomposed into simple REs corresponding to which the FAs can easily be constructed and hence, using the method, constructing the FAs corresponding to sum, concatenation and closure of FAs, the required FA can also be constructed. It is to be noted that NFAs also help in proving Kleene’s theorem part III, as well. Two methods are discussed in the following.

NFA and Kleene’s Theorem Method 1: The method is discussed considering the following example. Example:To construct the FAs for the languages L1= {a}, L2= {b} and L3 = {Λ} Step 1: Build NFA1, NFA2 and NFA3 corresponding to L1, L2 and L3 , respectively as shown in the following diagram

NFA and Kleene’s Theorem (method 1 ) continued …

NFA and Kleene’s Theorem (method 1 ) continued … Step 2: As discussed earlier for every NFA there is an FA equivalent to it, hence there must be FAs for the above mentioned NFAs as well. The corresponding FAs can be considered as follows

NFA and Kleene’s Theorem (method 1 ) continued …

NFA and Kleene’s Theorem method 2 It may be observed that if an NFA can be built corresponding to union, concatenation and closure of FAs corresponding to the REs, then converting the NFA, thus, obtained into an equivalent FA, this FA will correspond to the given RE. Followings are the procedures showing how to obtain NFAs equivalent to union, concatenation and closure of FAs

NFA corresponding to Union of FAs Method: Introduce a new start state and connect it with the states originally connected with the old start state with the same transitions as the old start state, then remove the –ve sign of old start state. This creates non-determinism and hence results in an NFA.

Example FA1 FA2

NFA equivalent to FA1 U FA2

Example

NFA equivalent to FA1 U FA2

Task Using the FAs corresponding to r1=(a+b)*(aa+bb)(a+b)* and r2=a(a+b)* build an NFA corresponding to r1+r2

NFA corresponding to Concatenation of FAs

NFA corresponding to Concatenation of FAs Method: Introduce additional transitions for each letter connecting each final state of the first FA with the states of second FA that are connected with the initial state of second FA corresponding to each letter of the alphabet. Remove the +ve sign of each of final states of first FA and –ve sign of the initial state of second FA. It will create non-determinism at final states of first FA and hence NFA, thus obtained, will be the required NFA.

NFA corresponding to Concatenation of FAs Note: It may be noted that if first FA accepts the Null string then every string accepted by second FA must be accepted by the concatenation of FAs as well. This situation will automatically be accommodated using the method discussed earlier. However if the second FA accepts Null string, then every string accepted by first FA must be accepted by the required FA as well. This target can be achieved as, while introducing new transitions at final states of first FA the +ve sign of these states will not be removed.

Note Continued … Lastly if both FAs accepts the Null string, then the Null string must be accepted by the required FA. This situation will automatically be accommodated as the second FA accepts the Null string and hence the +ve signs of final states of first FA will not be removed.

Example (No FA accepts Null string)

NFA equivalent to FA1FA2

Example (FA2 accepts Null string)

NFA equivalent to FA1FA2

Example (Both FAs accept Null string)

NFA equivalent to FA1FA2