Formal Models in NLP

Size: px
Start display at page:

Download "Formal Models in NLP"

Transcription

1 Formal Models in NLP Finite-State Automata Nina Seemann Universität Stuttgart Institut für Maschinelle Sprachverarbeitung Pfaffenwaldring 5b Stuttgart May 15, 2012 Nina Seemann (IMS) Formal Models in NLP: Finite-State Automata May 15,

2 Outline 1 Finite-State Automata: Characterization 2 Closure Properties of Finite-State Acceptors 3 Closure Properties of Finite-State Transducers 4 Equivalence Transformations on Finite-State Acceptors Nina Seemann (IMS) Formal Models in NLP: Finite-State Automata May 15,

3 Outline 1 Finite-State Automata: Characterization Finite-State Acceptors Finite-State Transducers 2 Closure Properties of Finite-State Acceptors 3 Closure Properties of Finite-State Transducers 4 Equivalence Transformations on Finite-State Acceptors Nina Seemann (IMS) Formal Models in NLP: Finite-State Automata May 15,

4 Finite-State Acceptors Example (NFA A lex accepting some animal names) Nina Seemann (IMS) Formal Models in NLP: Finite-State Automata May 15,

5 Finite-State Acceptors Non-Deterministic Finite-State Acceptor Definition (Non-deterministic finite-state acceptor (NFA)) A non-deterministic finite-state acceptor A is a 5-tuple (Q, Σ, q 0, F, δ) where Q is a finite set of states Σ is the alphabet q 0 Q is the start state F Q is a set of final states δ : Q Σ {ɛ} 2 Q, the transition function Nondeterminism refers to the fact that a NFA has the power to be in several states at once. A transition may be labeled with ɛ. Nina Seemann (IMS) Formal Models in NLP: Finite-State Automata May 15,

6 Finite-State Acceptors Deterministic Finite-State Acceptor Definition (Deterministic finite-state acceptor (DFA)) A deterministic finite-state acceptor D is a 5-tuple (Q, Σ, q 0, F, δ) where Q is a finite set of states Σ is a finite set and called the alphabet q 0 Q is the initial state F Q is a set of final states δ : Q Σ Q, the transition function Determinism refers to the fact that DFAs can go to one state only. DFAs are ɛ-free by definition. DFA and NFA have the same generative power, i.e. they are equivalent. Nina Seemann (IMS) Formal Models in NLP: Finite-State Automata May 15,

7 Finite-State Acceptors Example (DFA D lex accepting some animal names) Nina Seemann (IMS) Formal Models in NLP: Finite-State Automata May 15,

8 Finite-State Acceptors Extended Transition Function & Language Definition (Extended transition function ˆδ) ˆδ describes what happens when we start in any state and follow any sequence of inputs. ˆδ(q, ɛ) = q. ˆδ(q, w) = δ(ˆδ(q, x), a) with w = xa. Definition (Language of a DFA A) L(A) = {w Σ ˆδ(q o, w) F } We also say that L(A) is recognized by A. Definition (Regular language) The language is called regular if there exists some DFA which recognizes it. Nina Seemann (IMS) Formal Models in NLP: Finite-State Automata May 15,

9 Finite-State Acceptors Extended Transition Function for DFA Example (frog in DFA D lex ) Assumption: ˆδ(0, frog) {26, 24, 22, 13, 11, 9, 8} ˆδ(0, ɛ) = 0 ˆδ(0, f ) = δ(ˆδ(0, ɛ), f ) = δ(0, f ) = 3 ˆδ(0, fr) = δ(ˆδ(0, f ), r) = δ(3, r) = 6 ˆδ(0, fro) = δ(ˆδ(0, fr), o) = δ(6, o) = 7 ˆδ(0, frog) = δ(ˆδ(0, fro), g) = δ(7, g) = 8 Nina Seemann (IMS) Formal Models in NLP: Finite-State Automata May 15,

