Foreword. Grammatical inference. Examples of sequences. Sources. Example of problems expressed by sequences Switching the light

Size: px
Start display at page:

Download "Foreword. Grammatical inference. Examples of sequences. Sources. Example of problems expressed by sequences Switching the light"

Transcription

1 Foreword Vincent Claveau IRISA - CNRS Rennes, France In the course of the course supervised symbolic machine learning technique concept learning (i.e. 2 classes) INSA 4 Sources s of sequences Slides and concepts L. Miclet, F. Coste... Sequence of symbols sequential information genomic data (DNA, RNA, protein), language, music, logs, electrocardiogram... how to handle this sequential aspect in machine learning? can we learn automatically to recognize sequences of DNA encoding a certain physioogical property? of problems expressed by sequences Back to the starting point sequence aababaaabb is a positive example sequence aababaaaba is a negative example can we learn automatically to distinguish between sequences leading back to the starting point from the others? of problems expressed by sequences Switching the light consider 2 switches I1 and I2 for one light bulb; 4 states are possible state 1: I1 is in low and I2 is low (light is off) state 2: I1 is in high and I2 is low (light is on) state 3: I1 is in low and I2 is high (light is on) state 2: I1 is in high and I2 is high (light is on) action a modifies state of I1, action b modifies I2 only state 1 is wanted (light switched off) sequences aa, baba and abbbba are accepted sequences a, ab, baa or bbbbbbbbb are not can we learn automatically to sequences of actions leading to state 1?

2 of problems expressed by sequences Switching the light Other sequences: switching the light Finite state automaton of the problem Basics 1 Vocabulary...: sequence of symbols (from an alphabet Σ)...: set (possibly infinite) of words...: set of rules producing the words of a language Some tools handling sequences grammar (rules) finite state machines (automata, transducers...) trees (prefix tree...) expressions (regular expressions) HMM... Basics 2 Chomsky hierarchy one possible classification (among many others!) of the languages according to increasing expressiveness... grammars (type 3; A a and A ab)... grammars (type 2; A γ with γ = abccbcca)... grammars (type 1; αaβ γ)... grammars (type 0; α β) regular grammars are mastered, in particular, we know how to infer them... we know fewer things on context-free grammars we know almost nothing on context-sensitive and unrestricted grammars Basics 3 In this course we focus only on regular languages we use automata to represent/handle them The 4 methodological questions (cf. class 1) 1 - Describing the examples as sequences of symbols examples : b, aab, aaaab negative examples : aaab, a, aaaaa, bb 2 - Choosing the hypothesis space hypothesis: any automaton (deterministic DFA, or non-deterministic NFA) 3 - Exploring the hypothesis space exploration of discrete space (state merging, see below) 4 - Evaluation classically, by testing the final automaton with a test set

3 A closer look at the hypothesis space 1 What is in our hypothesis space example of automaton: in this course, we decide that non-deterministic automata are refused Properties of the hypothesis space for a finite set of examples, the hypothesis space is finite the hypothesis space can be hierarchically organized A closer look at the hypothesis space 2 Cover relation in grammatical inference the hypothesis covers the example abaa A closer look at the hypothesis space 3 Subsumption in grammatical inference the hypothesis also covers abaa space Hypothesis space space Hypothesis space A closer look at the hypothesis space 4 Bounds of the hypothesis space most specific (canonical) automaton of the training set most specific (canonical) automaton of the positive examples most general (canonical) automaton (UA) Exploring the hypothesis space Principles learning by exploring the discrete space of automata searching for an automaton with a empiric risk equals to zero bottom-up search: starting from the most specific automaton and generalizing generalization operator: state merging About merging choosing 2 states and merging them to generalize cascade of forced merging to make the automaton deterministic control (stop) the merging with the negative examples

4 Exploring the hypothesis space Exploring the hypothesis space of merging NB: merging may produce non-deterministic automata example to be done in course Avoiding over-generalization a criterion to stop the merging is needed examples of such criteria limitation to a certain sub-family of automata statistical criterion (the remaining states are considered as to different to be merged) use of negative examples: stop when one e is accepted by the automaton Theoretical and practical problems Open issues why starting from the canonical automaton and exploring by merging? when the training set is enough to be sure to find the good hypothesis? how to choose the state to be merged? can we accept an empiric risk greater than 0? can we generalize to more complex concepts: stochastic automata, transducers, context-free grammars? Finite state automata quintuplet (Q, Σ, δ, q 0, F ) Q: finite set of states Σ: finite alphabet δ: transition function QxΣ 2 Q Q 0 Q: set of initial states F Q: set of final (or accepting) states Deterministic automaton, complete automaton if q Q and a Σ, δ(q, a) contains at most one element (resp. exactly one element) and if Q 0 = 1, the automaton is said deterministic (DFA) (resp. complete)

5 What can be said about this automaton? Cover relation an automaton (deterministic or not) covers (accepts) a word u = a 1...a j, if there exists a sequence (unique or not) of j + 1 states (q 0,..., q j ) s.t. q 0 Q 0, q j F, 0 i j 1, q i+1 δ(q i, a i+1 ) the j + 1 states are said to be reached for this acceptation and q j is the accepting state the j transitions are said to be used by this acceptation Accepted language the language L(A) accepted by an automaton A is the set of all the sequences accepted by A Partitions a partition π of S is a set of subsets of S, each subset being non-empty and non-overlapping, and such that their union is S if s S, the unique element (block) of π including s is written B(s, π) a partition π i refines (is thinner than) a partition π j iff every block of π j is a block of π i or is the union of several blocks of π i s of partitions consider an automaton containing 5 states: 0, 1, 2, 3, 4 π 2 = {{0, 1}, {2}, {3, 4}} is a possible partition π 3 = {{0, 1, 2}, {3, 4}} is... than π 2 π 4 = {{0}, {1, 3}, {2, 4}}... B(0, π 2 ) =... (block containing state 0 in π 2 ) B(0, π 3 ) =... (block containing state 0 in π 3 )

6 Derived automata or quotient automaton let A = (Q, Σ, δ, q 0, F ) be an automaton, the automaton derived from A w.r.t. partition π of Q A/π is defined by: Q = Q/π = {B(q, π) q Q} F = {B Q B F } δ : Q xσ 2 Q : B, B Q, a Σ, B δ (B, a) iff q, q Q, q B, q B and q δ(q, a) the states of Q belonging to the same block B of the partition π are said to be merged Derived automata consider the automaton A 1 ; compute A 2 = A 1 /π 2 with π 2 = {{0, 1}, {2}, {3, 4}} Automaton A 1 Derived automata consider the automaton A 1 ; compute A 2 = A 1 /π 2 with π 2 = {{0, 1}, {2}, {3, 4}} Major property of merging if an automaton A/π j derives from an automaton A/π i, then the language accepted by A/π i is included in the one that A/π j accepts thus, A/π j recognizes all the words accepted by A/π i plus other words it means that A/π j is more general than A/π i more formally, the merging operation induces... Practical consequence starting from an automaton A, it is possible to build every automaton derived from A from the partitions of A s states there exists a partial order relation on this set, consistent with the inclusion of the language recognized by these automata Major property of merging - s back to example A 1, we ve seen that choosing the partition π = {{0, 1}, {2}, {3, 4}} make it possible to derive the quotient automaton A 2 = A 1 /π 2 thus, we know that L(A 1 ) L(A 2 ) Exercise compute A 3 = A 1 /π 3 (π 3 = {{0, 1, 2}, {3, 4}}); what can you say about it?

7 compute A 3 = A 1 /π 3 (π 3 = {{0, 1, 2}, {3, 4}}); what can you say about it? partition π 3 is... than π 2 since its blocks are built as the union of blocks of π 2 thus, we know that L(A 2 )...L(A 3 ) Exercise compute A 4 = A 1 /π 4 (π 4 = {{0}, {1, 3}, {2, 4}}); what can you say about it? compute A 4 = A 1 /π 4 (π 4 = {{0}, {1, 3}, {2, 4}}); what can you say about it? Hypothesis space Space E H and merging The set of automata derived from an automaton A is partially ordered by the subsumption relation given by the derivation; thus, E H is a lattice automaton A is the most specific element (bottom) universal automaton UA is the most general element (top) there are as many elements in E H as possible partitions on the states of A the more we merge states, the more the accepted language grows Structural completeness 1 Structural completeness 2 Language samples positive sample E + : finite subset of a language L negative sample E : finite sample of the complement language Σ L Structural completeness E + is structurally complete w.r.t a deterministic automaton A accepting L if every transition of A has been used every element of F (final states of A) is used as acception state it implements an... - Exercise give several DFA such that E + = {aab, ab, abbbbb} is structurally complete for them

8 Canonical automata 1 Maximal canonical automaton of E + - MCA biggest automata (in number of states) such that E + is structurally complete written MCA(E + ) = (Q, Σ, δ, q 0, F ); generally non-deterministic (because Q 0 > 1) example of MCA({a, ab, bab}) Canonical automata 2 Prefix tree accepting E + - PTA quotient automaton MCA(E + )/π E +, written PTA(E + ) and defined by: B(q, π E +) = B(q, π E +) iff Pr(q) = Pr(q ) PTA(E + ) is obtained by merging states of MCA(E + ) sharing the same prefixes; by construction, it is deterministic example on the previous sample Maximal generalization 1 Goal of the exploration find the minimal automaton that does not cover any negative example border set (in dash): limit of negative example acceptation Maximal generalization 2 Border set frontier set BS MCA (E +, E ): antichain in which each element is at a maximal depth in E H (space built from MCA(E + )) antichain (fr: antichaîne): subset s.t. no pair of element is in order relation (not comparable) BS PTA (E +, E ) contains the canonical automaton A(L) of any regular language L for which E+ is a positive sample and E a negative one Maximal generalization 3 Maximal generalization 4 Consequences the border set of the lattice built from MCA(E + ) is the set of the most general automata compatible with E + and E the problem of finding the smallest DFA compatible with E + and E is thus equivalent to finding the smallest DFA in the border set built from PTA(E + ) let s consider E + = {b, ab} and E = {bb} the maximal canonical automaton of E + is:

9 Maximal generalization 5 automata in the border set BS PTA (E +, E ) with E + = {b, ab} and E = {bb} Back on the hypothesis space 1 Fundamental properties - general case let E + be a sample of a regular language L, and A any automaton recognizing exactly L if E + is structurally complete wrt A, then A E H (space built from MCA(E + )) conversely, if A E H (built from MCA(E + )), then E + is structurally complete wrt A Fundamental properties - deterministic case let E + be a sample of a regular language L, and A a cannonical automaton recognizing L if E + is structurally complete wrt A(L), then A(L) E H (built from PTA(E + )) Back on the hypothesis space 2 Size of E H let E + be a sample of an unknown language L structurally complete for an automaton A accepting exactly L A can be derived from a partition π of the states of MCA(E + ), i.e. regular inference = finding partition π thus, the size of E H is the number of partitions P(N) with N the number of states of MCA(E + ) or of PTA(E + ) for example P(10) = 10 5, P(20) = , P(100) = this number grows exponentially, thus we need a clever exploration, guided by heuristics RPNI algorithm Principles RPNI implements a depht-first search in E H built upon PTA(E + ) and find a local optimum to the problem of the smallest DFA by construction, every state of PTA(E + ) corresponds to a unique prefix and these prefixes can be sorted by length and lexicographic order (ɛ, a, b, aa, ab, ba, bb, aaa, aab...) RPNI process with N 1 steps where N is the number of states in PTA(E + ) the partition in step i is obtained by merging the two first blocks (wrt the length and lexicographic order above), of the partition of step i 1, which results in a compatible quotient automaton RPNI algorithm Input: E +, E ; Output: a partition of PTA(E+) corresponding to a DFA compatible with E + and E π {{0}, {1},..., {N 1}} ; N = number of states in PTA(E + ) A PTA(E + ) ; for i = 1 to N 1 do for j = 0 à i 1 do π π \ {B j, B i } {B i B j } ; merging of blocks/states Bi and B j if A/π do not accept elements of E then π determ fusion(a/π ) ; π π endif end for end for Return A A/π ;

10 RPNI algorithm RPNI algorithm Convergence RPNI outputs a DFA belonging to BS PTA (E +, E ) it is the canonical automaton for the accepted language it is the smallest compatible DFA only if the training data satisfies an additional condition: if they contain a characteristic sample i.e. when the training data are representative enough of the language, the discovery of the canonical automaton of this langage is guaranteed moreover, this automaton the smallest compatible DFA in this particular case Convergence the size of the characteristic sample for this particular algorithm is O(n 2 ) where n is the number of states of the resulting automaton the complexity of RPNI, in the latest published version, is O(( E + + E ) E + 2 ) if the training sample contains every word of length < 2n 1, then identification is guaranteed. yet, this property is hard: if the training set contains every word but a small part of the characteristic sample, identification is not guaranteed any more RPNI step by step RPNI step by step Initial data let E + = {ɛ, ab, aaa, aabaa, aaaba} and E = {aa, baa, aaab}, apply the RPNI algorithm Initial data let E + = {ɛ, ab, aaa, aabaa, aaaba} and E = {aa, baa, aaab} the PTA(E + )... RPNI step by step RPNI step by step Start RPNI begins in merging 2 states. Without any other information, states 0 and 1 that are chosen End back to the starting point, and merging 0 and 3 the resulting DFA is compatible with E + and E it is on the border set; we keep this solution

11 Conclusion Conclusion Real example 1 Real example 3 Genomic example searching the grammar defining a promoter of B. Subtilis E + = 131, E = bottom = (PTA or MCA?) solution found: 95 states, 347 transitions, several hours of computing Conclusion Real example 2 Genomic example searching the grammar defining a promoter of B. Subtilis E + = 131, E = bottom = (PTA or MCA?) solution found: 95 states, 347 transitions, several hours of computing compactness? readability?

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

AC68 FINITE AUTOMATA & FORMULA LANGUAGES DEC 2013

AC68 FINITE AUTOMATA & FORMULA LANGUAGES DEC 2013 Q.2 a. Prove by mathematical induction n 4 4n 2 is divisible by 3 for n 0. Basic step: For n = 0, n 3 n = 0 which is divisible by 3. Induction hypothesis: Let p(n) = n 3 n is divisible by 3. Induction

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

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

Theoretical Computer Science

Theoretical Computer Science Theoretical Computer Science 448 (2012) 41 46 Contents lists available at SciVerse ScienceDirect Theoretical Computer Science journal homepage: www.elsevier.com/locate/tcs Polynomial characteristic sets

More information

COSE212: Programming Languages. Lecture 1 Inductive Definitions (1)

COSE212: Programming Languages. Lecture 1 Inductive Definitions (1) COSE212: Programming Languages Lecture 1 Inductive Definitions (1) Hakjoo Oh 2018 Fall Hakjoo Oh COSE212 2018 Fall, Lecture 1 September 5, 2018 1 / 10 Inductive Definitions Inductive definition (induction)

More information

CpSc 421 Homework 1 Solutions

CpSc 421 Homework 1 Solutions CpSc 421 Homework 1 Solutions 1. (15 points) Let Σ = {a, b, c}. Figure 7 depicts two finite state machines that read Let L a and L b denote the languages recognized by DFA (a) and DFA (b) respectively.

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 TMV027/DIT321 LP4 2018 Lecture 14 Ana Bove May 14th 2018 Recap: Context-free Grammars Simplification of grammars: Elimination of ǫ-productions; Elimination of

More information

Improved TBL algorithm for learning context-free grammar

Improved TBL algorithm for learning context-free grammar Proceedings of the International Multiconference on ISSN 1896-7094 Computer Science and Information Technology, pp. 267 274 2007 PIPS Improved TBL algorithm for learning context-free grammar Marcin Jaworski

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

COSE212: Programming Languages. Lecture 1 Inductive Definitions (1)

COSE212: Programming Languages. Lecture 1 Inductive Definitions (1) COSE212: Programming Languages Lecture 1 Inductive Definitions (1) Hakjoo Oh 2017 Fall Hakjoo Oh COSE212 2017 Fall, Lecture 1 September 4, 2017 1 / 9 Inductive Definitions Inductive definition (induction)

More information

Learning k-edge Deterministic Finite Automata in the Framework of Active Learning

Learning k-edge Deterministic Finite Automata in the Framework of Active Learning Learning k-edge Deterministic Finite Automata in the Framework of Active Learning Anuchit Jitpattanakul* Department of Mathematics, Faculty of Applied Science, King Mong s University of Technology North

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

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

Pushdown Automata. Reading: Chapter 6

Pushdown Automata. Reading: Chapter 6 Pushdown Automata Reading: Chapter 6 1 Pushdown Automata (PDA) Informally: A PDA is an NFA-ε with a infinite stack. Transitions are modified to accommodate stack operations. Questions: What is a stack?

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

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

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

60-354, Theory of Computation Fall Asish Mukhopadhyay School of Computer Science University of Windsor

60-354, Theory of Computation Fall Asish Mukhopadhyay School of Computer Science University of Windsor 60-354, Theory of Computation Fall 2013 Asish Mukhopadhyay School of Computer Science University of Windsor Pushdown Automata (PDA) PDA = ε-nfa + stack Acceptance ε-nfa enters a final state or Stack is

More information

Theoretical Computer Science

Theoretical Computer Science Theoretical Computer Science Zdeněk Sawa Department of Computer Science, FEI, Technical University of Ostrava 17. listopadu 15, Ostrava-Poruba 708 33 Czech republic September 22, 2017 Z. Sawa (TU Ostrava)

More information

1. (a) Explain the procedure to convert Context Free Grammar to Push Down Automata.

1. (a) Explain the procedure to convert Context Free Grammar to Push Down Automata. Code No: R09220504 R09 Set No. 2 II B.Tech II Semester Examinations,December-January, 2011-2012 FORMAL LANGUAGES AND AUTOMATA THEORY Computer Science And Engineering Time: 3 hours Max Marks: 75 Answer

More information

Theory of Computation

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

NODIA AND COMPANY. GATE SOLVED PAPER Computer Science Engineering Theory of Computation. Copyright By NODIA & COMPANY

NODIA AND COMPANY. GATE SOLVED PAPER Computer Science Engineering Theory of Computation. Copyright By NODIA & COMPANY No part of this publication may be reproduced or distributed in any form or any means, electronic, mechanical, photocopying, or otherwise without the prior permission of the author. GATE SOLVED PAPER Computer

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

Chapter 3. Regular grammars

Chapter 3. Regular grammars Chapter 3 Regular grammars 59 3.1 Introduction Other view of the concept of language: not the formalization of the notion of effective procedure, but set of words satisfying a given set of rules Origin

More information

Compiler Design. Spring Lexical Analysis. Sample Exercises and Solutions. Prof. Pedro C. Diniz

Compiler Design. Spring Lexical Analysis. Sample Exercises and Solutions. Prof. Pedro C. Diniz Compiler Design Spring 2011 Lexical Analysis Sample Exercises and Solutions Prof. Pedro C. Diniz USC / Information Sciences Institute 4676 Admiralty Way, Suite 1001 Marina del Rey, California 90292 pedro@isi.edu

More information

CS 133 : Automata Theory and Computability

CS 133 : Automata Theory and Computability CS 133 : Automata Theory and Computability Lecture Slides 1 Regular Languages and Finite Automata Nestine Hope S. Hernandez Algorithms and Complexity Laboratory Department of Computer Science University

More information

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska LECTURE 14 SMALL REVIEW FOR FINAL SOME Y/N QUESTIONS Q1 Given Σ =, there is L over Σ Yes: = {e} and L = {e} Σ Q2 There are uncountably

More information

Learning Context Free Grammars with the Syntactic Concept Lattice

Learning Context Free Grammars with the Syntactic Concept Lattice Learning Context Free Grammars with the Syntactic Concept Lattice Alexander Clark Department of Computer Science Royal Holloway, University of London alexc@cs.rhul.ac.uk ICGI, September 2010 Outline Introduction

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

Undecidable Problems and Reducibility

Undecidable Problems and Reducibility University of Georgia Fall 2014 Reducibility We show a problem decidable/undecidable by reducing it to another problem. One type of reduction: mapping reduction. Definition Let A, B be languages over Σ.

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

Compiler Design. Spring Lexical Analysis. Sample Exercises and Solutions. Prof. Pedro Diniz

