Costas Busch - LSU1 Non-Deterministic Finite Automata.

Slides:



Advertisements
Similar presentations
1 Non Deterministic Automata. 2 Alphabet = Nondeterministic Finite Accepter (NFA)
Advertisements

1 Non Deterministic Automata. 2 Alphabet = Nondeterministic Finite Accepter (NFA)
CSE 311 Foundations of Computing I
Lecture 6 Nondeterministic Finite Automata (NFA)
Finite Automata CPSC 388 Ellen Walker Hiram College.
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 Languages. 2 A language is a set of strings String: A sequence of letters Examples: “cat”, “dog”, “house”, … Defined over an alphabet: Languages.
1 Introduction to Computability Theory Lecture3: Regular Expressions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture4: Regular Expressions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture3: Regular Expressions Prof. Amos Israeli.
Introduction to Computability Theory
Costas Busch - RPI1 Single Final State for NFAs. Costas Busch - RPI2 Any NFA can be converted to an equivalent NFA with a single final state.
Courtesy Costas Busch - RPI1 Non Deterministic Automata.
Fall 2006Costas Busch - RPI1 Regular Expressions.
1 Regular Expressions. 2 Regular expressions describe regular languages Example: describes the language.
Fall 2006Costas Busch - RPI1 Deterministic Finite Automata And Regular Languages.
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 2004COMP 3351 Single Final State for NFA. Fall 2004COMP 3352 Any NFA can be converted to an equivalent NFA with a single final state.
1 Languages and Finite Automata or how to talk to machines...
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.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Nondeterminism.
1 NFAs accept the Regular Languages. 2 Equivalence of Machines Definition: Machine is equivalent to machine if.
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.
1 Non-Deterministic Automata Regular Expressions.
Finite Automata Costas Busch - RPI.
Fall 2004COMP 3351 Another NFA Example. Fall 2004COMP 3352 Language accepted (redundant state)
Fall 2006Costas Busch - RPI1 PDAs Accept Context-Free Languages.
1 Non-Deterministic Finite Automata. 2 Alphabet = Nondeterministic Finite Automaton (NFA)
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.
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,
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.
Fall 2006Costas Busch - RPI1 Deterministic Finite Automaton (DFA) Input Tape “Accept” or “Reject” String Finite Automaton Output.
Prof. Busch - LSU1 NFAs accept the Regular Languages.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2010.
CHAPTER 1 Regular Languages
Regular Expressions Costas Busch - LSU.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2007.
CS 154 Formal Languages and Computability February 9 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron.
Chapter 5 Finite Automata Finite State Automata n Capable of recognizing numerous symbol patterns, the class of regular languages n Suitable for.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
Equivalence with FA * Any Regex can be converted to FA and vice versa, because: * Regex and FA are equivalent in their descriptive power ** Regular language.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2006.
Theory of Computation Automata Theory Dr. Ayman Srour.
Costas Busch - LSU1 PDAs Accept Context-Free Languages.
Costas Busch - LSU1 Deterministic Finite Automata And Regular Languages.
Languages.
Non Deterministic Automata
Busch Complexity Lectures: Turing Machines
Busch Complexity Lectures: Reductions
Reductions Costas Busch - LSU.
Pushdown Automata PDAs
NPDAs Accept Context-Free Languages
Single Final State for NFA
Chapter 2 FINITE AUTOMATA.
Deterministic Finite Automata And Regular Languages Prof. Busch - LSU.
Non-Deterministic Finite Automata
Properties of Regular Languages
Non-Deterministic Finite Automata
CSE322 Definition and description of finite Automata
Decidable Languages Costas Busch - LSU.
Non Deterministic Automata
Undecidable problems:
Chapter 1 Regular Language
NFAs accept the Regular Languages
Non Deterministic Automata
Presentation transcript:

Costas Busch - LSU1 Non-Deterministic Finite Automata

Costas Busch - LSU2 Alphabet = Nondeterministic Finite Automaton (NFA)

Costas Busch - LSU3 No transition Two choices No transition Alphabet =

Costas Busch - LSU4 First Choice

Costas Busch - LSU5 First Choice

Costas Busch - LSU6 “accept” First Choice All input is consumed

Costas Busch - LSU7 Second Choice

Costas Busch - LSU8 Second Choice “reject” Input cannot be consumed Automaton Halts

Costas Busch - LSU9 An NFA accepts a string: if there is a computation of the NFA that accepts the string i.e., all the input string is processed and the automaton is in an accepting state

Costas Busch - LSU10 is accepted by the NFA: “accept” “reject” because this computation accepts this computation is ignored

Costas Busch - LSU11 Rejection example

Costas Busch - LSU12 First Choice “reject”

Costas Busch - LSU13 Second Choice

Costas Busch - LSU14 Second Choice “reject”

Costas Busch - LSU15 Another Rejection example

Costas Busch - LSU16 First Choice

Costas Busch - LSU17 “reject” First Choice Input cannot be consumed Automaton halts

Costas Busch - LSU18 Second Choice

Costas Busch - LSU19 Second Choice “reject” Input cannot be consumed Automaton halts

Costas Busch - LSU20 An NFA rejects a string: if there is no computation of the NFA that accepts the string. All the input is consumed and the automaton is in a non accepting state The input cannot be consumed OR For each computation:

Costas Busch - LSU21 is rejected by the NFA: “reject” All possible computations lead to rejection

Costas Busch - LSU22 is rejected by the NFA: “reject” All possible computations lead to rejection