10 Finite-State Acceptors Extended Transition Function for NFA Example (frog in NFA A lex ) Assumption: ˆδ(31, frog) {2, 6, 9, 13, 18, 21, 30} ˆδ(31, ɛ) = {31} ˆδ(31, f ) = δ(ˆδ(31, ɛ), f ) = δ(31, f ) = {3, 7, 10} ˆδ(31, fr) = δ(ˆδ(31, f ), r) = δ(3, r) δ(7, r) δ(10, r) = {4} = {4} ˆδ(31, fro) = δ(ˆδ(31, fr), o) = δ(4, o) = {5} ˆδ(31, frog) = δ(ˆδ(31, fro), g) = δ(5, g) = {6} Nina Seemann (IMS) Formal Models in NLP: Finite-State Automata May 15,

11 Finite-State Transducers Definition Definition ((Non-deterministic) finite-state transducer (NFST)) A (non-deterministic) finite-state transducer T is a 7-tuple (Q, Σ,, q 0, F, δ, σ) where Q is a set of states Σ is the input alphabet of T is the output alphabet of T q 0 Q is the start state F Q is a set of final states δ : Q Σ {ɛ} 2 Q, the transition function σ : Q Σ {ɛ} Q, the output function Nina Seemann (IMS) Formal Models in NLP: Finite-State Automata May 15,

12 Finite-State Transducers Alternative Definition Definition (Normalized finite-state transducer) A normalized finite-state transducer T is a 6-tuple (Q, Σ,, q 0, F, E) where Q is a set of states Σ is a set and called the input alphabet of T is a set and called the output alphabet of T q 0 Q is the start state F Q is a set of final states E Q (Σ {ɛ}) ( {ɛ}) Q, the set of transitions Every transducer can be transformed into a normalized transducer. Nina Seemann (IMS) Formal Models in NLP: Finite-State Automata May 15,

13 Finite-State Transducers Example (NFST T lex mapping surface forms to morph. features) Nina Seemann (IMS) Formal Models in NLP: Finite-State Automata May 15,

14 Finite-State Transducers Deterministic Finite-State Transducer Definition (Deterministic finite-state transducer (DFST)) A deterministic finite-state transducer T is a 7-tuple (Q, Σ,, q 0, F, δ, σ) where Q is a set of states Σ is a set and called the input alphabet of T is a set and called the output alphabet of T q 0 Q is the start state F Q is a set of final states δ : Q Σ Q, the (deterministic) transition function σ : Q Σ Q, the (deterministic) output function Note: Not every NFST can be determinized. Nina Seemann (IMS) Formal Models in NLP: Finite-State Automata May 15,

15 Outline 1 Finite-State Automata: Characterization Finite-State Acceptors Finite-State Transducers 2 Closure Properties of Finite-State Acceptors 3 Closure Properties of Finite-State Transducers 4 Equivalence Transformations on Finite-State Acceptors Nina Seemann (IMS) Formal Models in NLP: Finite-State Automata May 15,

16 Closure Properties of Finite-State Acceptors Finite-state acceptors are closed under: Union Concatenation Closure (Kleene Star) Reversal Intersection Complementation Difference Homomorphism / Inverse homomorphism Nina Seemann (IMS) Formal Models in NLP: Finite-State Automata May 15,

17 Closure Properties of Finite-State Acceptors Union Example (Union of two acceptors A 1 and A 2 ) A 1 A 2 A 1 A 2 Nina Seemann (IMS) Formal Models in NLP: Finite-State Automata May 15,

18 Closure Properties of Finite-State Acceptors Concatenation Example (Concatenation of two acceptors A 1 and A 2 ) A 1 A 2 A 1 A 2 Nina Seemann (IMS) Formal Models in NLP: Finite-State Automata May 15,

19 Closure Properties of Finite-State Acceptors Closure (Kleene Star) Example (Closure of acceptor A 1 ) A 1 A 1 Nina Seemann (IMS) Formal Models in NLP: Finite-State Automata May 15,

20 Closure Properties of Finite-State Acceptors Reversal Example (Reversal of acceptor A 2 ) A 2 A R 2 Nina Seemann (IMS) Formal Models in NLP: Finite-State Automata May 15,

21 Closure Properties of Finite-State Acceptors Intersection Intersection Let L and M be the languages of the deterministic automata A L = (Q L, Σ, δ L, q L, F L ) and A M = (Q M, Σ, δ M, q M, F M ). For L M we will construct an automaton A = (Q L Q M, Σ, δ, (q L, q M ), F L F M ) where δ((p, q), σ) = (δ L (p, σ), δ M (q, σ)) [p Q L, q Q M, and σ Σ]. The set F of final states consists of all pairs (p, q) such that p F L and q F M. states of A are pair of states (A L, A M ) suppose state (p,q): Given input symbol a what does A L on input a s what does A M on input a t new state pair (s, t) Nina Seemann (IMS) Formal Models in NLP: Finite-State Automata May 15,

22 Closure Properties of Finite-State Acceptors Intersection Example (Intersection of two acceptors A 1 and A 3 ) A 1 A 3 A 1 A 3 Nina Seemann (IMS) Formal Models in NLP: Finite-State Automata May 15,

23 Closure Properties of Finite-State Acceptors Complementation Example (Complementation of acceptor A 3 ) A 3 A 3 Complementation requires a deterministic acceptor. If the acceptor is not total, a sink state has to be added. Nina Seemann (IMS) Formal Models in NLP: Finite-State Automata May 15,

24 Closure Properties of Finite-State Acceptors Difference Example (Difference of two acceptors A 1 and A 2 ) A 1 A 2 A 1 A 2 = A 1 A 2 Nina Seemann (IMS) Formal Models in NLP: Finite-State Automata May 15,

25 Outline 1 Finite-State Automata: Characterization Finite-State Acceptors Finite-State Transducers 2 Closure Properties of Finite-State Acceptors 3 Closure Properties of Finite-State Transducers 4 Equivalence Transformations on Finite-State Acceptors Nina Seemann (IMS) Formal Models in NLP: Finite-State Automata May 15,

26 Closure Properties of Finite-State Transducers Finite-state transducers are closed under Union Concatenation Closure (Kleene Star) Reversal Projection (leads to FSAs) Composition Inversion Finite-state transducers are not closed under Complementation Intersection (but acyclic and ɛ-free transducers are) Difference Nina Seemann (IMS) Formal Models in NLP: Finite-State Automata May 15,

27 Closure Properties of Finite-State Transducers Projection Example (Projection of transducer T ) Transducer T π 1 (T ) π 2 (T ) Nina Seemann (IMS) Formal Models in NLP: Finite-State Automata May 15,

28 Composition Definition (ɛ-free composition) Let T 1 = (Q 1, Σ 1, 1, q 1, F 1, E 1 ) and T 2 = (Q 2, Σ 2, 2, q 2, F 2, E 2 ) be two normalized, ɛ-free FSTs. T 1 T 2 is the transducer T = (Q 1 Q 2, Σ 1, 2, (q 1, q 2 ), F 1 F 2, E) where E = {((p, q), a, b, (p, q )) c 1 Σ 2 : (p, a, c, p ) E 1 (q, c, b, q ) E 2 } How does composition work? Whenever T 1 contains a transition: and T 2 contains a transition: T will contain a transition: Nina Seemann (IMS) Formal Models in NLP: Finite-State Automata May 15,

29 Closure Properties of Finite-State Transducers Composition Example (Composition) = Nina Seemann (IMS) Formal Models in NLP: Finite-State Automata May 15,

30 Closure Properties of Finite-State Transducers Inversion Example (Inversion) FST T Morph mapping words to morphological categories FST T 1 Morph mapping morphological categories to words Nina Seemann (IMS) Formal Models in NLP: Finite-State Automata May 15,

31 Outline 1 Finite-State Automata: Characterization Finite-State Acceptors Finite-State Transducers 2 Closure Properties of Finite-State Acceptors 3 Closure Properties of Finite-State Transducers 4 Equivalence Transformations on Finite-State Acceptors Nina Seemann (IMS) Formal Models in NLP: Finite-State Automata May 15,

32 Equivalence Transformations on Finite-State Acceptors Equivalence transformations are operations on automata which change the topology of an automaton but not its language. They usually serve optimization purposes, i.e. they create smaller and/or faster automata. Sometimes they are even necessary (e.g. determinization is crucial for complementation). Finite-state acceptors admit the following transformations: ɛ-removal Determinization Minimization Nina Seemann (IMS) Formal Models in NLP: Finite-State Automata May 15,