Compiler Design. Spring Lexical Analysis. Sample Exercises and Solutions. Prof. Pedro Diniz Compiler Design Spring 2010 Lexical Analysis Sample Exercises and Solutions Prof. Pedro Diniz USC / Information Sciences Institute 4676 Admiralty Way, Suite 1001 Marina del Rey, California 90292 pedro@isi.edu

More information

Automata theory. An algorithmic approach. Lecture Notes. Javier Esparza

Automata theory. An algorithmic approach. Lecture Notes. Javier Esparza Automata theory An algorithmic approach Lecture Notes Javier Esparza July 2 22 2 Chapter 9 Automata and Logic A regular expression can be seen as a set of instructions ( a recipe ) for generating the words

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

Context Free Languages. Automata Theory and Formal Grammars: Lecture 6. Languages That Are Not Regular. Non-Regular Languages

Context Free Languages. Automata Theory and Formal Grammars: Lecture 6. Languages That Are Not Regular. Non-Regular Languages Context Free Languages Automata Theory and Formal Grammars: Lecture 6 Context Free Languages Last Time Decision procedures for FAs Minimum-state DFAs Today The Myhill-Nerode Theorem The Pumping Lemma Context-free

More information

St.MARTIN S ENGINEERING COLLEGE Dhulapally, Secunderabad

St.MARTIN S ENGINEERING COLLEGE Dhulapally, Secunderabad St.MARTIN S ENGINEERING COLLEGE Dhulapally, Secunderabad-500 014 Subject: FORMAL LANGUAGES AND AUTOMATA THEORY Class : CSE II PART A (SHORT ANSWER QUESTIONS) UNIT- I 1 Explain transition diagram, transition

More information

Pushdown 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 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 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

Computational Models - Lecture 4

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

More on Finite Automata and Regular Languages. (NTU EE) Regular Languages Fall / 41

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

Formal Definition of a Finite Automaton. August 26, 2013

Formal Definition of a Finite Automaton. August 26, 2013 August 26, 2013 Why a formal definition? A formal definition is precise: - It resolves any uncertainties about what is allowed in a finite automaton such as the number of accept states and number of transitions

More information

Theory of Computation (Classroom Practice Booklet Solutions)

Theory of Computation (Classroom Practice Booklet Solutions) Theory of Computation (Classroom Practice Booklet Solutions) 1. Finite Automata & Regular Sets 01. Ans: (a) & (c) Sol: (a) The reversal of a regular set is regular as the reversal of a regular expression

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

Regular expressions and Kleene s theorem

Regular expressions and Kleene s theorem Regular expressions and Kleene s theorem Informatics 2A: Lecture 5 Mary Cryan School of Informatics University of Edinburgh mcryan@inf.ed.ac.uk 26 September 2018 1 / 18 Finishing DFA minimization An algorithm

More information

Theory of Computer Science

Theory of Computer Science Theory of Computer Science C1. Formal Languages and Grammars Malte Helmert University of Basel March 14, 2016 Introduction Example: Propositional Formulas from the logic part: Definition (Syntax of Propositional

More information

The Post Correspondence Problem

The Post Correspondence Problem The Post Correspondence Problem - Given a set, P of pairs of strings: where t i, b i Σ P = {[ t 1 b 1 ], t 2 b 2 ],, t k b k ]} - Question: Does there exist a sequence i 1, i 2, i n such that: t i1 t i2

More information

MA/CSSE 474 Theory of Computation

MA/CSSE 474 Theory of Computation MA/CSSE 474 Theory of Computation CFL Hierarchy CFL Decision Problems Your Questions? Previous class days' material Reading Assignments HW 12 or 13 problems Anything else I have included some slides online

More information

Automata: a short introduction

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

Theory of Computation - Module 3

Theory of Computation - Module 3 Theory of Computation - Module 3 Syllabus Context Free Grammar Simplification of CFG- Normal forms-chomsky Normal form and Greibach Normal formpumping lemma for Context free languages- Applications of

More information

download instant at Assume that (w R ) R = w for all strings w Σ of length n or less.

download instant at  Assume that (w R ) R = w for all strings w Σ of length n or less. Chapter 2 Languages 3. We prove, by induction on the length of the string, that w = (w R ) R for every string w Σ. Basis: The basis consists of the null string. In this case, (λ R ) R = (λ) R = λ as desired.

More information