Costas Busch - LSU23 Language accepted:

Costas Busch - LSU24 Lambda Transitions

Costas Busch - LSU25

Costas Busch - LSU26

Costas Busch - LSU27 input tape head does not move Automaton changes state

Costas Busch - LSU28 “accept” String is accepted all input is consumed

Costas Busch - LSU29 Rejection Example

Costas Busch - LSU30

Costas Busch - LSU31 (read head doesn’t move)

Costas Busch - LSU32 “reject” String is rejected Input cannot be consumed Automaton halts

Costas Busch - LSU33 Language accepted:

Costas Busch - LSU34 Another NFA Example

Costas Busch - LSU35

Costas Busch - LSU36

Costas Busch - LSU37 “accept”

Costas Busch - LSU38 Another String

Costas Busch - LSU39

Costas Busch - LSU40

Costas Busch - LSU41

Costas Busch - LSU42

Costas Busch - LSU43

Costas Busch - LSU44 “accept”

Costas Busch - LSU45 Language accepted

Costas Busch - LSU46 Another NFA Example

Costas Busch - LSU47 Language accepted (redundant state)

Costas Busch - LSU48 Remarks: The symbol never appears on the input tape Simple automata:

Costas Busch - LSU49 NFADFA NFAs are interesting because we can express languages easier than DFAs

Costas Busch - LSU50 Formal Definition of NFAs Set of states, i.e. Input aplhabet, i.e. Transition function Initial state Accepting states

Costas Busch - LSU51 Transition Function resulting states with following one transition with symbol

Costas Busch - LSU52 States reachable from scanning

Costas Busch - LSU53 States reachable from scanning

Costas Busch - LSU54 States reachable from scanning nothing

Costas Busch - LSU55 States reachable from scanning

Costas Busch - LSU56 Extended Transition Function Same with but applied on strings

Costas Busch - LSU57 States reachable from scanning

Costas Busch - LSU58 States reachable from scanning

Costas Busch - LSU59 Special case: for any state

Costas Busch - LSU60 : there is a walk from to with label In general

Costas Busch - LSU61 The Language of an NFA The language accepted by is: Where for each and there is some (accepting state)

Costas Busch - LSU62

Costas Busch - LSU63

Costas Busch - LSU64

Costas Busch - LSU65

Costas Busch - LSU66

Costas Busch - LSU67

Costas Busch - LSU68 NFAs accept the Regular Languages

Costas Busch - LSU69 Equivalence of Machines Definition: Machine is equivalent to machine if

Costas Busch - LSU70 NFA DFA Example of equivalent machines

Costas Busch - LSU71 Theorem: Languages accepted by NFAs Regular Languages NFAs and DFAs have the same computation power, namely, they accept the same set of languages Languages accepted by DFAs

Costas Busch - LSU72 Languages accepted by NFAs Regular Languages accepted by NFAs Regular Languages we need to show Proof: AND

Costas Busch - LSU73 Languages accepted by NFAs Regular Languages Proof-Step 1 Every DFA is trivially a NFA Any language accepted by a DFA is also accepted by a NFA

Costas Busch - LSU74 Languages accepted by NFAs Regular Languages Proof-Step 2 Any NFA can be converted to an equivalent DFA Any language accepted by a NFA is also accepted by a DFA

Costas Busch - LSU75 Conversion of NFA to DFA NFA DFA

Costas Busch - LSU76 NFA DFA

Costas Busch - LSU77 NFA DFA empty set trap state

Costas Busch - LSU78 NFA DFA union

Costas Busch - LSU79 NFA DFA union

Costas Busch - LSU80 NFA DFA trap state

Costas Busch - LSU81 NFA DFA END OF CONSTRUCTION

Costas Busch - LSU82 General Conversion Procedure Input: an NFA Output: an equivalent DFA with

Costas Busch - LSU83 The NFA has states The DFA has states from the power set

Costas Busch - LSU84 1. Initial state of NFA: Initial state of DFA: Conversion Procedure Steps step

Costas Busch - LSU85 NFA DFA Example

Costas Busch - LSU86 2. For every DFA’s state compute in the NFA add transition to DFA Union step

Costas Busch - LSU87 NFA DFA Example

Costas Busch - LSU88 3. Repeat Step 2 for every state in DFA and symbols in alphabet until no more states can be added in the DFA step

Costas Busch - LSU89 NFA DFA Example

Costas Busch - LSU90 4. For any DFA state if some is accepting state in NFA Then, is accepting state in DFA step

Costas Busch - LSU91 NFA DFA Example

Costas Busch - LSU92 If we convert NFA to DFA then the two automata are equivalent: Lemma: Proof: AND We need to show:

Costas Busch - LSU93 First we show: We only need to prove:

Costas Busch - LSU94 symbols Consider NFA

Costas Busch - LSU95 denotes a possible sub-path like symbol

Costas Busch - LSU96 We will show that if then NFA DFA state label state label

Costas Busch - LSU97 More generally, we will show that if in : (arbitrary string) then NFA DFA

Costas Busch - LSU98 Proof by induction on Induction Basis: is true by construction of NFA DFA

Costas Busch - LSU99 Induction hypothesis: NFA DFA Suppose that the following hold

Costas Busch - LSU100 Induction Step: NFA DFA Then this is true by construction of

Costas Busch - LSU101 Therefore if NFA DFA then

Costas Busch - LSU102 We have shown: With a similar proof we can show: END OF PROOF Therefore: