1 Lecture 16 NFA’s –nondeterministic transition functions computations are trees, not paths –L(M) and LNFA LFSA subset of LNFA –Comparing computational.

Slides:



Advertisements
Similar presentations
4b Lexical analysis Finite Automata
Advertisements

Complexity and Computability Theory I Lecture #4 Rina Zviel-Girshin Leah Epstein Winter
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 Lecture2: Non Deterministic Finite Automata Prof. Amos Israeli.
Introduction to Computability Theory
1 Introduction to Computability Theory Discussion1: Non-Deterministic Finite Automatons Prof. Amos Israeli.
Lecture 3UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 3.
Courtesy Costas Busch - RPI1 Non Deterministic Automata.
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.
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.
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.
Why the algorithm works! Converting an NFA into an FSA.
1 Module 16 Distinguishability –Definition –Help in designing/debugging FSA’s.
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.
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.
Lecture 18 NFA’s with -transitions –NFA- ’s Formal definition Simplifies construction –LNFA- –Showing LNFA  is a subset of LNFA and therefore a subset.
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 23 Decision problems about regular languages –Programs can be inputs to other programs FSA’s, NFA’s, regular expressions –Basic problems are.
Fall 2006Costas Busch - RPI1 Non-Deterministic Finite Automata.
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.
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.
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,
1.Defs. a)Finite Automaton: A Finite Automaton ( FA ) has finite set of ‘states’ ( Q={q 0, q 1, q 2, ….. ) and its ‘control’ moves from state to state.
Costas Busch - LSU1 Non-Deterministic Finite Automata.
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.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
1 Non-Deterministic Finite Automata. 2 Alphabet = Nondeterministic Finite Automaton (NFA)
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.
Regular Languages A language is regular over  if it can be built from ;, {  }, and { a } for every a 2 , using operators union ( [ ), concatenation.
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.
Nondeterministic Finite Automata CS 130: Theory of Computation HMU textbook, Chapter 2 (Sec 2.3 & 2.5)
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)
NFA defined. NFA A Non-deterministic Finite-state Automata (NFA) is a language recognizing system similar to a DFA. It supports a level of non-determinism.
INHERENT LIMITATIONS OF COMPUTER PROGAMS CSci 4011.
Brian K. Strickland a ba Λ a aa b Λ -NFA for Regular Expression (aab)*(a + aba)*
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,
1 Module 12 Computation and Configurations –Formal Definition –Examples.
Complexity and Computability Theory I Lecture #5 Rina Zviel-Girshin Leah Epstein Winter
Chapter 2 Finite Automata
CSC 4170 Theory of Computation Nondeterminism Section 1.2.
Hierarchy of languages
CSE322 Finite Automata Lecture #2.
Non-Determinism 12CS45 Finite Automata.
Non-Deterministic Finite Automata
COSC 3340: Introduction to Theory of Computation
Non-Deterministic Finite Automata
NFAs and Transition Graphs
Instructor: Aaron Roth
CSC 4170 Theory of Computation Nondeterminism Section 1.2.
Chapter 1 Regular Language
Nondeterministic Finite State Automata (Dr. Torng)
Non Deterministic Automata
Part Two : Nondeterministic Finite Automata
Presentation transcript:

1 Lecture 16 NFA’s –nondeterministic transition functions computations are trees, not paths –L(M) and LNFA LFSA subset of LNFA –Comparing computational models

2 Nondeterministic Finite State Automata NFA’s

3 Change:  is a relation For an FSA M,  (q,a) results in one and only one state for all states q and characters a. –That is,  is a function For an NFA M,  (q,a) can result in a set of states –That is,  is now a relation –Next step is not determined (nondeterministic)

4 Example NFA aaab a,b Why is this only an NFA and not an FSA? Out of the first state, there are 2 transitions on a Out of the second state, there are 0 transitions on b Out of the third state, there are 0 transitions on a Out of the fourth state, there are 0 transitions on b

5 Computing with NFA’s Configurations: same as they are for FSA’s Computations are different –Initial configuration is identical –However, there may be several next configurations or there may be none. Computation is no longer a “path” but is now a “tree” rooted at the initial configuration –Definition of halting, accepting, and rejecting configurations is identical –Definition of acceptance must be modified

6 Computation Tree aaab a,b Input string aaaaba (1, aaaaba) (1, aaaba)(2, aaaba) (1, aaba)(2, aaba)(3, aaba)(1, aba)(2, aba)(3, aba)crash(1, ba)(2, ba)(3, ba) (1, a)(4, a) (1, )(2, )(5, )

7 Definition of |- unchanged aaab a,b Input string aaaaba (1, aaaaba) |- (1, aaaba) (1, aaaaba) |- (2, aaaba) (1, aaaaba) |- 3 (1, aba) (1, aaaaba) |- 3 (3, aba) (1, aaaaba) |- * (2, aba) (1, aaaaba) |- * (3, aba) (1, aaaaba) |- * (1, ) (1, aaaaba) |- * (5, ) (1, aaaaba) (1, aaaba)(2, aaaba) (1, aaba)(2, aaba)(3, aaba) (1, aba)(2, aba)(3, aba)crash (1, ba)(2, ba)(3, ba) (1, a)(4, a) (1, )(2, )(5, )

8 Acceptance and Rejection aaab a,b Input string aaaaba 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 (1, aaaaba) (1, aaaba)(2, aaaba) (1, aaba)(2, aaba)(3, aaba) (1, aba)(2, aba)(3, aba)crash (1, ba)(2, ba)(3, ba) (1, a)(4, a) (1, )(2, )(5, )

9 Comparison aaa a,b b b b b a FSA aaab a,b NFA

10 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

11 Comparing language classes LFSA subset of LNFA

12 LFSA subset LNFA Let L be an arbitrary language in LFSA Let M be the FSA such that L(M) = L –M exists by definition of L in LFSA Construct an NFA M’ such that L(M’) = L Argue L(M’) = L There exists an NFA M’ such that L(M’) = L L is in LNFA –By definition of L in LNFA

13 Visualization LFSA LNFA FSA’s NFA’s L L M M’ Let L be an arbitrary language in LFSA Let M be an FSA such that L(M) = L M exists by definition of L in LFSA Construct NFA M’ from FSA M Argue L(M’) = L There exists an NFA M’ such that L(M’) = L L is in LNFA

14 Construction We need to make M into an NFA M’ such that L(M’) = L(M) How do we accomplish this? –Trivial –Every FSA already IS an NFA

15 Comparing computational models The previous slides show one method for comparing the relative power of two different computational models –Computational model CM 1 is at least as general or powerful as computational model CM 2 if Any program P 2 from computational model CM 2 can be converted into an equivalent program P 1 in computational model CM 1. –Question: How can we show two computational models are equivalent?