Deterministic finite Automata

Deterministic finite Automata Deterministic finite Automata Informatics 2A: Lecture 3 Alex Simpson School of Informatics University of Edinburgh als@inf.ed.ac.uk 21 September, 212 1 / 29 1 Languages and Finite State Machines What is

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

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

Learning Regular Languages Using Nondeterministic Finite Automata

Learning Regular Languages Using Nondeterministic Finite Automata Learning Regular Languages Using Nondeterministic Finite Automata Pedro García 1,ManuelVázquez de Parga 1,GloriaI.Álvarez2,andJoséRuiz 1 1 DSIC, Universidad Politécnica de Valencia. Valencia (Spain) 2

More information

Theory of Computation

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

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

Compiler Design 1. LR Parsing. Goutam Biswas. Lect 7

Compiler Design 1. LR Parsing. Goutam Biswas. Lect 7 Compiler Design 1 LR Parsing Compiler Design 2 LR(0) Parsing An LR(0) parser can take shift-reduce decisions entirely on the basis of the states of LR(0) automaton a of the grammar. Consider the following

More information

ECS 120: Theory of Computation UC Davis Phillip Rogaway February 16, Midterm Exam

ECS 120: Theory of Computation UC Davis Phillip Rogaway February 16, Midterm Exam ECS 120: Theory of Computation Handout MT UC Davis Phillip Rogaway February 16, 2012 Midterm Exam Instructions: The exam has six pages, including this cover page, printed out two-sided (no more wasted

More information

Formal Languages and Automata

Formal Languages and Automata Formal Languages and Automata 5 lectures for 2016-17 Computer Science Tripos Part IA Discrete Mathematics by Ian Leslie c 2014,2015 AM Pitts; 2016,2017 IM Leslie (minor tweaks) What is this course about?

More information

Theory of Computation

Theory of Computation Theory of Computation Lecture #2 Sarmad Abbasi Virtual University Sarmad Abbasi (Virtual University) Theory of Computation 1 / 1 Lecture 2: Overview Recall some basic definitions from Automata Theory.

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

Fooling Sets and. Lecture 5

Fooling Sets and. Lecture 5 Fooling Sets and Introduction to Nondeterministic Finite Automata Lecture 5 Proving that a language is not regular Given a language, we saw how to prove it is regular (union, intersection, concatenation,

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

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

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

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

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

Question Bank UNIT I

Question Bank UNIT I Siddhivinayak Technical Campus School of Engineering & Research Technology Department of computer science and Engineering Session 2016-2017 Subject Name- Theory of Computation Subject Code-4KS05 Sr No.

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

Part 4 out of 5 DFA NFA REX. Automata & languages. A primer on the Theory of Computation. Last week, we showed the equivalence of DFA, NFA and REX

Part 4 out of 5 DFA NFA REX. Automata & languages. A primer on the Theory of Computation. Last week, we showed the equivalence of DFA, NFA and REX Automata & languages A primer on the Theory of Computation Laurent Vanbever www.vanbever.eu Part 4 out of 5 ETH Zürich (D-ITET) October, 12 2017 Last week, we showed the equivalence of DFA, NFA and REX

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

What we have done so far

What we have done so far What we have done so far DFAs and regular languages NFAs and their equivalence to DFAs Regular expressions. Regular expressions capture exactly regular languages: Construct a NFA from a regular expression.

More information

Automata Theory for Presburger Arithmetic Logic

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

REGular and Context-Free Grammars

REGular and Context-Free Grammars REGular and Context-Free Grammars Nicholas Mainardi 1 Dipartimento di Elettronica e Informazione Politecnico di Milano nicholas.mainardi@polimi.it March 26, 2018 1 Partly Based on Alessandro Barenghi s

More information

Chapter Two: Finite Automata

Chapter Two: Finite Automata Chapter Two: Finite Automata In theoretical computer science, automata theory is the study of abstract machines (or more appropriately, abstract 'mathematical' machines or systems) and the computational

More information

Lecture Notes On THEORY OF COMPUTATION MODULE -1 UNIT - 2

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

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

Duality and Automata Theory

Duality and Automata Theory Duality and Automata Theory Mai Gehrke Université Paris VII and CNRS Joint work with Serge Grigorieff and Jean-Éric Pin Elements of automata theory A finite automaton a 1 2 b b a 3 a, b The states are

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

A canonical semi-deterministic transducer

A canonical semi-deterministic transducer A canonical semi-deterministic transducer Achilles A. Beros Joint work with Colin de la Higuera Laboratoire d Informatique de Nantes Atlantique, Université de Nantes September 18, 2014 The Results There

More information

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY 15-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY Chomsky Normal Form and TURING MACHINES TUESDAY Feb 4 CHOMSKY NORMAL FORM A context-free grammar is in Chomsky normal form if every rule is of the form:

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

CSE 105 Homework 1 Due: Monday October 9, Instructions. should be on each page of the submission.

CSE 105 Homework 1 Due: Monday October 9, Instructions. should be on each page of the submission. CSE 5 Homework Due: Monday October 9, 7 Instructions Upload a single file to Gradescope for each group. should be on each page of the submission. All group members names and PIDs Your assignments in this

More information

6.8 The Post Correspondence Problem

6.8 The Post Correspondence Problem 6.8. THE POST CORRESPONDENCE PROBLEM 423 6.8 The Post Correspondence Problem The Post correspondence problem (due to Emil Post) is another undecidable problem that turns out to be a very helpful tool for

More information

FLAC Context-Free Grammars

FLAC Context-Free Grammars FLAC Context-Free Grammars Klaus Sutner Carnegie Mellon Universality Fall 2017 1 Generating Languages Properties of CFLs Generation vs. Recognition 3 Turing machines can be used to check membership in

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

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

Finite Automata Theory and Formal Languages TMV026/TMV027/DIT321 Responsible: Ana Bove

Finite Automata Theory and Formal Languages TMV026/TMV027/DIT321 Responsible: Ana Bove Finite Automata Theory and Formal Languages TMV026/TMV027/DIT321 Responsible: Ana Bove Tuesday 28 of May 2013 Total: 60 points TMV027/DIT321 registration VT13 TMV026/DIT321 registration before VT13 Exam

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

{a, b, c} {a, b} {a, c} {b, c} {a}

{a, b, c} {a, b} {a, c} {b, c} {a} Section 4.3 Order Relations A binary relation is an partial order if it transitive and antisymmetric. If R is a partial order over the set S, we also say, S is a partially ordered set or S is a poset.

More information

UNIT-I. Strings, Alphabets, Language and Operations

UNIT-I. Strings, Alphabets, Language and Operations UNIT-I Strings, Alphabets, Language and Operations Strings of characters are fundamental building blocks in computer science. Alphabet is defined as a non empty finite set or nonempty set of symbols. The

More information

UNIT II REGULAR LANGUAGES

UNIT II REGULAR LANGUAGES 1 UNIT II REGULAR LANGUAGES Introduction: A regular expression is a way of describing a regular language. The various operations are closure, union and concatenation. We can also find the equivalent regular

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

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

Recap DFA,NFA, DTM. Slides by Prof. Debasis Mitra, FIT.

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

10. Finite Automata and Turing Machines

10. Finite Automata and Turing Machines . Finite Automata and Turing Machines Frank Stephan March 2, 24 Introduction Alan Turing s th Birthday Alan Turing was a completely original thinker who shaped the modern world, but many people have never

More information

CSci 311, Models of Computation Chapter 4 Properties of Regular Languages

CSci 311, Models of Computation Chapter 4 Properties of Regular Languages CSci 311, Models of Computation Chapter 4 Properties of Regular Languages H. Conrad Cunningham 29 December 2015 Contents Introduction................................. 1 4.1 Closure Properties of Regular

More information

Introduction to Theory of Computing

Introduction to Theory of Computing CSCI 2670, Fall 2012 Introduction to Theory of Computing Department of Computer Science University of Georgia Athens, GA 30602 Instructor: Liming Cai www.cs.uga.edu/ cai 0 Lecture Note 3 Context-Free Languages

More information

Finite Automata Part One

Finite Automata Part One Finite Automata Part One Computability Theory What problems can we solve with a computer? What problems can we solve with a computer? What kind of computer? Computers are Messy http://www.intel.com/design/intarch/prodbref/27273.htm

More information