33 Determinization Subset Construction Example A DFA can be constructed from a NFA by the subset construction. In worst case, the smallest DFA can have 2 n states.... Q D is the power set of Q N F D is the set of subsets S of Q N such that S F N. For each set S Q N and for each input symbol a Σ δ D (S, a) = p S δ N (p, a) Nina Seemann (IMS) Formal Models in NLP: Finite-State Automata May 15,

34 Determinization Subset Construction transition diagram: transition function δ: δ(p 0, 0) = {p 0, p 1 } δ(p 0, 1) = {p 0 } δ(p 1, 1) = {p 2 } 0 1 not accessible! {p 0 } {p 0, p 1 } {p 0 } {p 1 } {p 2 } not accessible! {p 2 } not accessible! {p 0, p 1 } {p 0, p 1 } {p 0, p 2 } {p 0, p 2 } {p 0, p 1 } {p 0 } {p 1, p 2 } {p 2 } not accessible! {p 0, p 1, p 2 } {p 0, p 1 } {p 0, p 2 } not accessible! Nina Seemann (IMS) Formal Models in NLP: Finite-State Automata May 15,

35 Determinization Subset Construction: Lazy Evaluation Lazy Evaluation Basis NFA N s start state is accessible. Induction Set S of states is accessible. Then for each input symbol a, compute the set of states δ D (S, a). Example δ D ({p 0 }, 0) = {p 0, p 1 } (new accessible state) δ D ({p 0 }, 1) = {p 0 } ( old state) δ D ({p 0, p 1 }, 0) = δ N (p 0, 0) δ N (p 1, 0) = {p 0, p 1 } = {p 0, p 1 } ( old ) δ D ({p 0, p 1 }, 1) = δ N (p 0, 1) δ N (p 1, 1) = {p 0 } {p 2 } = {p 0, p 2 } (n.a.s.) δ D ({p 0, p 2 }, 0) = δ N (p 0, 0) δ N (p 2, 0) = {p 0, p 1 } = {p 0, p 1 } ( old ) δ D ({p 0, p 2 }, 1) = δ N (p 0, 1) δ N (p 2, 1) = {p 0 } = {p 0 } ( old ) Converging! Nina Seemann (IMS) Formal Models in NLP: Finite-State Automata May 15,

36 Determinization Example (Determinized Version of A 2 ) Nina Seemann (IMS) Formal Models in NLP: Finite-State Automata May 15,

37 Bibliography J. E. Hopcroft, R. Motwani & J. D. Ullman: Introduction to Automata Theory, Languages, and Computation. Addison-Wesley, T. Hanneforth: Finite-state Machines: Theory and Applications. Unweighted Finite-state Automata. Universität Potsdam, Slides: tagh.de/tom/wp-content/uploads/fsm unweigtedautomata.pdf Nina Seemann (IMS) Formal Models in NLP: Finite-State Automata May 15,

Finite-state Machines: Theory and Applications

Finite-state Machines: Theory and Applications Finite-state Machines: Theory and Applications Unweighted Finite-state Automata Thomas Hanneforth Institut für Linguistik Universität Potsdam December 10, 2008 Thomas Hanneforth (Universität Potsdam) Finite-state

More information

Introduction 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. 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 information

Introduction 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. 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 information

Finite State Transducers

Finite State Transducers Finite State Transducers Eric Gribkoff May 29, 2013 Original Slides by Thomas Hanneforth (Universitat Potsdam) Outline 1 Definition of Finite State Transducer 2 Examples of FSTs 3 Definition of Regular

More information

Automata and Formal Languages - CM0081 Non-Deterministic Finite Automata

Automata 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 information

Inf2A: Converting from NFAs to DFAs and Closure Properties

Inf2A: 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 information

CS 154, Lecture 2: Finite Automata, Closure Properties Nondeterminism,

CS 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 information

CS 208: Automata Theory and Logic

CS 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 information

COM364 Automata Theory Lecture Note 2 - Nondeterminism

COM364 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 information

Theory of Computation (I) Yijia Chen Fudan University

Theory 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 information

Finite Automata and Regular languages

Finite 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 information

Nondeterministic Finite Automata

Nondeterministic 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 information

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

FORMAL 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 information

Lecture 1: Finite State Automaton

Lecture 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 information

T (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,

T (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 information

CS 154. Finite Automata, Nondeterminism, Regular Expressions

CS 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 information

Finite Automata and Languages

Finite 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 information

CS 455/555: Finite automata

CS 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 information

Sri vidya college of engineering and technology

Sri 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 information

Intro to Theory of Computation

Intro 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 information

Closure under the Regular Operations

Closure 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 information

Chapter Five: Nondeterministic Finite Automata

Chapter 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 information

CS 121, Section 2. Week of September 16, 2013

CS 121, Section 2. Week of September 16, 2013 CS 121, Section 2 Week of September 16, 2013 1 Concept Review 1.1 Overview In the past weeks, we have examined the finite automaton, a simple computational model with limited memory. We proved that DFAs,

More information

Lecture 3: Nondeterministic Finite Automata

Lecture 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 information

UNIT-II. NONDETERMINISTIC FINITE AUTOMATA WITH ε TRANSITIONS: SIGNIFICANCE. Use of ε-transitions. s t a r t. ε r. e g u l a r

UNIT-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 information

Introduction to Formal Languages, Automata and Computability p.1/51

Introduction 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 information

CS 154, Lecture 3: DFA NFA, Regular Expressions

CS 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 information

Automata and Formal Languages - CM0081 Finite Automata and Regular Expressions

Automata 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 information

Non-deterministic Finite Automata (NFAs)

Non-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 information

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Finite 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 information

Equivalence of DFAs and NFAs

Equivalence 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 information

Finite Automata and Regular Languages

Finite 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 information

Extended transition function of a DFA

Extended 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 information

Nondeterministic Finite Automata. Nondeterminism Subset Construction

Nondeterministic 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 information

3515ICT: Theory of Computation. Regular languages

3515ICT: Theory of Computation. Regular languages 3515ICT: Theory of Computation Regular languages Notation and concepts concerning alphabets, strings and languages, and identification of languages with problems (H, 1.5). Regular expressions (H, 3.1,

More information

Introduction to Finite-State Automata

Introduction to Finite-State Automata Introduction to Finite-State Automata John McDonough Language Technologies Institute, Machine Learning for Signal Processing Group, Carnegie Mellon University March 26, 2012 Introduction In this lecture,

More information

September 11, Second Part of Regular Expressions Equivalence with Finite Aut

September 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 information

Theory of Computation

Theory 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 information

Nondeterministic Finite Automata

Nondeterministic 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 information

Harvard CS 121 and CSCI E-207 Lecture 4: NFAs vs. DFAs, Closure Properties

Harvard CS 121 and CSCI E-207 Lecture 4: NFAs vs. DFAs, Closure Properties Harvard CS 121 and CSCI E-207 Lecture 4: NFAs vs. DFAs, Closure Properties Salil Vadhan September 13, 2012 Reading: Sipser, 1.2. How to simulate NFAs? NFA accepts w if there is at least one accepting computational

More information

Outline. Nondetermistic Finite Automata. Transition diagrams. A finite automaton is a 5-tuple (Q, Σ,δ,q 0,F)

Outline. 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 information

2. Elements of the Theory of Computation, Lewis and Papadimitrou,

2. Elements of the Theory of Computation, Lewis and Papadimitrou, Introduction Finite Automata DFA, regular languages Nondeterminism, NFA, subset construction Regular Epressions Synta, Semantics Relationship to regular languages Properties of regular languages Pumping

More information

Automata Theory. Lecture on Discussion Course of CS120. Runzhe SJTU ACM CLASS

Automata 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 information

Closure 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 of Regular Languages Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism, Inverse Homomorphism Closure Properties Recall a closure property is a statement

More information

CSE 135: Introduction to Theory of Computation Equivalence of DFA and NFA

CSE 135: Introduction to Theory of Computation Equivalence of DFA and NFA CSE 135: Introduction to Theory of Computation Equivalence of DFA and NFA Sungjin Im University of California, Merced 02-03-2015 Expressive Power of NFAs and DFAs Is there a language that is recognized

More information

HKN CS/ECE 374 Midterm 1 Review. Nathan Bleier and Mahir Morshed

HKN 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 information

Constructions on Finite Automata

Constructions on Finite Automata Constructions on Finite Automata Informatics 2A: Lecture 4 Mary Cryan School of Informatics University of Edinburgh mcryan@inf.ed.ac.uk 24 September 2018 1 / 33 Determinization The subset construction

More information

Deterministic Finite Automata. Non deterministic finite automata. Non-Deterministic Finite Automata (NFA) Non-Deterministic Finite Automata (NFA)

Deterministic 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 information

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. 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 information

Great Theoretical Ideas in Computer Science. Lecture 4: Deterministic Finite Automaton (DFA), Part 2

Great Theoretical Ideas in Computer Science. Lecture 4: Deterministic Finite Automaton (DFA), Part 2 5-25 Great Theoretical Ideas in Computer Science Lecture 4: Deterministic Finite Automaton (DFA), Part 2 January 26th, 27 Formal definition: DFA A deterministic finite automaton (DFA) M =(Q,,,q,F) M is

More information

Closure under the Regular Operations

Closure under the Regular Operations Closure under the Regular Operations 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

More information

Finite Automata Part Two

Finite 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 information

Finite Automata. Theorems - Unit I SUSAN ELIAS. Professor Department of Computer Science & Engineering Sri Venkateswara College of Engineering

Finite Automata. Theorems - Unit I SUSAN ELIAS. Professor Department of Computer Science & Engineering Sri Venkateswara College of Engineering Finite Automata Theorems - Unit I SUSAN ELIAS Professor Department of Computer Science & Engineering Sri Venkateswara College of Engineering September 17, 2012 Unit I - Guidelines Formal Definitions Definition

More information

Decision, Computation and Language

Decision, 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 information

Theory of Computation (II) Yijia Chen Fudan University

Theory of Computation (II) Yijia Chen Fudan University Theory of Computation (II) Yijia Chen Fudan University Review A language L is a subset of strings over an alphabet Σ. Our goal is to identify those languages that can be recognized by one of the simplest

More information

Nondeterminism and Epsilon Transitions

Nondeterminism 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 information

CS 275 Automata and Formal Language Theory

CS 275 Automata and Formal Language Theory CS 275 Automata and Formal Language Theory Course Notes Part II: The Recognition Problem (II) Chapter II.4.: Properties of Regular Languages (13) Anton Setzer (Based on a book draft by J. V. Tucker and

More information

Finite Universes. L is a fixed-length language if it has length n for some

Finite 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

Regular Expressions. Definitions Equivalence to Finite Automata

Regular Expressions. Definitions Equivalence to Finite Automata Regular Expressions Definitions Equivalence to Finite Automata 1 RE s: Introduction Regular expressions are an algebraic way to describe languages. They describe exactly the regular languages. If E is

More information

CS243, Logic and Computation Nondeterministic finite automata

CS243, 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 information

Takeaway Notes: Finite State Automata

Takeaway 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 information

Subset 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 )

Subset 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 information

Constructions on Finite Automata

Constructions on Finite Automata Constructions on Finite Automata Informatics 2A: Lecture 4 Alex Simpson School of Informatics University of Edinburgh als@inf.ed.ac.uk 23rd September, 2014 1 / 29 1 Closure properties of regular languages

More information

Theory of Languages and Automata

Theory of Languages and Automata Theory of Languages and Automata Chapter 1- Regular Languages & Finite State Automaton Sharif University of Technology Finite State Automaton We begin with the simplest model of Computation, called finite

More information

CSE 135: Introduction to Theory of Computation Nondeterministic Finite Automata (cont )

CSE 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 information

FS Properties and FSTs

FS Properties and FSTs FS Properties and FSTs Chris Dyer Algorithms for NLP 11-711 Announcements HW1 has been posted; due in class in 2 weeks Goals of Today s Lecture Understand properties of regular languages Understand Brzozowski

More information

September 7, Formal Definition of a Nondeterministic Finite Automaton

September 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 information

INF Introduction and Regular Languages. Daniel Lupp. 18th January University of Oslo. Department of Informatics. Universitetet i Oslo

INF Introduction and Regular Languages. Daniel Lupp. 18th January University of Oslo. Department of Informatics. Universitetet i Oslo INF28 1. Introduction and Regular Languages Daniel Lupp Universitetet i Oslo 18th January 218 Department of Informatics University of Oslo INF28 Lecture :: 18th January 1 / 33 Details on the Course consists

More information

Unit 6. Non Regular Languages The Pumping Lemma. Reading: Sipser, chapter 1

Unit 6. Non Regular Languages The Pumping Lemma. Reading: Sipser, chapter 1 Unit 6 Non Regular Languages The Pumping Lemma Reading: Sipser, chapter 1 1 Are all languages regular? No! Most of the languages are not regular! Why? A finite automaton has limited memory. How can we

More information

Languages. 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. 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 information

CS 530: Theory of Computation Based on Sipser (second edition): Notes on regular languages(version 1.1)

CS 530: Theory of Computation Based on Sipser (second edition): Notes on regular languages(version 1.1) CS 530: Theory of Computation Based on Sipser (second edition): Notes on regular languages(version 1.1) Definition 1 (Alphabet) A alphabet is a finite set of objects called symbols. Definition 2 (String)

More information

Regular expressions and Kleene s theorem

Regular expressions and Kleene s theorem and Informatics 2A: Lecture 5 Alex Simpson School of Informatics University of Edinburgh als@inf.ed.ac.uk 25 September, 2014 1 / 26 1 More closure properties of regular languages Operations on languages

More information

Finite Automata and Regular Languages (part III)

Finite 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 information

Finite Automata. Seungjin Choi

Finite 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 information

Theory of Computation p.1/?? Theory of Computation p.2/?? Unknown: Implicitly a Boolean variable: true if a word is

Theory of Computation p.1/?? Theory of Computation p.2/?? Unknown: Implicitly a Boolean variable: true if a word is Abstraction of Problems Data: abstracted as a word in a given alphabet. Σ: alphabet, a finite, non-empty set of symbols. Σ : all the words of finite length built up using Σ: Conditions: abstracted as a

More information

CSC173 Workshop: 13 Sept. Notes

CSC173 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 information

Computer Sciences Department

Computer 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 information

Properties of Regular Languages. BBM Automata Theory and Formal Languages 1

Properties of Regular Languages. BBM Automata Theory and Formal Languages 1 Properties of Regular Languages BBM 401 - Automata Theory and Formal Languages 1 Properties of Regular Languages Pumping Lemma: Every regular language satisfies the pumping lemma. A non-regular language

More information

Equivalence of Regular Expressions and FSMs

Equivalence of Regular Expressions and FSMs Equivalence of Regular Expressions and FSMs Greg Plaxton Theory in Programming Practice, Spring 2005 Department of Computer Science University of Texas at Austin Regular Language Recall that a language

More information

Nondeterminism. September 7, Nondeterminism

Nondeterminism. 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 information

Nondeterministic Finite Automata

Nondeterministic 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 information

Finite Automata. Finite Automata

Finite 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 information

CPS 220 Theory of Computation REGULAR LANGUAGES

CPS 220 Theory of Computation REGULAR LANGUAGES CPS 22 Theory of Computation REGULAR LANGUAGES Introduction Model (def) a miniature representation of a thing; sometimes a facsimile Iraq village mockup for the Marines Scientific modelling - the process

More information

CS 154. Finite Automata vs Regular Expressions, Non-Regular Languages

CS 154. Finite Automata vs Regular Expressions, Non-Regular Languages CS 154 Finite Automata vs Regular Expressions, Non-Regular Languages Deterministic Finite Automata Computation with finite memory Non-Deterministic Finite Automata Computation with finite memory and guessing

More information

Computational Models - Lecture 1 1

Computational Models - Lecture 1 1 Computational Models - Lecture 1 1 Handout Mode Ronitt Rubinfeld and Iftach Haitner. Tel Aviv University. February 29/ March 02, 2016 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames

More information

Parsing Regular Expressions and Regular Grammars

Parsing Regular Expressions and Regular Grammars Regular Expressions and Regular Grammars Laura Heinrich-Heine-Universität Düsseldorf Sommersemester 2011 Regular Expressions (1) Let Σ be an alphabet The set of regular expressions over Σ is recursively

More information

Computational Theory

Computational Theory Computational Theory Finite Automata and Regular Languages Curtis Larsen Dixie State University Computing and Design Fall 2018 Adapted from notes by Russ Ross Adapted from notes by Harry Lewis Curtis Larsen

More information

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY 15-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY REVIEW for MIDTERM 1 THURSDAY Feb 6 Midterm 1 will cover everything we have seen so far The PROBLEMS will be from Sipser, Chapters 1, 2, 3 It will be

More information

Obtaining the syntactic monoid via duality

Obtaining the syntactic monoid via duality Radboud University Nijmegen MLNL Groningen May 19th, 2011 Formal languages An alphabet is a non-empty finite set of symbols. If Σ is an alphabet, then Σ denotes the set of all words over Σ. The set Σ forms

More information

The Pumping Lemma and Closure Properties

The Pumping Lemma and Closure Properties The Pumping Lemma and Closure Properties Mridul Aanjaneya Stanford University July 5, 2012 Mridul Aanjaneya Automata Theory 1/ 27 Tentative Schedule HW #1: Out (07/03), Due (07/11) HW #2: Out (07/10),

More information

Theory of Computation Lecture 1. Dr. Nahla Belal

Theory of Computation Lecture 1. Dr. Nahla Belal Theory of Computation Lecture 1 Dr. Nahla Belal Book The primary textbook is: Introduction to the Theory of Computation by Michael Sipser. Grading 10%: Weekly Homework. 30%: Two quizzes and one exam. 20%:

More information

GEETANJALI INSTITUTE OF TECHNICAL STUDIES, UDAIPUR I

GEETANJALI INSTITUTE OF TECHNICAL STUDIES, UDAIPUR I GEETANJALI INSTITUTE OF TECHNICAL STUDIES, UDAIPUR I Internal Examination 2017-18 B.Tech III Year VI Semester Sub: Theory of Computation (6CS3A) Time: 1 Hour 30 min. Max Marks: 40 Note: Attempt all three

More information

Computability and Complexity

Computability and Complexity Computability and Complexity Non-determinism, Regular Expressions CAS 705 Ryszard Janicki Department of Computing and Software McMaster University Hamilton, Ontario, Canada janicki@mcmaster.ca Ryszard

More information

Examples of Regular Expressions. Finite Automata vs. Regular Expressions. Example of Using flex. Application

Examples of Regular Expressions. Finite Automata vs. Regular Expressions. Example of Using flex. Application Examples of Regular Expressions 1. 0 10, L(0 10 ) = {w w contains exactly a single 1} 2. Σ 1Σ, L(Σ 1Σ ) = {w w contains at least one 1} 3. Σ 001Σ, L(Σ 001Σ ) = {w w contains the string 001 as a substring}

More information

NOTES ON AUTOMATA. Date: April 29,

NOTES ON AUTOMATA. Date: April 29, NOTES ON AUTOMATA 1. Monoids acting on sets We say that a monoid S with identity element ɛ acts on a set Q if q(st) = (qs)t and qɛ = q. As with groups, if we set s = t whenever qs = qt for all q Q, then

More information

CSE 311: Foundations of Computing. Lecture 23: Finite State Machine Minimization & NFAs

CSE 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 information

Uses of finite automata

Uses of finite automata Chapter 2 :Finite Automata 2.1 Finite Automata Automata are computational devices to solve language recognition problems. Language recognition problem is to determine whether a word belongs to a language.

More information

CSE 105 Theory of Computation Professor Jeanne Ferrante

CSE 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 information

CMSC 330: Organization of Programming Languages. Theory of Regular Expressions Finite Automata

CMSC 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 information

Applied Computer Science II Chapter 1 : Regular Languages

Applied Computer Science II Chapter 1 : Regular Languages Applied Computer Science II Chapter 1 : Regular Languages Prof. Dr. Luc De Raedt Institut für Informatik Albert-Ludwigs Universität Freiburg Germany Overview Deterministic finite automata Regular languages

More information