Finite Automata. Dr. Neil T. Dantam. Fall CSCI-561, Colorado School of Mines. Dantam (Mines CSCI-561) Finite Automata Fall / 43
|
|
- Scarlett Fitzgerald
- 5 years ago
- Views:
Transcription
1 Finite Automata Dr. Neil T. Dantam CSCI-561, Colorado School of Mines Fall 2018 Dantam (Mines CSCI-561) Finite Automata Fall / 43
2 Outline Languages Review Traffic Light Example Deterministic Finite Automata Nondeterministic Finite Automata Dantam (Mines CSCI-561) Finite Automata Fall / 43
3 Languages Review Outline Languages Review Traffic Light Example Deterministic Finite Automata Nondeterministic Finite Automata Dantam (Mines CSCI-561) Finite Automata Fall / 43
4 Languages Review Alphabets Symbol: An abstract, primitive, atomic thing Examples: a, x, 4, θ, ℵ,!, Set: An unordered collection, without repetition Alphabet: A non-empty, finite set of symbols Σ B = {0, 1} Σ E = {a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z} Σ C = {,,, } Dantam (Mines CSCI-561) Finite Automata Fall / 43
5 Languages Review String Sequence: An ordered list of objects Example: (1, 2, 3, 5, 8,...) Abbreviated Notation: Empty (zero-length) sequence: String: A sequence over some alphabet Γ B = Γ E = hello Γ C = Dantam (Mines CSCI-561) Finite Automata Fall / 43
6 Languages Review Languages Language: A set of strings Examples: Alternations of 0 and 1: {, 01, 10, 0101, 1010, , ,...} 0s and 1s with no consecutive 1s: {, 0, 1, 00, 01, 10, 000, 001, 010, 100, 101, 0000, 0001, 0010, 0100, 0101,...} Dantam (Mines CSCI-561) Finite Automata Fall / 43
7 Languages Review Exercise: Languages Strings of 0s and 1s ending in 1: Strings 0s and 1s with an even number of 1s: Dantam (Mines CSCI-561) Finite Automata Fall / 43
8 Traffic Light Example Outline Languages Review Traffic Light Example Deterministic Finite Automata Nondeterministic Finite Automata Dantam (Mines CSCI-561) Finite Automata Fall / 43
9 Traffic Light Example Traffic Light Example State: NS = {red, yellow, green} EW = {red, yellow, green} timeout = {0, 1} Sensors: Q = {timeout, ns-car, ew-car} gr timeout grt ew-car yr timeout timeout rg timeout rgt ns-car ry Dantam (Mines CSCI-561) Finite Automata Fall / 43
10 Traffic Light Example Traffic Light w/ Pedestrian Example State: NS = {red, yellow, green}, EW = {red, yellow, green}, timeout = {0, 1}, pedestrian = {0, 1} Sensors: Q = {timeout, ns-car, ew-car, pedestrian} timeout ry ns-car ew-car gr timeout grt ew-car pedestrian yr timeout yrp rg timeout rgt timeout pedestrian ryp timeout rrp timeout rrpt ns-car More: Left-turn arrows Railroad crossings Synchronize with other lights Dantam (Mines CSCI-561) Finite Automata Fall / 43
11 Traffic Light Example Transition Table gr timeout grt ew-car yr timeout timeout rg timeout rgt ns-car state timeout ns-car ew-car gr grt grt yr yr rg rg rgt rgt ry ry gr ry / SWITCH CASE / e v e n t = n e x t e v e n t ( ) ; switch ( s t a t e ) { case GR: switch ( e v e n t ) { case TIMEOUT: s t a t e = GRT; break ; d e f a u l t : s t a t e = DEAD; } /... / } / LOOKUP TABLE / e v e n t = n e x t e v e n t ( ) ; s t a t e = t a b l e [ s t a t e ] [ e v e n t ] ; Dantam (Mines CSCI-561) Finite Automata Fall / 43
12 Deterministic Finite Automata Outline Languages Review Traffic Light Example Deterministic Finite Automata Nondeterministic Finite Automata Dantam (Mines CSCI-561) Finite Automata Fall / 43
13 Deterministic Finite Automata Deterministic Finite Automata (DFA) Definition: Deterministic Finite Automata (DFA) A deterministic finite automaton is a 5-tuple: M = (Q, Σ, δ, q 0, F ), where Q is a finite set call the states Σ is a finite set call the alphabet δ : Q Σ Q is the transition function q 0 Q is the start state F Q is the set of accept states Dantam (Mines CSCI-561) Finite Automata Fall / 43
14 Deterministic Finite Automata Conceptual DFA Operation tape M : Σ {accept, reject} σ = σ 0 } σ 1... {{ σ k 1 } history σ k σ k+1 }... {{ σ n } future Finite Control Q {accept, reject} accept Reach end of tape (string) with control in accept state q F reject Reach end of tape (string) with control not in accept state q F language The language of M is the set of strings accepted by M, L (M) = {x M(x) = accept} Dantam (Mines CSCI-561) Finite Automata Fall / 43
15 Deterministic Finite Automata Graphical DFA L (M) = {x {0, 1} x ends in 1} states Q Graph Nodes alphabet Σ Graph Edge Labels transition function δ Graph Edges start state q 0 Designed graph node accept states F Double-circled graph nodes start start q 0 q 1 0 state 0 1 F q 0 q 0 q 1 0 q 1 q 0 q 1 1 Dantam (Mines CSCI-561) Finite Automata Fall / 43
16 Deterministic Finite Automata Example: FA Design q even q odd L (M) = {w {0, 1} the number of 1s is odd} What state do we need to track? What are the state transitions? What are the start and accept states? q even 1 q odd 0 0 start 1 q even 1 q odd Dantam (Mines CSCI-561) Finite Automata Fall / 43
17 Deterministic Finite Automata Example: FA Design continued q even q odd 0 0 q even 1 1 q odd state 0 1 F q even q even q odd 0 q odd q odd q even 1 0 start q even q odd Dantam (Mines CSCI-561) Finite Automata Fall / 43
18 Deterministic Finite Automata Exercise: FA Design L (M) = {w {0, 1} w ends in a 1} Dantam (Mines CSCI-561) Finite Automata Fall / 43
19 Deterministic Finite Automata Symbolic DFA Semantics Transition Function δ : Q Σ Q Extended Transition Function ˆδ : Q Σ Q base ˆδ(q, ) = q inductive For a Σ and ω Σ, ˆδ (q, aω) = ˆδ (δ (q, a), ω) Accept ˆδ(q 0, ω) F M accepts ω Reject ˆδ(q 0, ω) F M rejects ω { } Language L (M) = ω Σ ˆδ(q 0, ω) F M recognizes L (M) Dantam (Mines CSCI-561) Finite Automata Fall / 43
20 Deterministic Finite Automata Example: DFA Simulation start q even 1 q odd state 0 1 F q e q even q odd 0 q odd q odd q even 1 Simulate the DFA on the following strings: ˆδ (q even, ) q even ˆδ (qeven, 01) ˆδ (q even, 1) ˆδ (q odd, ) q odd ˆδ (qeven, 010) ˆδ (q even, 10) ˆδ (q odd, 0) ˆδ (q odd, ) q odd Dantam (Mines CSCI-561) Finite Automata Fall / 43
21 Deterministic Finite Automata Algorithm: DFA Simulation Algorithm 1: DFA-Simulate(M) Input: M = (Q, Σ, δ, q 0, F ) ; // states,alphabet,transition,start,accept Output: y {accept, reject} 1 q q 0 ; /* Read next symbol on input tape */ 2 σ next() ; 3 while σ EOF do /* Follow state transition */ 4 q δ(q, σ) ; /* Read next symbol on input tape */ 5 σ next() ; 6 if q F then y accept; 7 else y reject; Dantam (Mines CSCI-561) Finite Automata Fall / 43
22 Deterministic Finite Automata Exercise: DFA Simulation Simulate the DFA on the following strings: Dantam (Mines CSCI-561) Finite Automata Fall / 43
23 Deterministic Finite Automata Regular Languages The regular set is the set of languages that can be recognized by DFAs R = {L (M) M is a DFA} A language is a regular language if some DFA accepts it (L R) M, (L = L (M)) What languages are not regular? Dantam (Mines CSCI-561) Finite Automata Fall / 43
24 Nondeterministic Finite Automata Outline Languages Review Traffic Light Example Deterministic Finite Automata Nondeterministic Finite Automata Dantam (Mines CSCI-561) Finite Automata Fall / 43
25 Nondeterministic Finite Automata Determinism vs. Nondeterminism tape σ 0 σ 1 σ 2 σ 3... Deterministic Transition to single state δ dfa (q i, σ) = q j δ(q 0, σ 0 ) δ(d 1, σ 1 ) δ(d 2, σ 2 ) δ(d 3, σ 3 ) q 0 d 1 d 2 d 3... Nondeterministic Transition to a multiple states δ nfa (q i, σ) = {q j, q k, q l,...} q 0 n 10. n 20.. n 11. Dantam (Mines CSCI-561) Finite Automata Fall / 43
26 Nondeterministic Finite Automata Example: NFA and Transition Table start a start q 0 q 1 q 2 0 s, followed by 1 s, followed by 2 s b q 0 q 1 q 2 a, b a state F q 0 {q 0 } {q 1 } 0 q 1 {q 1 } {q 2 } 0 q 2 {q 2 } 1 state a b F q 0 {q 1 } {q 2 } 1 q 1 {q 1, q 2 } {q 2 } 0 q 2 {q 0 } 0 Dantam (Mines CSCI-561) Finite Automata Fall / 43
27 Nondeterministic Finite Automata Nondeterministic Finite Automata (NFA) Definition: Nondeterministic Finite Automata (NFA) A nondeterministic finite automaton is a 5-tuple: N = (Q, Σ, δ, q 0, F ), where Q is a finite set call the states Σ is a finite set call the alphabet δ : Q Σ P (Q) is the transition function q 0 Q is the start state F Q is the set of accept states Dantam (Mines CSCI-561) Finite Automata Fall / 43
28 Nondeterministic Finite Automata Exercise: NFA Transition Table start q 1 0 q 4 q q 2 q 3 Dantam (Mines CSCI-561) Finite Automata Fall / 43
29 Nondeterministic Finite Automata NFA vs. DFA Given: NFA N = (Q N, Σ, δ N, q 0,N, F N ) Find: DFA M = (Q M, Σ, δ M, q 0,N, F M ), such that L (M) = L (N) Solution: DFA states are sets of NFA states NFA DFA states Q N Q M = P (Q N ) alphabet Σ Σ transition δ N : Q N Σ P (Q N ) δ M (Q, σ) {q Q N σ-reachable from q i Q} start q 0,N Q N q 0,M = {q Q N -reachable from q 0,N } accept F N Q N F M = {q m Q M q m F N } Every NFA has an equivalent DFA Dantam (Mines CSCI-561) Finite Automata Fall / 43
30 Nondeterministic Finite Automata Practical usage of DFAs vs. NFAs Today s physical computers are deterministic Options: 1. Simulate NFA by tracking all possible current states 2. Convert NFA to DFA by constructing the subsets of NFA state set Which option is better? Dantam (Mines CSCI-561) Finite Automata Fall / 43
31 Nondeterministic Finite Automata NFA Subset Construction Subroutines closure(q) States reachable from q on transitions move- closure(q, σ) States reachable from state q after reading symbol σ Construct the reachable subsets of NFA states Dantam (Mines CSCI-561) Finite Automata Fall / 43
32 Nondeterministic Finite Automata Example: -closure start q 0 q 1 q 2 -closure(q 0 ) = {q 0, q 1, q 2 } -closure(q 1 ) = {q 1, q 2 } -closure(q 2 ) = {q 2 } a start q 0 b a q 1 a, b q 2 -closure(q 0 ) = {q 0, q 2 } -closure(q 1 ) = {q 1 } -closure(q 2 ) = {q 2 } States reachable from initial state on only transitions Dantam (Mines CSCI-561) Finite Automata Fall / 43
33 Nondeterministic Finite Automata Algorithm: closure Algorithm 2: -closure(nfa,s,c) Input: NFA, S, C ; // NFA, unvisited states, initial closure Output: C ; // final closure /* visit: P (Q) Q P (Q) */ 1 function visit(c,q) is 2 if q c then // base case, state q already in closure c 3 return c; 4 else // Recursive case, visit all -successors of state q 5 return closure NFA, p, {q} c q p NFA }{{} ; add q to closure }{{} -neighbors of q 6 C fold-left(visit, C, S) ; Dantam (Mines CSCI-561) Finite Automata Fall / 43
34 Nondeterministic Finite Automata Exercise: closure start q 1 0 q 4 q q 2 q 3 Dantam (Mines CSCI-561) Finite Automata Fall / 43
35 Nondeterministic Finite Automata Example: move--closure start q 0 q 1 q 2 move--closure(q 0, 0) = {q 0, q 1, q 2 } move--closure(q 0, 1) = {q 1, q 2 } move--closure(q 0, 2) = {q 2 } a start q 0 b a q 1 a, b q 2 move--closure(q 0, a) = {q 0, q 2 } move--closure(q 1, a) = {q 1, q 2 } move--closure(q 2, a) = {q 0, q 2 } States reachable from initial state after reading one symbol Dantam (Mines CSCI-561) Finite Automata Fall / 43
36 Nondeterministic Finite Automata Algorithm: move- closure Algorithm 3: move--closure(nfa,q,σ) Input: NFA, Q, σ ; // NFA, initial states, token Output: C ; // reachable states 1 function visit(c,q) is 2 return closure NFA, σ reachable from q { }} { p q σ p NFA, c ; }{{} -reachable after move 3 C fold-left visit,, closure(nfa, Q, ) ; }{{} -reachable from Q Dantam (Mines CSCI-561) Finite Automata Fall / 43
37 Nondeterministic Finite Automata Exercise: move closure start q 1 0 q 4 q q 2 q 3 Dantam (Mines CSCI-561) Finite Automata Fall / 43
38 Nondeterministic Finite Automata Example 0: NFA to DFA NFA start q 0 q 1 q 2 DFA start 1 2 q 0, q1, q2 q 1, q2 q 2 Dantam (Mines CSCI-561) Finite Automata Fall / 43 2
39 Nondeterministic Finite Automata Example 1: NFA to DFA a NFA start q 0 b a q 1 a, b q 2 DFA a start q 0, q 2 b a q 1 b q 2 a b a q 1, q 2 q 0, q 1, q 2 a b Dantam (Mines CSCI-561) Finite Automata Fall / 43
40 Nondeterministic Finite Automata Algorithm: NFA Simulation Algorithm 4: NFA-Simulate(N) Input: N = (Q, Σ, δ, q 0, F ) ; // states,alphabet,transition,start,accept Output: y {accept, reject} 1 c -closure(q 0 ); /* Read next symbol on input tape */ 2 σ next() ; 3 while σ EOF do /* Follow state transition */ 4 c move--closure(n, c, σ) ; /* Read next symbol on input tape */ 5 σ next() ; 6 if c F then 7 y accept; 8 else 9 y reject; Dantam (Mines CSCI-561) Finite Automata Fall / 43
41 Nondeterministic Finite Automata Algorithm: NFA to DFA Subset Construction Functional Version Algorithm 5: NFA-to-DFA: Functional Input: N = (Q, Σ, E, q 0, F ) ; // NFA states, alphabet, edges, start, accept Output: M = (Q, Σ, E, q 0, F ) ; // DFA states, alphabet, edges, start, accept 1 Q ; // Subsets 2 function visit-state(e,u) is 3 function visit-symbol(e,σ) is 4 u move--closure(u, σ) ; // Find successor subset: u σ u ( } ) 5 if u then return visit-state e {u σ u, u ; 6 else return e ; 7 if u Q then return e ; // Subset already constructed 8 else 9 Q Q {u}; 10 return fold-left(visit-symbol, Σ, e) ; 11 q 0 -closure(q 0); 12 E visit-state(, q 0 ); 13 F = {q Q q F }; Dantam (Mines CSCI-561) Finite Automata Fall / 43
42 Nondeterministic Finite Automata Algorithm: NFA to DFA Subset Construction Procedural Version Algorithm 6: NFA-to-DFA: Procedural Input: N = (Q, Σ, E, q 0, F ) ; // NFA states, alphabet, edges, start, accept Output: M = (Q, Σ, E, q 0, F ) ; // DFA states, alphabet, edges, start, accept 1 q 0 -closure(q 0) ; 2 Q {q 0 }; 3 E ; 4 W {q 0 }; // Work set 5 while W do // Construct Subsets 6 u pop(w ); 7 forall σ Σ do // Check for transition from Q i on symbol σ 8 u = move--closure(u, σ) ; 9 if u then 10 if u Q then W W {u } ; // Add to work list 11 Q Q {u } ; // Add new subset } 12 E E {u σ u ; // Add new edge/transition /* Accept States */ 13 F = {q Q q F } Dantam (Mines CSCI-561) Finite Automata Fall / 43
43 Nondeterministic Finite Automata Exercise: NFA to DFA start q 1 0 q 4 q q 2 q 3 Dantam (Mines CSCI-561) Finite Automata Fall / 43
Finite Automata. Dr. Neil T. Dantam. Fall CSCI-561, Colorado School of Mines. Dantam (Mines CSCI-561) Finite Automata Fall / 35
Finite Automata Dr. Neil T. Dantam CSCI-561, Colorado School of Mines Fall 2017 Dantam (Mines CSCI-561) Finite Automata Fall 2017 1 / 35 Outline Dantam (Mines CSCI-561) Finite Automata Fall 2017 2 / 35
More informationLecture 1: Finite State Automaton
Lecture 1: Finite State Automaton Instructor: Ketan Mulmuley Scriber: Yuan Li January 6, 2015 1 Deterministic Finite Automaton Informally, a deterministic finite automaton (DFA) has finite number of s-
More informationDeterministic Finite Automaton (DFA)
1 Lecture Overview Deterministic Finite Automata (DFA) o accepting a string o defining a language Nondeterministic Finite Automata (NFA) o converting to DFA (subset construction) o constructed from a regular
More informationPushdown Automata (Pre Lecture)
Pushdown Automata (Pre Lecture) Dr. Neil T. Dantam CSCI-561, Colorado School of Mines Fall 2017 Dantam (Mines CSCI-561) Pushdown Automata (Pre Lecture) Fall 2017 1 / 41 Outline Pushdown Automata Pushdown
More informationAutomata and Languages
Automata and Languages Prof. Mohamed Hamada Software Engineering Lab. The University of Aizu Japan Nondeterministic Finite Automata with empty moves (-NFA) Definition A nondeterministic finite automaton
More informationCOM364 Automata Theory Lecture Note 2 - Nondeterminism
COM364 Automata Theory Lecture Note 2 - Nondeterminism Kurtuluş Küllü March 2018 The FA we saw until now were deterministic FA (DFA) in the sense that for each state and input symbol there was exactly
More informationDeterministic Finite Automata. Non deterministic finite automata. Non-Deterministic Finite Automata (NFA) Non-Deterministic Finite Automata (NFA)
Deterministic Finite Automata Non deterministic finite automata Automata we ve been dealing with have been deterministic For every state and every alphabet symbol there is exactly one move that the machine
More informationExtended transition function of a DFA
Extended transition function of a DFA The next two pages describe the extended transition function of a DFA in a more detailed way than Handout 3.. p./43 Formal approach to accepted strings We define the
More informationNondeterministic Finite Automata
Nondeterministic Finite Automata Not A DFA Does not have exactly one transition from every state on every symbol: Two transitions from q 0 on a No transition from q 1 (on either a or b) Though not a DFA,
More informationClarifications from last time. This Lecture. Last Lecture. CMSC 330: Organization of Programming Languages. Finite Automata.
CMSC 330: Organization of Programming Languages Last Lecture Languages Sets of strings Operations on languages Finite Automata Regular expressions Constants Operators Precedence CMSC 330 2 Clarifications
More informationCS 208: Automata Theory and Logic
CS 28: Automata Theory and Logic b a a start A x(la(x) y(x < y) L b (y)) B b Department of Computer Science and Engineering, Indian Institute of Technology Bombay of 32 Nondeterminism Alternation 2 of
More informationRegular Expressions (Pre Lecture)
Regular Expressions (Pre Lecture) Dr. Neil T. Dantam CSCI-561, Colorado School of Mines Fall 2017 Dantam (Mines CSCI-561) Regular Expressions (Pre Lecture) Fall 2017 1 / 39 Regular Expressions Outline
More informationCS 154, Lecture 2: Finite Automata, Closure Properties Nondeterminism,
CS 54, Lecture 2: Finite Automata, Closure Properties Nondeterminism, Why so Many Models? Streaming Algorithms 0 42 Deterministic Finite Automata Anatomy of Deterministic Finite Automata transition: for
More informationOutline. Nondetermistic Finite Automata. Transition diagrams. A finite automaton is a 5-tuple (Q, Σ,δ,q 0,F)
Outline Nondeterminism Regular expressions Elementary reductions http://www.cs.caltech.edu/~cs20/a October 8, 2002 1 Determistic Finite Automata A finite automaton is a 5-tuple (Q, Σ,δ,q 0,F) Q is a finite
More informationChapter Five: Nondeterministic Finite Automata
Chapter Five: Nondeterministic Finite Automata From DFA to NFA 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
More informationNondeterministic Finite Automata
Nondeterministic Finite Automata Lecture 6 Section 2.2 Robb T. Koether Hampden-Sydney College Mon, Sep 5, 2016 Robb T. Koether (Hampden-Sydney College) Nondeterministic Finite Automata Mon, Sep 5, 2016
More informationLanguages. Non deterministic finite automata with ε transitions. First there was the DFA. Finite Automata. Non-Deterministic Finite Automata (NFA)
Languages Non deterministic finite automata with ε transitions Recall What is a language? What is a class of languages? Finite Automata Consists of A set of states (Q) A start state (q o ) A set of accepting
More informationT (s, xa) = T (T (s, x), a). The language recognized by M, denoted L(M), is the set of strings accepted by M. That is,
Recall A deterministic finite automaton is a five-tuple where S is a finite set of states, M = (S, Σ, T, s 0, F ) Σ is an alphabet the input alphabet, T : S Σ S is the transition function, s 0 S is the
More informationTheory of Computation (I) Yijia Chen Fudan University
Theory of Computation (I) Yijia Chen Fudan University Instructor Yijia Chen Homepage: http://basics.sjtu.edu.cn/~chen Email: yijiachen@fudan.edu.cn Textbook Introduction to the Theory of Computation Michael
More informationNondeterministic finite automata
Lecture 3 Nondeterministic finite automata This lecture is focused on the nondeterministic finite automata (NFA) model and its relationship to the DFA model. Nondeterminism is an important concept in the
More informationCS 154. Finite Automata, Nondeterminism, Regular Expressions
CS 54 Finite Automata, Nondeterminism, Regular Expressions Read string left to right The DFA accepts a string if the process ends in a double circle A DFA is a 5-tuple M = (Q, Σ, δ, q, F) Q is the set
More informationChapter 5. Finite Automata
Chapter 5 Finite Automata 5.1 Finite State Automata Capable of recognizing numerous symbol patterns, the class of regular languages Suitable for pattern-recognition type applications, such as the lexical
More informationSeptember 7, Formal Definition of a Nondeterministic Finite Automaton
Formal Definition of a Nondeterministic Finite Automaton September 7, 2014 A comment first The formal definition of an NFA is similar to that of a DFA. Both have states, an alphabet, transition function,
More informationDecision, Computation and Language
Decision, Computation and Language Non-Deterministic Finite Automata (NFA) Dr. Muhammad S Khan (mskhan@liv.ac.uk) Ashton Building, Room G22 http://www.csc.liv.ac.uk/~khan/comp218 Finite State Automata
More informationFinite Automata. Finite Automata
Finite Automata Finite Automata Formal Specification of Languages Generators Grammars Context-free Regular Regular Expressions Recognizers Parsers, Push-down Automata Context Free Grammar Finite State
More informationCMSC 330: Organization of Programming Languages
CMSC 330: Organization of Programming Languages Theory of Regular Expressions DFAs and NFAs Reminders Project 1 due Sep. 24 Homework 1 posted Exam 1 on Sep. 25 Exam topics list posted Practice homework
More informationLet us first give some intuitive idea about a state of a system and state transitions before describing finite automata.
Finite Automata Automata (singular: automation) are a particularly simple, but useful, model of computation. They were initially proposed as a simple model for the behavior of neurons. The concept of a
More informationFinite Automata. Seungjin Choi
Finite Automata Seungjin Choi Department of Computer Science and Engineering Pohang University of Science and Technology 77 Cheongam-ro, Nam-gu, Pohang 37673, Korea seungjin@postech.ac.kr 1 / 28 Outline
More informationCMSC 330: Organization of Programming Languages. Theory of Regular Expressions Finite Automata
: Organization of Programming Languages Theory of Regular Expressions Finite Automata Previous Course Review {s s defined} means the set of string s such that s is chosen or defined as given s A means
More informationEquivalence of DFAs and NFAs
CS 172: Computability and Complexity Equivalence of DFAs and NFAs It s a tie! DFA NFA Sanjit A. Seshia EECS, UC Berkeley Acknowledgments: L.von Ahn, L. Blum, M. Blum What we ll do today Prove that DFAs
More informationChapter 6: NFA Applications
Chapter 6: NFA Applications Implementing NFAs The problem with implementing NFAs is that, being nondeterministic, they define a more complex computational procedure for testing language membership. To
More informationFinite Automata. BİL405 - Automata Theory and Formal Languages 1
Finite Automata BİL405 - Automata Theory and Formal Languages 1 Deterministic Finite Automata (DFA) A Deterministic Finite Automata (DFA) is a quintuple A = (Q,,, q 0, F) 1. Q is a finite set of states
More informationCS21 Decidability and Tractability
CS21 Decidability and Tractability Lecture 2 January 5, 2018 January 5, 2018 CS21 Lecture 2 1 Outline Finite Automata Nondeterministic Finite Automata Closure under regular operations NFA, FA equivalence
More informationNondeterminism. September 7, Nondeterminism
September 7, 204 Introduction is a useful concept that has a great impact on the theory of computation Introduction is a useful concept that has a great impact on the theory of computation So far in our
More informationJava II Finite Automata I
Java II Finite Automata I Bernd Kiefer Bernd.Kiefer@dfki.de Deutsches Forschungszentrum für künstliche Intelligenz November, 23 Processing Regular Expressions We already learned about Java s regular expression
More informationNondeterminism and Epsilon Transitions
Nondeterminism and Epsilon Transitions Mridul Aanjaneya Stanford University June 28, 22 Mridul Aanjaneya Automata Theory / 3 Challenge Problem Question Prove that any square with side length a power of
More informationcse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska
cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska LECTURE 6 CHAPTER 2 FINITE AUTOMATA 2. Nondeterministic Finite Automata NFA 3. Finite Automata and Regular Expressions 4. Languages
More informationSri vidya college of engineering and technology
Unit I FINITE AUTOMATA 1. Define hypothesis. The formal proof can be using deductive proof and inductive proof. The deductive proof consists of sequence of statements given with logical reasoning in order
More informationContext-Free Languages (Pre Lecture)
Context-Free Languages (Pre Lecture) Dr. Neil T. Dantam CSCI-561, Colorado School of Mines Fall 2017 Dantam (Mines CSCI-561) Context-Free Languages (Pre Lecture) Fall 2017 1 / 34 Outline Pumping Lemma
More informationFORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
5-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY NON-DETERMINISM and REGULAR OPERATIONS THURSDAY JAN 6 UNION THEOREM The union of two regular languages is also a regular language Regular Languages Are
More informationFinite Automata and Languages
CS62, IIT BOMBAY Finite Automata and Languages Ashutosh Trivedi Department of Computer Science and Engineering, IIT Bombay CS62: New Trends in IT: Modeling and Verification of Cyber-Physical Systems (2
More informationDeterministic Finite Automata (DFAs)
CS/ECE 374: Algorithms & Models of Computation, Fall 28 Deterministic Finite Automata (DFAs) Lecture 3 September 4, 28 Chandra Chekuri (UIUC) CS/ECE 374 Fall 28 / 33 Part I DFA Introduction Chandra Chekuri
More informationCS 455/555: Finite automata
CS 455/555: Finite automata Stefan D. Bruda Winter 2019 AUTOMATA (FINITE OR NOT) Generally any automaton Has a finite-state control Scans the input one symbol at a time Takes an action based on the currently
More informationSeptember 11, Second Part of Regular Expressions Equivalence with Finite Aut
Second Part of Regular Expressions Equivalence with Finite Automata September 11, 2013 Lemma 1.60 If a language is regular then it is specified by a regular expression Proof idea: For a given regular language
More informationLecture 4 Nondeterministic Finite Accepters
Lecture 4 Nondeterministic Finite Accepters COT 4420 Theory of Computation Section 2.2, 2.3 Nondeterminism A nondeterministic finite automaton can go to several states at once. Transitions from one state
More informationDeterministic Finite Automata (DFAs)
Algorithms & Models of Computation CS/ECE 374, Fall 27 Deterministic Finite Automata (DFAs) Lecture 3 Tuesday, September 5, 27 Sariel Har-Peled (UIUC) CS374 Fall 27 / 36 Part I DFA Introduction Sariel
More informationIntro to Theory of Computation
Intro to Theory of Computation 1/19/2016 LECTURE 3 Last time: DFAs and NFAs Operations on languages Today: Nondeterminism Equivalence of NFAs and DFAs Closure properties of regular languages Sofya Raskhodnikova
More informationcse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska
cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska LECTURE 5 CHAPTER 2 FINITE AUTOMATA 1. Deterministic Finite Automata DFA 2. Nondeterministic Finite Automata NDFA 3. Finite Automata
More informationCSCE 551 Final Exam, April 28, 2016 Answer Key
CSCE 551 Final Exam, April 28, 2016 Answer Key 1. (15 points) Fix any alphabet Σ containing the symbol a. For any language L Σ, define the language a\l := {w Σ wa L}. Show that if L is regular, then a\l
More informationCourse 4 Finite Automata/Finite State Machines
Course 4 Finite Automata/Finite State Machines The structure and the content of the lecture is based on (1) http://www.eecs.wsu.edu/~ananth/cpts317/lectures/index.htm, (2) W. Schreiner Computability and
More informationCS 154, Lecture 3: DFA NFA, Regular Expressions
CS 154, Lecture 3: DFA NFA, Regular Expressions Homework 1 is coming out Deterministic Finite Automata Computation with finite memory Non-Deterministic Finite Automata Computation with finite memory and
More informationCS243, Logic and Computation Nondeterministic finite automata
CS243, Prof. Alvarez NONDETERMINISTIC FINITE AUTOMATA (NFA) Prof. Sergio A. Alvarez http://www.cs.bc.edu/ alvarez/ Maloney Hall, room 569 alvarez@cs.bc.edu Computer Science Department voice: (67) 552-4333
More informationLecture 3: Nondeterministic Finite Automata
Lecture 3: Nondeterministic Finite Automata September 5, 206 CS 00 Theory of Computation As a recap of last lecture, recall that a deterministic finite automaton (DFA) consists of (Q, Σ, δ, q 0, F ) where
More informationRecap DFA,NFA, DTM. Slides by Prof. Debasis Mitra, FIT.
Recap DFA,NFA, DTM Slides by Prof. Debasis Mitra, FIT. 1 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
More informationTakeaway Notes: Finite State Automata
Takeaway Notes: Finite State Automata Contents 1 Introduction 1 2 Basics and Ground Rules 2 2.1 Building Blocks.............................. 2 2.2 The Name of the Game.......................... 2 3 Deterministic
More informationDeterministic Finite Automata (DFAs)
Algorithms & Models of Computation CS/ECE 374, Spring 29 Deterministic Finite Automata (DFAs) Lecture 3 Tuesday, January 22, 29 L A TEXed: December 27, 28 8:25 Chan, Har-Peled, Hassanieh (UIUC) CS374 Spring
More informationProofs, Strings, and Finite Automata. CS154 Chris Pollett Feb 5, 2007.
Proofs, Strings, and Finite Automata CS154 Chris Pollett Feb 5, 2007. Outline Proofs and Proof Strategies Strings Finding proofs Example: For every graph G, the sum of the degrees of all the nodes in G
More informationFinite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018
Finite Automata Theory and Formal Languages TMV27/DIT32 LP4 28 Lecture 5 Ana Bove March 26th 28 Recap: Inductive sets, (terminating) recursive functions, structural induction To define an inductive set
More informationNondeterministic Finite Automata. Nondeterminism Subset Construction
Nondeterministic Finite Automata Nondeterminism Subset Construction 1 Nondeterminism A nondeterministic finite automaton has the ability to be in several states at once. Transitions from a state on an
More informationCISC 4090: Theory of Computation Chapter 1 Regular Languages. Section 1.1: Finite Automata. What is a computer? Finite automata
CISC 4090: Theory of Computation Chapter Regular Languages Xiaolan Zhang, adapted from slides by Prof. Werschulz Section.: Finite Automata Fordham University Department of Computer and Information Sciences
More informationUNIT-II. NONDETERMINISTIC FINITE AUTOMATA WITH ε TRANSITIONS: SIGNIFICANCE. Use of ε-transitions. s t a r t. ε r. e g u l a r
Syllabus R9 Regulation UNIT-II NONDETERMINISTIC FINITE AUTOMATA WITH ε TRANSITIONS: In the automata theory, a nondeterministic finite automaton (NFA) or nondeterministic finite state machine is a finite
More informationClosure under the Regular Operations
September 7, 2013 Application of NFA Now we use the NFA to show that collection of regular languages is closed under regular operations union, concatenation, and star Earlier we have shown this closure
More informationClasses and conversions
Classes and conversions Regular expressions Syntax: r = ε a r r r + r r Semantics: The language L r of a regular expression r is inductively defined as follows: L =, L ε = {ε}, L a = a L r r = L r L r
More informationCS 154 Formal Languages and Computability Assignment #2 Solutions
CS 154 Formal Languages and Computability Assignment #2 Solutions Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak www.cs.sjsu.edu/~mak Assignment #2: Question 1
More informationCMPSCI 250: Introduction to Computation. Lecture #22: From λ-nfa s to NFA s to DFA s David Mix Barrington 22 April 2013
CMPSCI 250: Introduction to Computation Lecture #22: From λ-nfa s to NFA s to DFA s David Mix Barrington 22 April 2013 λ-nfa s to NFA s to DFA s Reviewing the Three Models and Kleene s Theorem The Subset
More informationNondeterministic Finite Automata
Nondeterministic Finite Automata COMP2600 Formal Methods for Software Engineering Katya Lebedeva Australian National University Semester 2, 206 Slides by Katya Lebedeva. COMP 2600 Nondeterministic Finite
More informationCSE 105 Theory of Computation Professor Jeanne Ferrante
CSE 105 Theory of Computation http://www.jflap.org/jflaptmp/ Professor Jeanne Ferrante 1 Today s agenda NFA Review and Design NFA s Equivalence to DFA s Another Closure Property proof for Regular Languages
More informationIntroduction to Formal Languages, Automata and Computability p.1/51
Introduction to Formal Languages, Automata and Computability Finite State Automata K. Krithivasan and R. Rama Introduction to Formal Languages, Automata and Computability p.1/51 Introduction As another
More informationChap. 1.2 NonDeterministic Finite Automata (NFA)
Chap. 1.2 NonDeterministic Finite Automata (NFA) DFAs: exactly 1 new state for any state & next char NFA: machine may not work same each time More than 1 transition rule for same state & input Any one
More informationIntroduction to the Theory of Computation. Automata 1VO + 1PS. Lecturer: Dr. Ana Sokolova.
Introduction to the Theory of Computation Automata 1VO + 1PS Lecturer: Dr. Ana Sokolova http://cs.uni-salzburg.at/~anas/ Setup and Dates Lectures Tuesday 10:45 pm - 12:15 pm Instructions Tuesday 12:30
More informationFinite Automata and Regular languages
Finite Automata and Regular languages Huan Long Shanghai Jiao Tong University Acknowledgements Part of the slides comes from a similar course in Fudan University given by Prof. Yijia Chen. http://basics.sjtu.edu.cn/
More informationTheory of Computation
Thomas Zeugmann Hokkaido University Laboratory for Algorithmics http://www-alg.ist.hokudai.ac.jp/ thomas/toc/ Lecture 3: Finite State Automata Motivation In the previous lecture we learned how to formalize
More informationCSE 311 Lecture 25: Relating NFAs, DFAs, and Regular Expressions. Emina Torlak and Kevin Zatloukal
CSE 3 Lecture 25: Relating NFAs, DFAs, and Regular Expressions Emina Torlak and Kevin Zatloukal Topics From regular expressions to NFAs Theorem, algorithm, and examples. From NFAs to DFAs Theorem, algorithm,
More information2017/08/29 Chapter 1.2 in Sipser Ø Announcement:
Nondeterministic Human-aware Finite Robo.cs Automata 2017/08/29 Chapter 1.2 in Sipser Ø Announcement: q Piazza registration: http://piazza.com/asu/fall2017/cse355 q First poll will be posted on Piazza
More informationComplexity (Pre Lecture)
Complexity (Pre Lecture) Dr. Neil T. Dantam CSCI-561, Colorado School of Mines Fall 2018 Dantam (Mines CSCI-561) Complexity (Pre Lecture) Fall 2018 1 / 70 Why? What can we always compute efficiently? What
More informationAutomata: a short introduction
ILIAS, University of Luxembourg Discrete Mathematics II May 2012 What is a computer? Real computers are complicated; We abstract up to an essential model of computation; We begin with the simplest possible
More informationFinite Automata and Regular Languages
Finite Automata and Regular Languages Topics to be covered in Chapters 1-4 include: deterministic vs. nondeterministic FA, regular expressions, one-way vs. two-way FA, minimization, pumping lemma for regular
More informationFormal Models in NLP
Formal Models in NLP Finite-State Automata Nina Seemann Universität Stuttgart Institut für Maschinelle Sprachverarbeitung Pfaffenwaldring 5b 70569 Stuttgart May 15, 2012 Nina Seemann (IMS) Formal Models
More informationClosure Properties of Regular Languages. Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism, Inverse Homomorphism
Closure Properties of Regular Languages Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism, Inverse Homomorphism Closure Properties Recall a closure property is a statement
More informationFinite Automata. Wen-Guey Tzeng Computer Science Department National Chiao Tung University
Finite Automata Wen-Guey Tzeng Computer Science Department National Chiao Tung University Syllabus Deterministic finite acceptor Nondeterministic finite acceptor Equivalence of DFA and NFA Reduction of
More informationCISC 4090 Theory of Computation
9/2/28 Stereotypical computer CISC 49 Theory of Computation Finite state machines & Regular languages Professor Daniel Leeds dleeds@fordham.edu JMH 332 Central processing unit (CPU) performs all the instructions
More informationIntroduction to the Theory of Computation. Automata 1VO + 1PS. Lecturer: Dr. Ana Sokolova.
Introduction to the Theory of Computation Automata 1VO + 1PS Lecturer: Dr. Ana Sokolova http://cs.uni-salzburg.at/~anas/ Setup and Dates Lectures and Instructions 23.10. 3.11. 17.11. 24.11. 1.12. 11.12.
More informationCSC173 Workshop: 13 Sept. Notes
CSC173 Workshop: 13 Sept. Notes Frank Ferraro Department of Computer Science University of Rochester September 14, 2010 1 Regular Languages and Equivalent Forms A language can be thought of a set L of
More informationComputability Theory
CS:4330 Theory of Computation Spring 2018 Computability Theory Decidable Languages Haniel Barbosa Readings for this lecture Chapter 4 of [Sipser 1996], 3rd edition. Section 4.1. Decidable Languages We
More informationFinite Automata and Regular Languages (part III)
Finite Automata and Regular Languages (part III) Prof. Dan A. Simovici UMB 1 / 1 Outline 2 / 1 Nondeterministic finite automata can be further generalized by allowing transitions between states without
More informationFinite Automata - Deterministic Finite Automata. Deterministic Finite Automaton (DFA) (or Finite State Machine)
Finite Automata - Deterministic Finite Automata Deterministic Finite Automaton (DFA) (or Finite State Machine) M = (K, Σ, δ, s, A), where K is a finite set of states Σ is an input alphabet s K is a distinguished
More informationTheory of Computation
Theory of Computation COMP363/COMP6363 Prerequisites: COMP4 and COMP 6 (Foundations of Computing) Textbook: Introduction to Automata Theory, Languages and Computation John E. Hopcroft, Rajeev Motwani,
More informationAutomata and Formal Languages - CM0081 Non-Deterministic Finite Automata
Automata and Formal Languages - CM81 Non-Deterministic Finite Automata Andrés Sicard-Ramírez Universidad EAFIT Semester 217-2 Non-Deterministic Finite Automata (NFA) Introduction q i a a q j a q k The
More informationInf2A: Converting from NFAs to DFAs and Closure Properties
1/43 Inf2A: Converting from NFAs to DFAs and Stuart Anderson School of Informatics University of Edinburgh October 13, 2009 Starter Questions 2/43 1 Can you devise a way of testing for any FSM M whether
More informationLecture 17: Language Recognition
Lecture 17: Language Recognition Finite State Automata Deterministic and Non-Deterministic Finite Automata Regular Expressions Push-Down Automata Turing Machines Modeling Computation When attempting to
More informationFinite Automata. Mahesh Viswanathan
Finite Automata Mahesh Viswanathan In this lecture, we will consider different models of finite state machines and study their relative power. These notes assume that the reader is familiar with DFAs,
More informationLecture 3: Finite Automata. Finite Automata. Deterministic Finite Automata. Summary. Dr Kieran T. Herley
Lecture 3: Finite Automata Dr Kieran T. Herley Department of Computer Science University College Cork Summary Deterministic finite automata (DFA). Definition and operation of same. DFAs as string classifiers
More informationSubset construction. We have defined for a DFA L(A) = {x Σ ˆδ(q 0, x) F } and for A NFA. For any NFA A we can build a DFA A D such that L(A) = L(A D )
Search algorithm Clever algorithm even for a single word Example: find abac in abaababac See Knuth-Morris-Pratt and String searching algorithm on wikipedia 2 Subset construction We have defined for a DFA
More informationComputer Sciences Department
1 Reference Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER 3 objectives Finite automaton Infinite automaton Formal definition State diagram Regular and Non-regular
More informationAutomata Theory. Lecture on Discussion Course of CS120. Runzhe SJTU ACM CLASS
Automata Theory Lecture on Discussion Course of CS2 This Lecture is about Mathematical Models of Computation. Why Should I Care? - Ways of thinking. - Theory can drive practice. - Don t be an Instrumentalist.
More informationUNIT-III REGULAR LANGUAGES
Syllabus R9 Regulation REGULAR EXPRESSIONS UNIT-III REGULAR LANGUAGES Regular expressions are useful for representing certain sets of strings in an algebraic fashion. In arithmetic we can use the operations
More informationAutomata Theory for Presburger Arithmetic Logic
Automata Theory for Presburger Arithmetic Logic References from Introduction to Automata Theory, Languages & Computation and Constraints in Computational Logic Theory & Application Presented by Masood
More informationLecture 2: Regular Expression
Lecture 2: Regular Expression Instructor: Ketan Mulmuley Scriber: Yuan Li January 8, 2015 In the last lecture, we proved that DFA, NFA, and NFA with ϵ-moves are equivalent. Recall that a language L Σ is
More informationCSE 211. Pushdown Automata. CSE 211 (Theory of Computation) Atif Hasan Rahman
CSE 211 Pushdown Automata CSE 211 (Theory of Computation) Atif Hasan Rahman Lecturer Department of Computer Science and Engineering Bangladesh University of Engineering & Technology Adapted from slides
More informationFinite Universes. L is a fixed-length language if it has length n for some
Finite Universes Finite Universes When the universe is finite (e.g., the interval 0, 2 1 ), all objects can be encoded by words of the same length. A language L has length n 0 if L =, or every word of
More information