Lecture 18 NFA’s with -transitions –NFA- ’s Formal definition Simplifies construction –LNFA- –Showing LNFA  is a subset of LNFA and therefore a subset.

Slides:



Advertisements
Similar presentations
CSE 311 Foundations of Computing I
Advertisements

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.
Complexity and Computability Theory I Lecture #4 Rina Zviel-Girshin Leah Epstein Winter
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 2 Mälardalen University 2005.
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 3 School of Innovation, Design and Engineering Mälardalen University 2012.
1 Module 20 NFA’s with -transitions –NFA- ’s Formal definition Simplifies construction –LNFA- –Showing LNFA  is a subset of LNFA (extra credit) and therefore.
1 Introduction to Computability Theory Lecture12: Reductions Prof. Amos Israeli.
Lecture 3UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 3.
1 Module 15 FSA’s –Defining FSA’s –Computing with FSA’s Defining L(M) –Defining language class LFSA –Comparing LFSA to set of solvable languages (REC)
1 Lecture 14 Language class LFSA –Study limits of what can be done with FSA’s –Closure Properties –Comparing to other language classes.
1 Module 19 LNFA subset of LFSA –Theorem 4.1 on page 131 of Martin textbook –Compare with set closure proofs Main idea –A state in FSA represents a set.
Lecture 8 Recursively enumerable (r.e.) languages
1 Lecture 21 Regular languages review –Several ways to define regular languages –Two main types of proofs/algorithms Relative power of two computational.
1 Module 21 Closure Properties for LFSA using NFA’s –From now on, when I say NFA, I mean any NFA including an NFA- unless I add a specific restriction.
Why the algorithm works! Converting an NFA into an FSA.
1 Lecture 13 FSA’s –Defining FSA’s –Computing with FSA’s Defining L(M) –Defining language class LFSA.
1 Lecture 20 Regular languages are a subset of LFSA –algorithm for converting any regular expression into an equivalent NFA –Builds on existing algorithms.
1 Lecture 26 Decision problems about regular languages –Basic problems are solvable halting, accepting, and emptiness problems –Solvability of other problems.
Lecture 3 Goals: Formal definition of NFA, acceptance of a string by an NFA, computation tree associated with a string. Algorithm to convert an NFA to.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Regular.
1 Lecture 16 FSA’s –Defining FSA’s –Computing with FSA’s Defining L(M) –Defining language class LFSA –Comparing LFSA to set of solvable languages (REC)
1 Module 18 NFA’s –nondeterministic transition functions computations are trees, not paths –L(M) and LNFA LFSA subset of LNFA –Comparing computational.
1 Lecture 16 FSA’s –Defining FSA’s –Computing with FSA’s Defining L(M) –Defining language class LFSA –Comparing LFSA to set of solvable languages (REC)
1 Lecture 18 Closure Properties of Language class LFSA –Remember ideas used in solvable languages unit –Set complement –Set intersection, union, difference,
CS5371 Theory of Computation Lecture 6: Automata Theory IV (Regular Expression = NFA = DFA)
Lecture 3 Goals: Formal definition of NFA, acceptance of a string by an NFA, computation tree associated with a string. Algorithm to convert an NFA to.
1 Lecture 15 Distinguishability –Definition –Help in designing/debugging FSA’s NFA’s –nondeterministic transition functions computations are trees, not.
1 Lecture 16 NFA’s –nondeterministic transition functions computations are trees, not paths –L(M) and LNFA LFSA subset of LNFA –Comparing computational.
1 Lecture 23 Decision problems about regular languages –Programs can be inputs to other programs FSA’s, NFA’s, regular expressions –Basic problems are.
1 Module 25 Decision problems about regular languages –Basic problems are solvable halting, accepting, and emptiness problems –Solvability of other problems.
1 Lecture 19 Closure Properties for LFSA using NFA’s –union second proof –concatenation –Kleene closure.
CS5371 Theory of Computation Lecture 4: Automata Theory II (DFA = NFA, Regular Language)
1 Lecture 20 LNFA subset of LFSA –Theorem 4.1 on page 105 of Martin textbook –Compare with set closure proofs Main idea –A state in FSA represents a set.
NFA- to NFA conversion. Purpose This presentation presents an example execution of the algorithm which takes as input an NFA with -transitions and produces.
1 Non-Deterministic Automata Regular Expressions.
Converting an NFA into an FSA Proving LNFA is a subset of LFSA.
1 Module 11 Proving more specific problems are not solvable Input transformation technique –Use subroutine theme to show that if one problem is unsolvable,
Lecture 4UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 4.
Why the algorithm works! Converting an NFA into an FSA.
Nondeterminism (Deterministic) FA required for every state q and every symbol  of the alphabet to have exactly one arrow out of q labeled . What happens.
Formal Language Finite set of alphabets Σ: e.g., {0, 1}, {a, b, c}, { ‘{‘, ‘}’ } Language L is a subset of strings on Σ, e.g., {00, 110, 01} a finite language,
NFA ε - NFA - DFA equivalence. What is an NFA An NFA is an automaton that its states might have none, one or more outgoing arrows under a specific symbol.
Basics of automata theory
Transition Diagrams Lecture 3 Wed, Jan 21, Building Transition Diagrams from Regular Expressions A regular expression consists of symbols a, b,
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2010.
1 FSA’s –Defining FSA’s –Computing with FSA’s Defining L(M) –Defining language class LFSA –Comparing LFSA to set of solvable languages (REC)
Regular Expressions Fundamental Data Structures and Algorithms Peter Lee March 13, 2003.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2007.
1 Module 12 Computation and Configurations –Formal Definition –Examples.
CS 154 Formal Languages and Computability February 9 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron.
1 Module 17 Closure Properties of Language class LFSA –Remember ideas used in solvable languages unit –Set complement –Set intersection, union, difference,
Chapter 5 Finite Automata Finite State Automata n Capable of recognizing numerous symbol patterns, the class of regular languages n Suitable for.
Nondeterministic Finite State Machines Chapter 5.
1 Module 12 Computation and Configurations –Formal Definition –Examples.
Complexity and Computability Theory I Lecture #5 Rina Zviel-Girshin Leah Epstein Winter
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2006.
NFA’s with  Transitions We extend the class of NFAs by allowing instantaneous transitions: 1.The automaton may be allowed to change its state without.
1 Section 11.2 Finite Automata Can a machine(i.e., algorithm) recognize a regular language? Yes! Deterministic Finite Automata A deterministic finite automaton.
Lexical analysis Finite Automata
Chapter 2 Finite Automata
Hierarchy of languages
Principles of Computing – UFCFA3-30-1
COSC 3340: Introduction to Theory of Computation
Finite Automata Reading: Chapter 2.
NFA TO DFA.
4b Lexical analysis Finite Automata
Chapter Five: Nondeterministic Finite Automata
4b Lexical analysis Finite Automata
Nondeterministic Finite State Automata (Dr. Torng)
What is it? The term "Automata" is derived from the Greek word "αὐτόματα" which means "self-acting". An automaton (Automata in plural) is an abstract self-propelled.
Presentation transcript:

