Lecture 4: Nondeterministic Finite Automata
|
|
- Dorthy Walsh
- 5 years ago
- Views:
Transcription
1 Lecture 4: Nondeterministic Finite Automata Dr Kieran T. Herley Department of Computer Science University College Cork KH (26/09/17) Lecture 4: Nondeterministic Finite Automata / 1
2 Nondeterministic Finite Automata NFA Notes Allows edges labelled ɛ Possibly several ɛ-edges per state (DFA disallows both) Subsumes DFA concept Seemingly more expressive/powerful (But actually not) KH (26/09/17) Lecture 4: Nondeterministic Finite Automata / 1
3 NFA cont d A Nondeterministic Finite Automaton (NFA) consists of Σ, S, s 0, A As for DFA T = (S, E) a directed graph in which each edge in E is labelled with one or more elements of Σ {ɛ}. 1 1 Definition allows state to have multiple edges bearing same label, unlike DFA. We will not use this feature (except for ɛ-edges). KH (26/09/17) Lecture 4: Nondeterministic Finite Automata / 1
4 Acceptance Criterion Intuitively, the automaton accepts string x 1 x 2 x n if there is a path in T from the start state to one of the accept states whose edge labels concatenated together yield x 1 x 2 x n. Note: ɛ labels disappear in concatenation, e.g. accepts ɛ ɛ a ɛ ɛ = a KH (26/09/17) Lecture 4: Nondeterministic Finite Automata / 1
5 Acceptance Criterion Formal Version Definition More formally, a path e 1, e 2, e m yields y 1, y 2,, y m if for each i edge e i bears label y i. The automaton accepts string x 1 x 2 x n if there is a path e 1, e 2, e m in T from the start state to one of the accept states that yields some y 1, y 2,, y m such that All other strings are rejected. y 1 y 2 y m = x 1 x 2 x n KH (26/09/17) Lecture 4: Nondeterministic Finite Automata / 1
6 Example Recall A ɛ B = A B. Accepted Strings a b abba ɛ Rejected Strings? KH (26/09/17) Lecture 4: Nondeterministic Finite Automata / 1
7 NFA Example 1 Accepts a b aaa Rejects ab ba In other words... KH (26/09/17) Lecture 4: Nondeterministic Finite Automata / 1
8 NFA Example 1 Accepts a b aaa Rejects ab ba In other words...all monotonous strings i.e. all as or all bs. (Proof?) KH (26/09/17) Lecture 4: Nondeterministic Finite Automata / 1
9 NFA Example 2 Accepts abb ababababb Rejects abba abbaaaaa In other words... KH (26/09/17) Lecture 4: Nondeterministic Finite Automata / 1
10 NFA Example 2 Accepts abb ababababb Rejects abba abbaaaaa In other words...strings that end with abb. (Proof?) KH (26/09/17) Lecture 4: Nondeterministic Finite Automata / 1
11 Some Terminology ɛ-closure ɛ-closure(s) set of NFA states reachable from state s using ɛ edges only 0 {0, 1, 2, 4, 7} 2 {2} 6 {1, 2, 4, 6, 7} ɛ-closure(s) set of NFA states reachable from any state s S using ɛ edges only KH (26/09/17) Lecture 4: Nondeterministic Finite Automata / 1
12 Operation of NFA Initially one token on each state in ɛ-closure(s 0 ) i.e. potentially multiple token-bearing states One step per input symbol (input symbol x): advance tokens along x-edge(s) emanating from current states (remove token if no such edge(s), also duplicates) replicate each token in each state t to states in ɛ-closure(t) Illustration (one step) KH (26/09/17) Lecture 4: Nondeterministic Finite Automata / 1
13 Computing ɛ-closure Closure is essentially a reachability problem in a directed graph Stack-based depth-first search in transition graph beginning at states in X and using ɛ labelled edges only: Algorithm Closure(X): Push states in X onto stack S C X while S not empty do Pop t, the top element, off S for each u ɛadj(t) do if u C then C C {u} Push u unto S return (C) ɛadj(t) denotes the nodes to which there is an ɛ-edge leading from t. KH (26/09/17) Lecture 4: Nondeterministic Finite Automata / 1
14 Computing ɛ-closure cont d Algorithm Closure(X): Push states in X onto stack S C X while S not empty do Pop t, the top element, off S for each u ɛadj(t) do if u C then C C {u} Push u unto S return (C) S t Adj C , 7 0, 1, 7 KH (26/09/17) Lecture 4: Nondeterministic Finite Automata / 1
15 Computing ɛ-closure cont d Algorithm Closure(X): Push states in X onto stack S C X while S not empty do Pop t, the top element, off S for each u ɛadj(t) do if u C then C C {u} Push u unto S return (C) S t Adj C , 7 0, 1, KH (26/09/17) Lecture 4: Nondeterministic Finite Automata / 1
16 Computing ɛ-closure cont d Algorithm Closure(X): Push states in X onto stack S C X while S not empty do Pop t, the top element, off S for each u ɛadj(t) do if u C then C C {u} Push u unto S return (C) S t Adj C , 7 0, 1, , 4 0, 1, 7, 2, 4 KH (26/09/17) Lecture 4: Nondeterministic Finite Automata / 1
17 Computing ɛ-closure cont d Algorithm Closure(X): Push states in X onto stack S C X while S not empty do Pop t, the top element, off S for each u ɛadj(t) do if u C then C C {u} Push u unto S return (C) S t Adj C , 7 0, 1, , 4 0, 1, 7, 2, 4 2, 4 4 KH (26/09/17) Lecture 4: Nondeterministic Finite Automata / 1
18 Computing ɛ-closure cont d Algorithm Closure(X): Push states in X onto stack S C X while S not empty do Pop t, the top element, off S for each u ɛadj(t) do if u C then C C {u} Push u unto S return (C) S t Adj C , 7 0, 1, , 4 0, 1, 7, 2, 4 2, KH (26/09/17) Lecture 4: Nondeterministic Finite Automata / 1
19 Computing ɛ-closure cont d Algorithm Closure(X): Push states in X onto stack S C X while S not empty do Pop t, the top element, off S for each u ɛadj(t) do if u C then C C {u} Push u unto S return (C) S t Adj C , 7 0, 1, , 4 0, 1, 7, 2, 4 2, Returns C = {0, 1, 2, 4, 7}. KH (26/09/17) Lecture 4: Nondeterministic Finite Automata / 1
20 NFA Simulation Algorithm Algorithm NfaAccept(M, X): S Closure({M.start}) while ch eof do S Closure(M.moveTo(S, ch)) if S M.accept then return true else return false M.start M.accept start state accept states M.moveTo transition function for M, i.e. moveto(s, x) is set of states reachable from states in S using a single x-edge. Note: Use two stacks to represent S and C and alternate at each iteration efficient. KH (26/09/17) Lecture 4: Nondeterministic Finite Automata / 1
21 Example of NFA Execution Automaton Input String N((a b) ) babbb Algorithm NfaAccept(M, X): S Closure({M.start}) while ch eof do S Closure( M.MoveTo(S, ch)) if S M.accept then return true else return false KH (26/09/17) Lecture 4: Nondeterministic Finite Automata / 1
22 Example of NFA Execution Automaton Input String N((a b) ) babbb Algorithm NfaAccept(M, X): S Closure({M.start}) while ch eof do S Closure( M.MoveTo(S, ch)) if S M.accept then return true else return false KH (26/09/17) Lecture 4: Nondeterministic Finite Automata / 1
23 Example of NFA Execution Automaton Input String N((a b) ) babbb Algorithm NfaAccept(M, X): S Closure({M.start}) while ch eof do S Closure( M.MoveTo(S, ch)) if S M.accept then return true else return false KH (26/09/17) Lecture 4: Nondeterministic Finite Automata / 1
24 Example of NFA Execution Automaton Input String N((a b) ) babbb Algorithm NfaAccept(M, X): S Closure({M.start}) while ch eof do S Closure( M.MoveTo(S, ch)) if S M.accept then return true else return false KH (26/09/17) Lecture 4: Nondeterministic Finite Automata / 1
25 Example of NFA Execution Automaton Input String N((a b) ) babbb Algorithm NfaAccept(M, X): S Closure({M.start}) while ch eof do S Closure( M.MoveTo(S, ch)) if S M.accept then return true else return false KH (26/09/17) Lecture 4: Nondeterministic Finite Automata / 1
26 Example of NFA Execution Automaton Input String N((a b) ) babbb Algorithm NfaAccept(M, X): S Closure({M.start}) while ch eof do S Closure( M.MoveTo(S, ch)) if S M.accept then return true else return false KH (26/09/17) Lecture 4: Nondeterministic Finite Automata / 1
27 Example of NFA Execution Automaton Input String N((a b) ) babbb Algorithm NfaAccept(M, X): S Closure({M.start}) while ch eof do S Closure( M.MoveTo(S, ch)) if S M.accept then return true else return false KH (26/09/17) Lecture 4: Nondeterministic Finite Automata / 1
28 Example of NFA Execution Automaton Input String N((a b) ) babbb Algorithm NfaAccept(M, X): S Closure({M.start}) while ch eof do S Closure( M.MoveTo(S, ch)) if S M.accept then return true else return false KH (26/09/17) Lecture 4: Nondeterministic Finite Automata / 1
29 Example of NFA Execution Automaton Input String N((a b) ) babbb Algorithm NfaAccept(M, X): S Closure({M.start}) while ch eof do S Closure( M.MoveTo(S, ch)) if S M.accept then return true else return false KH (26/09/17) Lecture 4: Nondeterministic Finite Automata / 1
30 Example of NFA Execution Automaton Input String N((a b) ) babbb Algorithm NfaAccept(M, X): S Closure({M.start}) while ch eof do S Closure( M.MoveTo(S, ch)) if S M.accept then return true else return false KH (26/09/17) Lecture 4: Nondeterministic Finite Automata / 1
31 Example of NFA Execution Automaton Input String N((a b) ) babbb Accept! Algorithm NfaAccept(M, X): S Closure({M.start}) while ch eof do S Closure( M.MoveTo(S, ch)) if S M.accept then return true else return false KH (26/09/17) Lecture 4: Nondeterministic Finite Automata / 1
32 Example of NFA Execution Trace S ch moveto Closure(Move(...)) 0, 1, 2, 4, 7 b 5 1, 2, 4, 5, 6, 7 1, 2, 4, 5, 6, 7 a 3 1, 2, 3, 4, 6, 7 1, 2, 3, 4, 6, 7 b 5 1, 2, 4, 5, 6, 7 1, 2, 4, 5, 6, 7 b 5 1, 2, 4, 5, 6, 7 1, 2, 4, 5, 6, 7 b 5 1, 2, 4, 5, 6, 7 Outcome Accept string since S contains accept state 7 at conclusion. KH (26/09/17) Lecture 4: Nondeterministic Finite Automata / 1
33 Correctness Algorithm NfaAccept(M, X): S Closure({M.start}) while ch eof do S Closure( M.MoveTo(S, ch)) if S M.accept then return true else return false Some Notation X S i S i = x 1 x 2 x 3 x n Set S at beginning of iteration i = 1, 2, Final state designated S n+1 ɛ-closure of S i KH (26/09/17) Lecture 4: Nondeterministic Finite Automata / 1
34 Correctness cont d Algorithm NfaAccept(M, X): S Closure({M.start}) while ch eof do S Closure(M.MoveTo(S, ch)) if S M.accept then return true else return false Acceptance Criterion The automaton accepts string x 1 x 2 x n if there is a path in T from the start state to one of the accept states whose edge labels concatenated together yield x 1 x 2 x n. Path implies true returned Path has structure shown below Easy to see algorithm returns true KH (26/09/17) Lecture 4: Nondeterministic Finite Automata / 1
35 Correctness cont d Algorithm NfaAccept(M, X): S Closure({M.start}) while ch eof do S Closure(M.MoveTo(S, ch)) if S M.accept then return true else return false Acceptance Criterion The automaton accepts string x 1 x 2 x n if there is a path in T from the start state to one of the accept states whose edge labels concatenated together yield x 1 x 2 x n. True implies path existance Consider relationships between sets S 1, S 2, S n+1 Implies existance of path KH (26/09/17) Lecture 4: Nondeterministic Finite Automata / 1
36 Transformation not straightforward, but intuitively each DFA state KH (26/09/17) Lecture 4: Nondeterministic Finite Automata / 1 DFA vs NFA Theorem For every NFA, there is an equivalent DFA, i.e. one that accepts precisely the same language.
37 DFA vs NFA cont d Algorithm DfaAccept(M, X): s M.start ch X.nextChar() while ch eof do s M.moveTo(s, ch) ch X.nextChar() if s in M.accept then return true else return false O( X ) running time Other Considerations NFA-to-DFA transformation takes time Algorithm NfaAccept(M, X): S Closure({M.start}) while ch eof do S Closure( M.MoveTo(S, ch)) if S M.accept then return true else return false O( X n) running time where n = # states/edges DFA can have upto 2 n states (n = # states of NFA equivalent); hence can be space-hungry (large tables!). KH (26/09/17) Lecture 4: Nondeterministic Finite Automata / 1
Lecture 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 informationCSE 105 THEORY OF COMPUTATION
CSE 105 THEORY OF COMPUTATION Spring 2017 http://cseweb.ucsd.edu/classes/sp17/cse105-ab/ Review of CFG, CFL, ambiguity What is the language generated by the CFG below: G 1 = ({S,T 1,T 2 }, {0,1,2}, { S
More informationCSE 105 THEORY OF COMPUTATION
CSE 105 THEORY OF COMPUTATION Spring 2016 http://cseweb.ucsd.edu/classes/sp16/cse105-ab/ Today's learning goals Sipser Ch 2 Define push down automata Trace the computation of a push down automaton Design
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 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 informationContext-Free Languages
CS:4330 Theory of Computation Spring 2018 Context-Free Languages Pushdown Automata Haniel Barbosa Readings for this lecture Chapter 2 of [Sipser 1996], 3rd edition. Section 2.2. Finite automaton 1 / 13
More informationFinite-State Machines (Automata) lecture 12
Finite-State Machines (Automata) lecture 12 cl a simple form of computation used widely one way to find patterns 1 A current D B A B C D B C D A C next 2 Application Fields Industry real-time control,
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 informationCSE 311: Foundations of Computing. Lecture 23: Finite State Machine Minimization & NFAs
CSE : Foundations of Computing Lecture : Finite State Machine Minimization & NFAs State Minimization Many different FSMs (DFAs) for the same problem Take a given FSM and try to reduce its state set by
More informationFinite 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 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 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 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 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 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 informationcse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska
cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska LECTURE 11 CHAPTER 3 CONTEXT-FREE LANGUAGES 1. Context Free Grammars 2. Pushdown Automata 3. Pushdown automata and context -free
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 informationLanguages, regular languages, finite automata
Notes on Computer Theory Last updated: January, 2018 Languages, regular languages, finite automata Content largely taken from Richards [1] and Sipser [2] 1 Languages An alphabet is a finite set of characters,
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 informationPushdown automata. Twan van Laarhoven. Institute for Computing and Information Sciences Intelligent Systems Radboud University Nijmegen
Pushdown automata Twan van Laarhoven Institute for Computing and Information Sciences Intelligent Systems Version: fall 2014 T. van Laarhoven Version: fall 2014 Formal Languages, Grammars and Automata
More informationHarvard CS 121 and CSCI E-207 Lecture 10: CFLs: PDAs, Closure Properties, and Non-CFLs
Harvard CS 121 and CSCI E-207 Lecture 10: CFLs: PDAs, Closure Properties, and Non-CFLs Harry Lewis October 8, 2013 Reading: Sipser, pp. 119-128. Pushdown Automata (review) Pushdown Automata = Finite automaton
More informationComputational Models - Lecture 4
Computational Models - Lecture 4 Regular languages: The Myhill-Nerode Theorem Context-free Grammars Chomsky Normal Form Pumping Lemma for context free languages Non context-free languages: Examples Push
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 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 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 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 informationCSE 135: Introduction to Theory of Computation Nondeterministic Finite Automata (cont )
CSE 135: Introduction to Theory of Computation Nondeterministic Finite Automata (cont ) Sungjin Im University of California, Merced 2-3-214 Example II A ɛ B ɛ D F C E Example II A ɛ B ɛ D F C E NFA accepting
More informationComputational Models - Lecture 5 1
Computational Models - Lecture 5 1 Handout Mode Iftach Haitner and Yishay Mansour. Tel Aviv University. April 10/22, 2013 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice
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 informationCPS 220 Theory of Computation Pushdown Automata (PDA)
CPS 220 Theory of Computation Pushdown Automata (PDA) Nondeterministic Finite Automaton with some extra memory Memory is called the stack, accessed in a very restricted way: in a First-In First-Out fashion
More informationFinite Automata Part Two
Finite Automata Part Two DFAs A DFA is a Deterministic Finite Automaton A DFA is defined relative to some alphabet Σ. For each state in the DFA, there must be exactly one transition defined for each symbol
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 informationPS2 - Comments. University of Virginia - cs3102: Theory of Computation Spring 2010
University of Virginia - cs3102: Theory of Computation Spring 2010 PS2 - Comments Average: 77.4 (full credit for each question is 100 points) Distribution (of 54 submissions): 90, 12; 80 89, 11; 70-79,
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 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 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 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 informationPlease give details of your answer. A direct answer without explanation is not counted.
Please give details of your answer. A direct answer without explanation is not counted. Your answers must be in English. Please carefully read problem statements. During the exam you are not allowed to
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 informationIntroduction to Kleene Algebras
Introduction to Kleene Algebras Riccardo Pucella Basic Notions Seminar December 1, 2005 Introduction to Kleene Algebras p.1 Idempotent Semirings An idempotent semiring is a structure S = (S, +,, 1, 0)
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 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 informationCS 4120 Lecture 3 Automating lexical analysis 29 August 2011 Lecturer: Andrew Myers. 1 DFAs
CS 42 Lecture 3 Automating lexical analysis 29 August 2 Lecturer: Andrew Myers A lexer generator converts a lexical specification consisting of a list of regular expressions and corresponding actions into
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. Dr. Neil T. Dantam. Fall CSCI-561, Colorado School of Mines. Dantam (Mines CSCI-561) Finite Automata Fall / 43
Finite Automata Dr. Neil T. Dantam CSCI-561, Colorado School of Mines Fall 2018 Dantam (Mines CSCI-561) Finite Automata Fall 2018 1 / 43 Outline Languages Review Traffic Light Example Deterministic Finite
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 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 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 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 informationCompilers. Lexical analysis. Yannis Smaragdakis, U. Athens (original slides by Sam
Compilers Lecture 3 Lexical analysis Yannis Smaragdakis, U. Athens (original slides by Sam Guyer@Tufts) Big picture Source code Front End IR Back End Machine code Errors Front end responsibilities Check
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 informationPushdown Automata: Introduction (2)
Pushdown Automata: Introduction Pushdown automaton (PDA) M = (K, Σ, Γ,, s, A) where K is a set of states Σ is an input alphabet Γ is a set of stack symbols s K is the start state A K is a set of accepting
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 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 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 informationRumination on the Formal Definition of DPDA
Rumination on the Formal Definition of DPDA In the definition of DPDA, there are some parts that do not agree with our intuition. Let M = (Q, Σ, Γ, δ, q 0, Z 0, F ) be a DPDA. According to the definition,
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 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 informationCSE 105 THEORY OF COMPUTATION
CSE 105 THEORY OF COMPUTATION "Winter" 2018 http://cseweb.ucsd.edu/classes/wi18/cse105-ab/ Today's learning goals Sipser Section 1.1 Construct finite automata using algorithms from closure arguments Determine
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 informationAutomata and Formal Languages - CM0081 Finite Automata and Regular Expressions
Automata and Formal Languages - CM0081 Finite Automata and Regular Expressions Andrés Sicard-Ramírez Universidad EAFIT Semester 2018-2 Introduction Equivalences DFA NFA -NFA RE Finite Automata and Regular
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 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 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 informationPushdown Automata. Pushdown Automata. Pushdown Automata. Pushdown Automata. Pushdown Automata. Pushdown Automata. The stack
A pushdown automata (PDA) is essentially: An NFA with a stack A move of a PDA will depend upon Current state of the machine Current symbol being read in Current symbol popped off the top of the stack With
More informationTheory of Computation
Fall 2002 (YEN) Theory of Computation Midterm Exam. Name:... I.D.#:... 1. (30 pts) True or false (mark O for true ; X for false ). (Score=Max{0, Right- 1 2 Wrong}.) (1) X... If L 1 is regular and L 2 L
More informationCS:4330 Theory of Computation Spring Regular Languages. Finite Automata and Regular Expressions. Haniel Barbosa
CS:4330 Theory of Computation Spring 2018 Regular Languages Finite Automata and Regular Expressions Haniel Barbosa Readings for this lecture Chapter 1 of [Sipser 1996], 3rd edition. Sections 1.1 and 1.3.
More informationNon-deterministic Finite Automata (NFAs)
Algorithms & Models of Computation CS/ECE 374, Fall 27 Non-deterministic Finite Automata (NFAs) Part I NFA Introduction Lecture 4 Thursday, September 7, 27 Sariel Har-Peled (UIUC) CS374 Fall 27 / 39 Sariel
More informationStudent#: CISC-462 Exam, December XY, 2017 Page 1 of 12
Student#: CISC-462 Exam, December XY, 2017 Page 1 of 12 Queen s University, Faculty of Arts and Science, School of Computing CISC-462 Final Exam, December XY, 2017 (Instructor: Kai Salomaa) INSTRUCTIONS
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 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 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 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 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 informationLecture 5: Minimizing DFAs
6.45 Lecture 5: Minimizing DFAs 6.45 Announcements: - Pset 2 is up (as of last night) - Dylan says: It s fire. - How was Pset? 2 DFAs NFAs DEFINITION Regular Languages Regular Expressions 3 4 Some Languages
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 informationHKN CS/ECE 374 Midterm 1 Review. Nathan Bleier and Mahir Morshed
HKN CS/ECE 374 Midterm 1 Review Nathan Bleier and Mahir Morshed For the most part, all about strings! String induction (to some extent) Regular languages Regular expressions (regexps) Deterministic finite
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 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 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 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 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 informationCSC236 Week 11. Larry Zhang
CSC236 Week 11 Larry Zhang 1 Announcements Next week s lecture: Final exam review This week s tutorial: Exercises with DFAs PS9 will be out later this week s. 2 Recap Last week we learned about Deterministic
More informationLecture Notes On THEORY OF COMPUTATION MODULE -1 UNIT - 2
BIJU PATNAIK UNIVERSITY OF TECHNOLOGY, ODISHA Lecture Notes On THEORY OF COMPUTATION MODULE -1 UNIT - 2 Prepared by, Dr. Subhendu Kumar Rath, BPUT, Odisha. UNIT 2 Structure NON-DETERMINISTIC FINITE AUTOMATA
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 informationPushdown Automata. We have seen examples of context-free languages that are not regular, and hence can not be recognized by finite automata.
Pushdown Automata We have seen examples of context-free languages that are not regular, and hence can not be recognized by finite automata. Next we consider a more powerful computation model, called a
More informationFORMAL LANGUAGES, AUTOMATA AND COMPUTATION
FORMAL LANGUAGES, AUTOMATA AND COMPUTATION DECIDABILITY ( LECTURE 15) SLIDES FOR 15-453 SPRING 2011 1 / 34 TURING MACHINES-SYNOPSIS The most general model of computation Computations of a TM are described
More informationNondeterministic Finite Automata
Nondeterministic Finite Automata Mahesh Viswanathan Introducing Nondeterminism Consider the machine shown in Figure. Like a DFA it has finitely many states and transitions labeled by symbols from an input
More informationCSE 105 THEORY OF COMPUTATION
CSE 105 THEORY OF COMPUTATION Spring 2016 http://cseweb.ucsd.edu/classes/sp16/cse105-ab/ Today's learning goals Sipser Ch 2 Design a PDA and a CFG for a given language Give informal description for a PDA,
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 informationCS21 Decidability and Tractability
CS21 Decidability and Tractability Lecture 3 January 9, 2017 January 9, 2017 CS21 Lecture 3 1 Outline NFA, FA equivalence Regular Expressions FA and Regular Expressions January 9, 2017 CS21 Lecture 3 2
More informationRegular Expressions and Language Properties
Regular Expressions and Language Properties Mridul Aanjaneya Stanford University July 3, 2012 Mridul Aanjaneya Automata Theory 1/ 47 Tentative Schedule HW #1: Out (07/03), Due (07/11) HW #2: Out (07/10),
More informationMore on Finite Automata and Regular Languages. (NTU EE) Regular Languages Fall / 41
More on Finite Automata and Regular Languages (NTU EE) Regular Languages Fall 2016 1 / 41 Pumping Lemma is not a Sufficient Condition Example 1 We know L = {b m c m m > 0} is not regular. Let us consider
More informationTHEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET
THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET Regular Languages and FA A language is a set of strings over a finite alphabet Σ. All languages are finite or countably infinite. The set of all languages
More informationCSE 135: Introduction to Theory of Computation Nondeterministic Finite Automata
CSE 135: Introduction to Theory of Computation Nondeterministic Finite Automata Sungjin Im University of California, Merced 1-27-215 Nondeterminism Michael Rabin and Dana Scott (1959) Michael Rabin Dana
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 informationRecitation 2 - Non Deterministic Finite Automata (NFA) and Regular OctoberExpressions
Recitation 2 - Non Deterministic Finite Automata (NFA) and Regular Expressions Orit Moskovich Gal Rotem Tel Aviv University October 28, 2015 Recitation 2 - Non Deterministic Finite Automata (NFA) and Regular
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 informationAlgorithms for NLP
Regular Expressions Chris Dyer Algorithms for NLP 11-711 Adapted from materials from Alon Lavie Goals of Today s Lecture Understand the properties of NFAs with epsilon transitions Understand concepts and
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 information