NFAε - NFA - DFA equivalence

Slides:



Advertisements
Similar presentations
Recognising Languages We will tackle the problem of defining languages by considering how we could recognise them. Problem: Is there a method of recognising.
Advertisements

CS 3240: Languages and Computation
Deterministic Turing Machines
Grammar types There are 4 types of grammars according to the types of rules: – General grammars – Context Sensitive grammars – Context Free grammars –
Non-Deterministic Finite Automata
CSE 311 Foundations of Computing I
Complexity and Computability Theory I Lecture #4 Rina Zviel-Girshin Leah Epstein Winter
Nondeterministic Finite Automata CS 130: Theory of Computation HMU textbook, Chapter 2 (Sec 2.3 & 2.5)
Introduction to Computability Theory
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.
CS5371 Theory of Computation
Courtesy Costas Busch - RPI1 Non Deterministic Automata.
1 Introduction to Computability Theory Lecture2: Non Deterministic Finite Automata (cont.) Prof. Amos Israeli.
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.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Nondeterminism.
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.
Fall 2006Costas Busch - RPI1 Non-Deterministic Finite Automata.
CS5371 Theory of Computation Lecture 4: Automata Theory II (DFA = NFA, Regular Language)
FSA Lecture 1 Finite State Machines. Creating a Automaton  Given a language L over an alphabet , design a deterministic finite automaton (DFA) M such.
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.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
1 Non-Deterministic Finite Automata. 2 Alphabet = Nondeterministic Finite Automaton (NFA)
CSE 311: Foundations of Computing Fall 2014 Lecture 23: State Minimization, NFAs.
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)
Lecture 23: Finite State Machines with no Outputs Acceptors & Recognizers.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
REGULAR LANGUAGES.
Theory of Computation, Feodor F. Dragan, Kent State University 1 Regular expressions: definition An algebraic equivalent to finite automata. We can build.
CHAPTER 1 Regular Languages
CSE 311 Foundations of Computing I Lecture 24 Finite State Machines Autumn 2012 CSE 3111.
INHERENT LIMITATIONS OF COMPUTER PROGAMS CSci 4011.
Theory of Computation Automata Theory Dr. Ayman Srour.
Recap: Nondeterministic Finite Automaton (NFA) A deterministic finite automaton (NFA) is a 5-tuple (Q, , ,s,F) where: Q is a finite set of elements called.
Nondeterminism The Chinese University of Hong Kong Fall 2011
NFAε - NFA - DFA equivalence
Lexical analysis Finite Automata
Lecture2 Regular Language
Non Deterministic Automata
Finite Automata a b A simplest computational model
Chapter 2 FINITE AUTOMATA.
CSC 4170 Theory of Computation Nondeterminism Section 1.2.
Non-Deterministic Finite Automata
COSC 3340: Introduction to Theory of Computation
Non-Deterministic Finite Automata
CSE322 Definition and description of finite Automata
Nondeterministic Finite Automata
Non Deterministic Automata
CSE 311: Foundations of Computing
NFAs and Transition Graphs
Finite Automata.
4b Lexical analysis Finite Automata
FORMAL LANGUAGES, AUTOMATA, AND COMPUTABILITY
Principles of Computing – UFCFA3-30-1
CSC 4170 Theory of Computation Nondeterminism Section 1.2.
CSE 311 Foundations of Computing I
CSC312 Automata Theory Transition Graphs Lecture # 9
Chapter 1 Regular Language
NFAs and Transition Graphs
Teori Bahasa dan Automata Lecture 6: Regular Expression
CHAPTER 1 Regular Languages
Non Deterministic Automata
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.
Nondeterminism The Chinese University of Hong Kong Fall 2010
Part Two : Nondeterministic Finite Automata
Presentation transcript:

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. A DFA is by definition an NFA (each state has exactly one outgoing arrow under each symbol). q0 q1 1 0,1

What is an NFAε An NFAε is an NFA that might have ε-moves. In an ε-move we can transport from one state to the other without having any symbols. An NFA is by definition an NFAε (but with no ε-moves). q0 q1 1 ε,1

NFA computation An NFA illustrates a machine that can have choices (just like our brains). If there are two arrows under a specific symbol it can choose either of them and follow it. So it works more or less like you. Suppose that you want to do something and that you can think of several methods to do it. Some of them can possibly fail but it suffices to find one that succeeds. An NFA accepts a string if there exists a path following arrows under the symbols of the string consecutively that takes us to an accept state.

Example q0 q1 1 0,1 This automaton accepts the string 1110 because there is a path under 1110 that takes us to an accept state (the path q0 , q0 , q0 , q1), beside the fact that there are paths under 1110 that fail (for example the path q0 , q0 , q1, q0). However it doesn’t accept the string 00 because there are no paths under 00 that can take us to q1.

NFA – DFA equivalence The language that an NFA recognizes is the set of strings which the NFA accepts. To see if a string is accepted it suffices to find the set of the possible states in which I can be with this string as input and see if a final state is contained in this set.

NFA – DFA eqivalence Whenever an arrow is followed, there is a set of possible following states that the NFA can be. This set of states is a subset of Q. For example with 0010 I have the following sequence of set of states: q0 q1 1 0,1 q2

NFA – DFA equivalence So I only want to keep information about these subsets of states that can be reached from the initial state after following arrows. Since all the subsets of Q are 2|Q| in total, this should be a finite (<= 2|Q|) number of subsets. I consider each subset of states of the NFA as a state of the DFA and every subset of states containing a final state as a final state of the DFA.

NFA – DFA equivalence Suppose that you want to find an equivalent DFA for an NFA . The algorithm is the following: Start from the start state and see where 0 or 1 takes you. For every new subset you find, see where 0 or 1 takes you. Repeat until no new subsets are found.

NFA – DFA equivalence (example) To find an equivalent DFA with the NFA of the figure I should complete the following table: 1 q0 {q1} {q0, q1} {q0, q2} {q0, q1, q2} q0 q1 1 0,1 q2

NFA – DFA equivalence (example) 1 0,1 So the DFA is: 1 q0 {q1} {q0, q1} {q0, q2} {q0, q1, q2}

NFAε – NFA equivalence An NFAε is an NFA in which I can have ε-moves. I want to get rid of ε-moves.

NFAε – NFA equivalence Suppose that I have an ε-move like in the figure. Since an ε-move is like teleporting from q1 to q2 I can remove the arrow with the ε and add several arrows from q1 to every neighbor of q2. q3 q3 q1 q4 q2 q1 ε q2 q4 q5 q5 1 1 1

NFAε – NFA equivalence If from q1 an ε-move takes me to q2 which is accept state then, when I remove the ε-move I should convert q1 to accept state. q1 q2 q4 q1 ε q2 q4