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.

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 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)*
Lecture 9,10 Theory of AUTOMATA
Fall 2006Costas Busch - RPI1 Regular Expressions.
Lecture 3: Closure Properties & Regular Expressions Jim Hook Tim Sheard Portland State University.
Regular Expression to NFA-  (a+ba) * a. First Parsing Step concatenate (a+ba) * a.
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.
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.
THEORY OF COMPUTATION 08 KLEENE’S THEOREM.
Theory of Computation, Feodor F. Dragan, Kent State University 1 Regular expressions: definition An algebraic equivalent to finite automata. We can build.
Lecture 05: Theory of Automata:08 Kleene’s Theorem and NFA.
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.
CHAPTER 1 Regular Languages
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.
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 # 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.
Recap lecture 5 Different notations of transition diagrams, languages of strings of even length, Odd length, starting with b, ending in a (with different.
Kleene’s Theorem and NFA
Recap lecture 33 Example of trees, Polish Notation, examples, Ambiguous CFG, example,
Regular Expressions.
Recap lecture 38 Example of PDA with table for running a string, Equivalent PDA, PDA for EVEN EVEN Language. Non-Derterministic PDA, Example of Non-Derterministic.
Lecture 9 Theory of AUTOMATA
Single Final State for NFA
Language Recognition (12.4)
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.
Recap lecture 6 Language of strings, beginning with and ending in different letters, Accepting all strings, accepting non-empty strings, accepting no string,
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.
Language Recognition (12.4)
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,
Recap Lecture-2 Kleene Star Closure, Plus operation, recursive definition of languages, INTEGER, EVEN, factorial, PALINDROME, {anbn}, languages of strings.
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.
Lecture # 13.
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.
Recap lecture 40 Recap of example of PDA corresponding to CFG, CFG corresponding to PDA. Theorem, HERE state, Definition of Conversion form, different.
Finite Automaton with output
CSC312 Automata Theory Kleene’s Theorem Lecture # 12
Kleene’s Theorem (Part-3)
Recap Lecture-2 Kleene Star Closure, Plus operation, recursive definition of languages, INTEGER, EVEN, factorial, PALINDROME, {anbn}, languages of strings.
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:

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 to union of FAs,example

Example FA1 FA2 q p- + b 4 b 6+ 1– b b b b 3 5 a,b b a a a a a a,b a a

NFA equivalent to FA1UFA2 a,b b a p q a + b b a a a - 2 4 a a b a,b b 1 a b 6+ a b b b 3 5 NFA equivalent to FA1UFA2

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

Solution of the Task a b a,b y z + x- FA1 FA2 a,b q+ a p- a,b b r

NFA equivalent to FA1UFA2 y a a a,b a x a b + b b b z - a,b a q+ a p a,b b b r

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 of Concatenation of FAs Continued … 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) a,b b a q a p- r + FA1 FA2 b 2 a 1– 3 6+ 4 5 a,b b

NFA equivalent to FA1FA2 q p- 4 b r b b b b b b 5 a a b a,b a a a,b a 6+ b a b b b b 3 5 NFA equivalent to FA1FA2

Example (FA2 accepts Null string) a,b b a a p- q FA1 FA2 r + b a, b x  y a, b

a,b b a a p- q r + b a, b a, b x + y a, b NFA equivalent to FA1FA2

Example (Both FAs accept Null string) y a, b x FA1 FA2 b a 1 4 3 2

b y a, b x b 1+ 3 b a a a a a b 4 2 b NFA equivalent to FA1FA2

NFA corresponding to the Closure of an FA Apparently, it seems that since closure of an FA accepts the Null string, so the required NFA may be obtained considering the initial state of given FA to be final as well, but this may allow the unwanted string to be accepted as well. For example, an FA, with two states, accepting the language of strings, defined over. Σ={a, b}, ending in a, will accept all unwanted strings, if the initial state is supposed to be final as well.

NFA for the Closure of an FA Continued … Method: Thus, to accommodate this situation, introduce an initial state which should be final as well (so that the Null string is accepted) 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. Introduce new transitions, for each letter, at each of the final states (including new final state) with those connected with the old start state.This creates non-determinism and hence results in the required NFA.

Example Consider the following FA It may be observed that the FA* accepts only the additional string which is the Null string. a,b b a 2 a 1- 3 + b

Example Continued … Considering the state 1 to be final as well, will allow the unwanted strings be accepted as well. Hence the required NFA is constructed introducing the new initial state, shown below. a,b 2 a b 1 3 + ±

Example Consider the following FA It may be observed that the FA* accepts only the additional string which is the Null string a b 2 + 1–

Example Continued … As observed in the previous example the required NFA can be constructed only if the new initial state is introduced as shown below. a b a a b 1 2 + ± b

Summing Up NFA corresponding to union of FAs,example, NFA corresponding to concatenation of FAs,examples, NFA corresponding to closure of an FA,example