Suche senden
Hochladen
Alofairi Adel
•
Als PPT, PDF herunterladen
•
0 gefällt mir
•
297 views
Adel Al-Ofairi
Folgen
Alofairi Adel
Weniger lesen
Mehr lesen
Technologie
Diashow-Anzeige
Melden
Teilen
Diashow-Anzeige
Melden
Teilen
1 von 30
Jetzt herunterladen
Empfohlen
Nondeterministic Finite Automata
Nondeterministic Finite Automata
Adel Al-Ofairi
Nondeterministic Finite Automat
Nondeterministic Finite Automat
Adel Al-Ofairi
1.3.2 non deterministic finite automaton
1.3.2 non deterministic finite automaton
Sampath Kumar S
NFA Non Deterministic Finite Automata by Mudasir khushik
NFA Non Deterministic Finite Automata by Mudasir khushik
MudsaraliKhushik
Nondeterministic Finite Automata
Nondeterministic Finite Automata
parmeet834
NFA or Non deterministic finite automata
NFA or Non deterministic finite automata
deepinderbedi
Lec 3 ---- dfa
Lec 3 ---- dfa
Abdul Aziz
Finite automata
Finite automata
Rajesh Yaramadi
Empfohlen
Nondeterministic Finite Automata
Nondeterministic Finite Automata
Adel Al-Ofairi
Nondeterministic Finite Automat
Nondeterministic Finite Automat
Adel Al-Ofairi
1.3.2 non deterministic finite automaton
1.3.2 non deterministic finite automaton
Sampath Kumar S
NFA Non Deterministic Finite Automata by Mudasir khushik
NFA Non Deterministic Finite Automata by Mudasir khushik
MudsaraliKhushik
Nondeterministic Finite Automata
Nondeterministic Finite Automata
parmeet834
NFA or Non deterministic finite automata
NFA or Non deterministic finite automata
deepinderbedi
Lec 3 ---- dfa
Lec 3 ---- dfa
Abdul Aziz
Finite automata
Finite automata
Rajesh Yaramadi
Finite automata
Finite automata
Sutee Sudprasert
Formal Languages and Automata Theory Unit 1
Formal Languages and Automata Theory Unit 1
Srimatre K
Dfa h11
Dfa h11
Rajendran
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
Mohammad Ilyas Malik
Finite automata(For college Seminars)
Finite automata(For college Seminars)
Naman Joshi
simple problem to convert NFA with epsilon to without epsilon
simple problem to convert NFA with epsilon to without epsilon
kanikkk
Nfa vs dfa
Nfa vs dfa
raosir123
NFA Converted to DFA , Minimization of DFA , Transition Diagram
NFA Converted to DFA , Minimization of DFA , Transition Diagram
Abdullah Jan
Finite automata-for-lexical-analysis
Finite automata-for-lexical-analysis
Dattatray Gandhmal
Finite Automata
Finite Automata
parmeet834
Minimization of DFA
Minimization of DFA
kunj desai
Automata
Automata
Gaditek
1.3.1 deterministic finite automaton
1.3.1 deterministic finite automaton
Sampath Kumar S
Finite automata examples
Finite automata examples
ankitamakin
Nfa egs
Nfa egs
ankitamakin
Formal Languages and Automata Theory unit 5
Formal Languages and Automata Theory unit 5
Srimatre K
Ch2 finite automaton
Ch2 finite automaton
meresie tesfay
Automata
Automata
Jena Catherine Bel D
Theory of Computation Unit 4
Theory of Computation Unit 4
Jena Catherine Bel D
Lexicalanalyzer
Lexicalanalyzer
Royalzig Luxury Furniture
World Future Society Arizona Chapter September 2014 Meeting
World Future Society Arizona Chapter September 2014 Meeting
Eric Kingsbury, MBA
Nuclear Energy
Nuclear Energy
Asif Lemon
Weitere ähnliche Inhalte
Was ist angesagt?
Finite automata
Finite automata
Sutee Sudprasert
Formal Languages and Automata Theory Unit 1
Formal Languages and Automata Theory Unit 1
Srimatre K
Dfa h11
Dfa h11
Rajendran
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
Mohammad Ilyas Malik
Finite automata(For college Seminars)
Finite automata(For college Seminars)
Naman Joshi
simple problem to convert NFA with epsilon to without epsilon
simple problem to convert NFA with epsilon to without epsilon
kanikkk
Nfa vs dfa
Nfa vs dfa
raosir123
NFA Converted to DFA , Minimization of DFA , Transition Diagram
NFA Converted to DFA , Minimization of DFA , Transition Diagram
Abdullah Jan
Finite automata-for-lexical-analysis
Finite automata-for-lexical-analysis
Dattatray Gandhmal
Finite Automata
Finite Automata
parmeet834
Minimization of DFA
Minimization of DFA
kunj desai
Automata
Automata
Gaditek
1.3.1 deterministic finite automaton
1.3.1 deterministic finite automaton
Sampath Kumar S
Finite automata examples
Finite automata examples
ankitamakin
Nfa egs
Nfa egs
ankitamakin
Formal Languages and Automata Theory unit 5
Formal Languages and Automata Theory unit 5
Srimatre K
Ch2 finite automaton
Ch2 finite automaton
meresie tesfay
Automata
Automata
Jena Catherine Bel D
Theory of Computation Unit 4
Theory of Computation Unit 4
Jena Catherine Bel D
Lexicalanalyzer
Lexicalanalyzer
Royalzig Luxury Furniture
Was ist angesagt?
(20)
Finite automata
Finite automata
Formal Languages and Automata Theory Unit 1
Formal Languages and Automata Theory Unit 1
Dfa h11
Dfa h11
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
Finite automata(For college Seminars)
Finite automata(For college Seminars)
simple problem to convert NFA with epsilon to without epsilon
simple problem to convert NFA with epsilon to without epsilon
Nfa vs dfa
Nfa vs dfa
NFA Converted to DFA , Minimization of DFA , Transition Diagram
NFA Converted to DFA , Minimization of DFA , Transition Diagram
Finite automata-for-lexical-analysis
Finite automata-for-lexical-analysis
Finite Automata
Finite Automata
Minimization of DFA
Minimization of DFA
Automata
Automata
1.3.1 deterministic finite automaton
1.3.1 deterministic finite automaton
Finite automata examples
Finite automata examples
Nfa egs
Nfa egs
Formal Languages and Automata Theory unit 5
Formal Languages and Automata Theory unit 5
Ch2 finite automaton
Ch2 finite automaton
Automata
Automata
Theory of Computation Unit 4
Theory of Computation Unit 4
Lexicalanalyzer
Lexicalanalyzer
Andere mochten auch
World Future Society Arizona Chapter September 2014 Meeting
World Future Society Arizona Chapter September 2014 Meeting
Eric Kingsbury, MBA
Nuclear Energy
Nuclear Energy
Asif Lemon
Legal Law on Bangladeshi Perspective
Legal Law on Bangladeshi Perspective
Shakhawatul Islam SaaGooR
Investment opportunities in bangladesh
Investment opportunities in bangladesh
ardilabid
Redesigning the future of education in Knowmad Society: Our next steps
Redesigning the future of education in Knowmad Society: Our next steps
John Moravec
Drones: The Future of Society
Drones: The Future of Society
Xavier Imperial
SME in Bangladesh
SME in Bangladesh
Maliha Jahan
Report On SME Development in Bangladesh
Report On SME Development in Bangladesh
Fahad Aziz
Entrepreneurship development in bangladesh
Entrepreneurship development in bangladesh
limz69
The digital transformation of society and business: 2020. Futurist keynote sp...
The digital transformation of society and business: 2020. Futurist keynote sp...
Gerd Leonhard
SME ( Small and Medium Enterprises)
SME ( Small and Medium Enterprises)
Mohammad Alam
history of bangladesh
history of bangladesh
Ashraf Rahman
Bangladesh Presentation
Bangladesh Presentation
dyernathan
Part 5: Putting it all together
Part 5: Putting it all together
NAPWA
TTN Sports Pingpong Training 1
TTN Sports Pingpong Training 1
Duong Thinh
Roses
Roses
guestaf9e7ba
asdfghjkl;\'
asdfghjkl;\'
guest075159
ABTCP-Tappi Presentation 2010
ABTCP-Tappi Presentation 2010
SteveScheibe
失落的一角
失落的一角
chen bowei
Classical Series
Classical Series
Catherine Crowe
Andere mochten auch
(20)
World Future Society Arizona Chapter September 2014 Meeting
World Future Society Arizona Chapter September 2014 Meeting
Nuclear Energy
Nuclear Energy
Legal Law on Bangladeshi Perspective
Legal Law on Bangladeshi Perspective
Investment opportunities in bangladesh
Investment opportunities in bangladesh
Redesigning the future of education in Knowmad Society: Our next steps
Redesigning the future of education in Knowmad Society: Our next steps
Drones: The Future of Society
Drones: The Future of Society
SME in Bangladesh
SME in Bangladesh
Report On SME Development in Bangladesh
Report On SME Development in Bangladesh
Entrepreneurship development in bangladesh
Entrepreneurship development in bangladesh
The digital transformation of society and business: 2020. Futurist keynote sp...
The digital transformation of society and business: 2020. Futurist keynote sp...
SME ( Small and Medium Enterprises)
SME ( Small and Medium Enterprises)
history of bangladesh
history of bangladesh
Bangladesh Presentation
Bangladesh Presentation
Part 5: Putting it all together
Part 5: Putting it all together
TTN Sports Pingpong Training 1
TTN Sports Pingpong Training 1
Roses
Roses
asdfghjkl;\'
asdfghjkl;\'
ABTCP-Tappi Presentation 2010
ABTCP-Tappi Presentation 2010
失落的一角
失落的一角
Classical Series
Classical Series
Ähnlich wie Alofairi Adel
Theory of Computation - Lectures 6 & 7
Theory of Computation - Lectures 6 & 7
Dr. Maamoun Ahmed
MidtermI-review.pptx
MidtermI-review.pptx
amara jyothi
CS911-Lecture-13_34826.pptx
CS911-Lecture-13_34826.pptx
ALIZAIB KHAN
Introduction to the theory of computation
Introduction to the theory of computation
prasadmvreddy
Unit2 Toc.pptx
Unit2 Toc.pptx
viswanath kani
2. context free langauages
2. context free langauages
danhumble
Implementation of lexical analyser
Implementation of lexical analyser
Archana Gopinath
Nondeterministic Finite Automata AFN.pdf
Nondeterministic Finite Automata AFN.pdf
SergioUlisesRojasAla
Theory of Computation Regular Expressions, Minimisation & Pumping Lemma
Theory of Computation Regular Expressions, Minimisation & Pumping Lemma
Rushabh2428
SS UI Lecture 6
SS UI Lecture 6
Avinash Kapse
Lec1.pptx
Lec1.pptx
ziadk6872
Chapter 2 limits of DFA NDFA.ppt
Chapter 2 limits of DFA NDFA.ppt
ArwaKhallouf
Resumen material MIT
Resumen material MIT
Rawel Luciano
Final fa part1
Final fa part1
Megha Khanna
deterministicfiniteautomatondfa-181008145215 (1).pdf
deterministicfiniteautomatondfa-181008145215 (1).pdf
AmayJaiswal4
Theory of Computation FSM Conversions and Problems
Theory of Computation FSM Conversions and Problems
Rushabh2428
5. NFA & DFA.pdf
5. NFA & DFA.pdf
TANZINTANZINA
Regular Expression to Finite Automata
Regular Expression to Finite Automata
Archana Gopinath
FiniteAutomata_anim.pptx
FiniteAutomata_anim.pptx
amara jyothi
FiniteAutomata_anim.pptx
FiniteAutomata_anim.pptx
ranjan317165
Ähnlich wie Alofairi Adel
(20)
Theory of Computation - Lectures 6 & 7
Theory of Computation - Lectures 6 & 7
MidtermI-review.pptx
MidtermI-review.pptx
CS911-Lecture-13_34826.pptx
CS911-Lecture-13_34826.pptx
Introduction to the theory of computation
Introduction to the theory of computation
Unit2 Toc.pptx
Unit2 Toc.pptx
2. context free langauages
2. context free langauages
Implementation of lexical analyser
Implementation of lexical analyser
Nondeterministic Finite Automata AFN.pdf
Nondeterministic Finite Automata AFN.pdf
Theory of Computation Regular Expressions, Minimisation & Pumping Lemma
Theory of Computation Regular Expressions, Minimisation & Pumping Lemma
SS UI Lecture 6
SS UI Lecture 6
Lec1.pptx
Lec1.pptx
Chapter 2 limits of DFA NDFA.ppt
Chapter 2 limits of DFA NDFA.ppt
Resumen material MIT
Resumen material MIT
Final fa part1
Final fa part1
deterministicfiniteautomatondfa-181008145215 (1).pdf
deterministicfiniteautomatondfa-181008145215 (1).pdf
Theory of Computation FSM Conversions and Problems
Theory of Computation FSM Conversions and Problems
5. NFA & DFA.pdf
5. NFA & DFA.pdf
Regular Expression to Finite Automata
Regular Expression to Finite Automata
FiniteAutomata_anim.pptx
FiniteAutomata_anim.pptx
FiniteAutomata_anim.pptx
FiniteAutomata_anim.pptx
Kürzlich hochgeladen
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
Hervé Boutemy
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
gvaughan
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
Zilliz
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
BookNet Canada
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
Fwdays
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
SeasiaInfotech2
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Mark Simos
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Zilliz
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
Enterprise Knowledge
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
Lorenzo Miniero
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
BookNet Canada
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
Sergiu Bodiu
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
Padma Pradeep
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
Fwdays
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
NavinnSomaal
Training state-of-the-art general text embedding
Training state-of-the-art general text embedding
Zilliz
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
Scott Keck-Warren
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
2toLead Limited
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
ScyllaDB
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
Commit University
Kürzlich hochgeladen
(20)
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
Training state-of-the-art general text embedding
Training state-of-the-art general text embedding
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
Alofairi Adel
1.
Formal Language, chapter
5, slide 1 Copyright © 2007 by Adam Webber Chapter Five: Nondeterministic Finite Automata AL-ofairi Adel Ahmed
2.
Formal Language, chapter
5, slide 2 Copyright © 2007 by Adam Webber A DFA has exactly one transition from every state on every symbol in the alphabet. By relaxing this requirement we get a related but more flexible kind of automaton: the nondeterministic finite automaton or NFA. NFAs are a bit harder to think about than DFAs, because they do not appear to define simple computational processes. They may seem at first to be unnatural, like puzzles invented by professors for the torment of students. But have patience! NFAs and other kinds of nondeterministic automata arise naturally in many ways, as you will see later in this book, and they too have a variety of practical applications.
3.
Formal Language, chapter
5, slide 3 Copyright © 2007 by Adam Webber Outline • 5.1 Relaxing a Requirement • 5.2 Spontaneous Transitions • 5.3 Nondeterminism • 5.4 The 5-Tuple for an NFA • 5.5 The Language Accepted by an NFA
4.
Formal Language, chapter
5, slide 4 Copyright © 2007 by Adam Webber Not A DFA • Does not have exactly one transition from every state on every symbol: – Two transitions from q0 on a – No transition from q0 (on either a or b) • Though not a DFA, this can be taken as defining a language, in a slightly different way q1 a,b q0 a
5.
Formal Language, chapter
5, slide 5 Copyright © 2007 by Adam Webber Possible Sequences of Moves • We'll consider all possible sequences of moves the machine might make for a given string • For example, on the string aa there are three: – From q0 to q0 to q0, rejecting – From q0 to q0 to q1, accepting – From q0 to q1, getting stuck on the last a • Our convention for this new kind of machine: a string is in L(M) if there is at least one accepting sequence q1 a,b q0 a
6.
Formal Language, chapter
5, slide 6 Copyright © 2007 by Adam Webber Nondeterministic Finite Automaton (NFA) • L(M) = the set of strings that have at least one accepting sequence • In the example above, L(M) = {xa | x ∈ {a,b}*} • A DFA is a special case of an NFA: – An NFA that happens to be deterministic: there is exactly one transition from every state on every symbol – So there is exactly one possible sequence for every string • NFA is not necessarily deterministic q1 a,b q0 a
7.
Formal Language, chapter
5, slide 7 Copyright © 2007 by Adam Webber NFA Advantage • An NFA for a language can be smaller and easier to construct than a DFA • Strings whose next-to-last symbol is 1: DFA: NFA: 0 0 0 1 1 1 1 0 0,1 0,1 1
8.
Formal Language, chapter
5, slide 8 Copyright © 2007 by Adam Webber Outline • 5.1 Relaxing a Requirement • 5.2 Spontaneous Transitions • 5.3 Nondeterminism • 5.4 The 5-Tuple for an NFA • 5.5 The Language Accepted by an NFA
9.
Formal Language, chapter
5, slide 9 Copyright © 2007 by Adam Webber Spontaneous Transitions • An NFA can make a state transition spontaneously, without consuming an input symbol • Shown as an arrow labeled with ε • For example, {a}* ∪ {b}*: q0 aq1 q2 b
10.
Formal Language, chapter
5, slide 10 Copyright © 2007 by Adam Webber ε-Transitions To Accepting States • An ε-transition can be made at any time • For example, there are three sequences on the empty string – No moves, ending in q0, rejecting – From q0 to q1, accepting – From q0 to q2, accepting • Any state with an ε-transition to an accepting state ends up working like an accepting state too q0 aq1 q2 b
11.
Formal Language, chapter
5, slide 11 Copyright © 2007 by Adam Webber ε-transitions For NFA Combining ∀ ε-transitions are useful for combining smaller automata into larger ones • This machine is combines a machine for {a}* and a machine for {b}* • It uses an ε-transition at the start to achieve the union of the two languages q0 aq1 q2 b
12.
Formal Language, chapter
5, slide 12 Copyright © 2007 by Adam Webber Incorrect Union A = {an | n is odd} B = {bn | n is odd} A ∪ B ? No: this NFA accepts aab a a b b a a b b
13.
Formal Language, chapter
5, slide 13 Copyright © 2007 by Adam Webber Correct Union A = {an | n is odd} B = {bn | n is odd} A ∪ B a a b b a a b b
14.
Formal Language, chapter
5, slide 14 Copyright © 2007 by Adam Webber Incorrect Concatenation A = {an | n is odd} B = {bn | n is odd} {xy | x ∈ A and y ∈ B} ? No: this NFA accepts abbaab a a b b a a b b
15.
Formal Language, chapter
5, slide 15 Copyright © 2007 by Adam Webber Correct Concatenation A = {an | n is odd} B = {bn | n is odd} {xy | x ∈ A and y ∈ B} a a b b a a b b
16.
Formal Language, chapter
5, slide 16 Copyright © 2007 by Adam Webber Outline • 5.1 Relaxing a Requirement • 5.2 Spontaneous Transitions • 5.3 Nondeterminism • 5.4 The 5-Tuple for an NFA • 5.5 The Language Accepted by an NFA
17.
Formal Language, chapter
5, slide 17 Copyright © 2007 by Adam Webber DFAs and NFAs • DFAs and NFAs both define languages • DFAs do it by giving a simple computational procedure for deciding language membership: – Start in the start state – Make one transition on each symbol in the string – See if the final state is accepting • NFAs do it without such a clear-cut procedure: – Search all legal sequences of transitions on the input string? – How? In what order?
18.
Formal Language, chapter
5, slide 18 Copyright © 2007 by Adam Webber Nondeterminism • The essence of nondeterminism: – For a given input there can be more than one legal sequence of steps – The input is in the language if at least one of the legal sequences says so • We can achieve the same result by deterministically searching the legal sequences, but… • ...this nondeterminism does not directly correspond to anything in physical computer systems • In spite of that, NFAs have many practical applications
19.
Formal Language, chapter
5, slide 19 Copyright © 2007 by Adam Webber Outline • 5.1 Relaxing a Requirement • 5.2 Spontaneous Transitions • 5.3 Nondeterminism • 5.4 The 5-Tuple for an NFA • 5.5 The Language Accepted by an NFA
20.
Formal Language, chapter
5, slide 20 Copyright © 2007 by Adam Webber Powerset • If S is a set, the powerset of S is the set of all subsets of S: P(S) = {R | R ⊆ S} • This always includes the empty set and S itself • For example, P({1,2,3}) = {{}, {1}, {2}, {3}, {1,2}, {1,3}, {2,3}, {1,2,3}}
21.
Formal Language, chapter
5, slide 21 Copyright © 2007 by Adam Webber The 5-Tuple • The only change from a DFA is the transition function δ ∀ δ takes two inputs: – A state from Q (the current state) – A symbol from Σ∪{ε} (the next input, or ε for an ε-transition) ∀ δ produces one output: – A subset of Q (the set of possible next states) An NFA M is a 5-tuple M = (Q, Σ, δ, q0, F), where: Q is the finite set of states Σ is the alphabet (that is, a finite set of symbols) δ ∈ (Q × (Σ∪{ε}) → P(Q)) is the transition function q0 ∈ Q is the start state F ⊆ Q is the set of accepting states
22.
Formal Language, chapter
5, slide 22 Copyright © 2007 by Adam Webber Example: • Formally, M = (Q, Σ, δ, q0, F), where – Q = {q0,q1,q2} Σ = {a,b} (we assume: it must contain at least a and b) – F = {q2} δ(q0,a) = {q0,q1}, δ(q0,b) = {q0}, δ(q0,ε) = {q2}, δ(q1,a) = {}, δ(q1,b) = {q2}, δ(q1,ε) = {} δ(q2,a) = {}, δ(q2,b) = {}, δ(q2,ε) = {} • The language defined is {a,b}* q0 q1 a q2 b a,b
23.
Formal Language, chapter
5, slide 23 Copyright © 2007 by Adam Webber Outline • 5.1 Relaxing a Requirement • 5.2 Spontaneous Transitions • 5.3 Nondeterminism • 5.4 The 5-Tuple for an NFA • 5.5 The Language Accepted by an NFA
24.
Formal Language, chapter
5, slide 24 Copyright © 2007 by Adam Webber The δ* Function • The δ function gives 1-symbol moves • We'll define δ* so it gives whole-string results (by applying zero or more δ moves) • For DFAs, we used this recursive definition δ*(q,ε) = q δ*(q,xa) = δ(δ*(q,x),a) • The intuition is the similar for NFAs, but the ε-transitions add some technical hair
25.
Formal Language, chapter
5, slide 25 Copyright © 2007 by Adam Webber NFA IDs • An instantaneous description (ID) is a description of a point in an NFA's execution • It is a pair (q,x) where – q ∈ Q is the current state – x ∈ Σ* is the unread part of the input • Initially, an NFA processing a string x has the ID (q0,x) • An accepting sequence of moves ends in an ID (f,ε) for some accepting state f ∈ F
26.
Formal Language, chapter
5, slide 26 Copyright © 2007 by Adam Webber The One-Move Relation On IDs • We write if I is an ID and J is an ID that could follow from I after one move of the NFA • That is, for any string x ∈ Σ* and any ω ∈ Σ or ω = ε, I a J q,ωx( )a r ,x()if and only if r ∈δq,w( )
27.
Formal Language, chapter
5, slide 27 Copyright © 2007 by Adam Webber The Zero-Or-More-Move Relation • We write if there is a sequence of zero or more moves that starts with I and ends with J: • Because it allows zero moves, it is a reflexive relation: for all IDs I, I a∗ J I a L a J I a∗ I
28.
Formal Language, chapter
5, slide 28 Copyright © 2007 by Adam Webber The δ* Function • Now we can define the δ* function for NFAs: • Intuitively, δ*(q,x) is the set of all states the NFA might be in after starting in state q and reading x • Our definition allows ε-transitions, including those made before the first symbol of x is read, and those made after the last δ∗ q,x( )=r q,x( )a∗ r,ε( ){ }
29.
Formal Language, chapter
5, slide 29 Copyright © 2007 by Adam Webber M Accepts x • Now δ*(q,x) is the set of states M may end in, starting from state q and reading all of string x • So δ*(q0,x) tells us whether M accepts x: A string x ∈ Σ* is accepted by an NFA M = (Q, Σ, δ, q0, F) if and only if δ*(q0, x) contains at least one element of F.
30.
Formal Language, chapter
5, slide 30 Copyright © 2007 by Adam Webber For any NFA M = (Q, Σ, δ, q0, F), L(M) denotes the language accepted by M, which is L(M) = {x ∈ Σ* | δ*(q0, x) ∩ F ≠ {}}. The Language An NFA Defines
Jetzt herunterladen