Lecture 18 NFA’s with -transitions –NFA- ’s Formal definition Simplifies construction –LNFA- –Showing LNFA  is a subset of LNFA and therefore a subset of LFSA

Defining NFA- ’s

Change:  -transitions We now allow an NFA M to change state without reading input That is, we add the following categories of transitions to  –  (q  is allowed

Example a,b a aba b aab

Defining L(M) and LNFA- M accepts string x if one of the configurations reached is an accepting configuration –(q 0, x) |- * (f, ),f e A M rejects string x if all configurations reached are either not halting configurations or are rejecting configurations For an NFA- M, L(M) is the set of strings accepted by M LNFA- –Language L is in language class LNFA iff there exists an NFA M such that L(M) = L

LNFA- subset LFSA Recap of what we already know –Let M be any NFA –There exists an algorithm A 1 which constructs an FSA M’ such that L(M’) = L(M) New goal –Let M be any NFA- –There exists an algorithm A 2 which constructs an FSA M’ such that L(M’) = L(M)

Visualization Goal –Let M be any NFA- –There exists an algorithm A 2 which constructs an FSA M’ such that L(M’) = L(M) NFA- M FSA M’ A2A2

Modified Goal Question –Can we use any existing algorithms to simplify the task of developing algorithm A 2 ? Yes, we can use algorithm A 1 which converts an NFA M 1 into an FSA M’ such that L(M’) = L(M 1 ) NFA- M FSA M’A2A2 NFA- M FSA M’ Algorithm A 2 NFA  M 1 A1A1 A 2’

Reduction Sidebar Example of real-life reduction –Problem  2 that algorithm A 2 solves: Converting NFA- M into FSA M’ s.t. L(M’) = L(M) –Problem  1 that algorithm A 1 solves: Converting NFA M 1 into FSA M’ s.t. L(M’) = L(M 1 ) –Reduction Algorithm A 2’ : converts an NFA- M into an NFA M 1 s.t. L(M 1 ) = L(M) A 2’ maps input for problem  2 into an input for problem  1. –Essentially,  2 <= m  1 NFA- M FSA M’ Algorithm A 2 NFA  M 1 A1A1 A 2’

New Goal Difficulty –NFA- M can make transitions on –How can the NFA M 1 simulate these -transitions? NFA- M NFA M 1 A 2’ a bb

Basic Idea For each state q of M and each character  of , figure out which states are reachable from q taking any number of -transitions and exactly one transition on that character . In the NFA-  M 1, directly connect q to each of these states using an arc labeled with . NFA- M NFA M 1 A 2’ a bb b b b

Process State 2 NFA- M NFA-  M 1 A 2’ a bb b b b b b b

Process State 3 NFA- M NFA-  M 1 A 2’ a bb b b b b b b a a b

Final Picture NFA- M NFA-  M 1 A 2’ a bb b b b b b b a a b b b a a

Construction Input NFA- M = (Q, , q 0, , A) Output NFA M 1 = (Q 1,  1, q 1,  1, A 1 ) –What is Q 1 ? Q 1 = Q In this case, Q 1 = {1,2,3,4,5,6} –What is  1 ?  1 =  In this case,  1 =  = {a,b} –What is q 1 ? We always make q 1 = q 0 In this case q 1 = 1 a bb

Construction Input NFA- M = (Q, , q 0, , A) Output NFA M 1 = (Q 1,  1, q 1,  1, A 1 ) –What is  1 ?  1 (q,a) = the set of states reachable from state q in M taking any number of -transitions and exactly one transition on the character a –More on this later In this case –  1 (1,a) = {} –  1 (1,b) = {3,4,5} –What is A 1 ? A 1 = A with one minor change –If an accepting state is reachable from q 0 using only  -transitions, then we make q 1 an element of A 1 In this case, using only -transitions, no accepting state is reachable from q 0, so A 1 = A a bb

Computing  1 (q,a)  1 (q,a) = the set of states reachable from state q in M taking 0 or more -transitions and exactly one transition on the character a –Break this down into three steps First compute all states reachable from q using 0 or more -transitions –We call this set of states  (q) Next, compute all states reachable from any element of  (q) using the character a –We can denote these states as  (  (q),a) Finally, compute all states reachable from states in  (  (q),a) using 0 or more -transitions –We denote these states as  (  (  (q),a)) –This is the desired answer a bb

Example  1 (1,b) = {3,4,5} –Compute  (1), all states reachable from state 1 using 0 or more - transitions  (1) = {1,2} –Compute  (  (q),b), all states reachable from any element  (1) of using the character b:  (  (q),b) =  ({1,2},b) =  (1,b) U  (2,b) = {} U {3} = {3} –Compute  (  (  (q),a)), all states reachable from states in  (  (q),a) using 0 or more -transitions  (  (  (q),a)) =  (3) = {3,4,5} a bb

Comments You should be able to execute this algorithm –Convert any NFA- into an equivalent NFA. You should understand the idea behind this algorithm –Why the transition function is computed the way it is –Why A 1 may need to include q 1 in some cases You should understand the importance of this algorithm –Compiler role again –Use in combination with previous algorithm for converting any NFA into an equivalent FSA to create a new algorithm for converting any NFA- into an equivalent FSA

LNFA- = LFSA Implications –Let us primarily use the term LFSA to refer to this language class –Given a language L is in LFSA We know there exists an FSA M s.t. L(M) = L We know there exists an NFA M s.t. L(M) = L –To show a language L is in LFSA Show there exists an FSA M s.t. L(M) = L Show there exists an NFA- M s.t. L(M) = L