Algorithms for hard problems Automata and tree automata Juris Viksna, 2015.

Slides:



Advertisements
Similar presentations
4b Lexical analysis Finite Automata
Advertisements

CSC 361NFA vs. DFA1. CSC 361NFA vs. DFA2 NFAs vs. DFAs NFAs can be constructed from DFAs using transitions: Called NFA- Suppose M 1 accepts L 1, M 2 accepts.
Lecture 24 MAS 714 Hartmut Klauck
Complexity and Computability Theory I Lecture #4 Rina Zviel-Girshin Leah Epstein Winter
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 3 School of Innovation, Design and Engineering Mälardalen University 2012.
CS21 Decidability and Tractability
Finite Automata Great Theoretical Ideas In Computer Science Anupam Gupta Danny Sleator CS Fall 2010 Lecture 20Oct 28, 2010Carnegie Mellon University.
1 Introduction to Computability Theory Lecture3: Regular Expressions Prof. Amos Israeli.
Introduction to Computability Theory
Introduction to Computability Theory
Courtesy Costas Busch - RPI1 Non Deterministic Automata.
Lecture 3 Goals: Formal definition of NFA, acceptance of a string by an NFA, computation tree associated with a string. Algorithm to convert an NFA to.
1 Single Final State for NFAs and DFAs. 2 Observation Any Finite Automaton (NFA or DFA) can be converted to an equivalent NFA with a single final state.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Nondeterminism.
Lecture 3 Goals: Formal definition of NFA, acceptance of a string by an NFA, computation tree associated with a string. Algorithm to convert an NFA to.
Fall 2006Costas Busch - RPI1 Non-Deterministic Finite Automata.
CS5371 Theory of Computation Lecture 4: Automata Theory II (DFA = NFA, Regular Language)
1 Non-Deterministic Automata Regular Expressions.
Theory of Computing Lecture 22 MAS 714 Hartmut Klauck.
Fall 2004COMP 3351 Another NFA Example. Fall 2004COMP 3352 Language accepted (redundant state)
Costas Busch - LSU1 Non-Deterministic Finite Automata.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
1 Non-Deterministic Finite Automata. 2 Alphabet = Nondeterministic Finite Automaton (NFA)
Nondeterminism (Deterministic) FA required for every state q and every symbol  of the alphabet to have exactly one arrow out of q labeled . What happens.
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 language,
Regular Expressions (RE) Empty set Φ A RE denotes the empty set Empty string λ A RE denotes the set {λ} Symbol a A RE denotes the set {a} Alternation M.
1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 5 School of Innovation, Design and Engineering Mälardalen University 2012.
THEORY OF COMPUTATION 08 KLEENE’S THEOREM.
Theory of Languages and Automata
Lecture 05: Theory of Automata:08 Kleene’s Theorem and NFA.
4b 4b Lexical analysis Finite Automata. Finite Automata (FA) FA also called Finite State Machine (FSM) –Abstract model of a computing entity. –Decides.
COMP3190: Principle of Programming Languages DFA and its equivalent, scanner.
Prof. Busch - LSU1 NFAs accept the Regular Languages.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2010.
CHAPTER 1 Regular Languages
Lecture # 12. Nondeterministic Finite Automaton (NFA) Definition: An NFA is a TG with a unique start state and a property of having single letter as label.
CMSC 330: Organization of Programming Languages Theory of Regular Expressions Finite Automata.
Chapter 6 Properties of Regular Languages. 2 Regular Sets and Languages  Claim(1). The family of languages accepted by FSAs consists of precisely the.
INHERENT LIMITATIONS OF COMPUTER PROGAMS CSci 4011.
CSCI 2670 Introduction to Theory of Computing September 13.
Chapter 3 Regular Expressions, Nondeterminism, and Kleene’s Theorem Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction.
Finite Automata & Regular Languages Sipser, Chapter 1.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2007.
1 Language Recognition (11.4) Longin Jan Latecki Temple University Based on slides by Costas Busch from the courseCostas Busch
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
Conversions Regular Expression to FA FA to Regular Expression.
CSCI 2670 Introduction to Theory of Computing September 11, 2007.
Complexity and Computability Theory I Lecture #5 Rina Zviel-Girshin Leah Epstein Winter
1 Lexical Analysis Uses formalism of Regular Languages Uses formalism of Regular Languages Regular Expressions Regular Expressions Deterministic Finite.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2006.
Finite Automata A simple model of computation. 2 Finite Automata2 Outline Deterministic finite automata (DFA) –How a DFA works.
1 Section 11.2 Finite Automata Can a machine(i.e., algorithm) recognize a regular language? Yes! Deterministic Finite Automata A deterministic finite automaton.
1 Finite Automata. 2 Introductory Example An automaton that accepts all legal Pascal identifiers: Letter Digit Letter or Digit "yes" "no" 2.
1/29/02CSE460 - MSU1 Nondeterminism-NFA Section 4.1 of Martin Textbook CSE460 – Computability & Formal Language Theory Comp. Science & Engineering Michigan.
Language Recognition MSU CSE 260.
Non Deterministic Automata
Chapter 2 FINITE AUTOMATA.
REGULAR LANGUAGES AND REGULAR GRAMMARS
Non-Deterministic Finite Automata
Non-Deterministic Finite Automata
CSE322 Definition and description of finite Automata
Non Deterministic Automata
Finite Automata.
4b Lexical analysis Finite Automata
4b Lexical analysis Finite Automata
Language Recognition (12.4)
Chapter 1 Regular Language
Finite-State Machines with No Output
CSCI 2670 Introduction to Theory of Computing
Lexical Analysis Uses formalism of Regular Languages
Presentation transcript:

Algorithms for hard problems Automata and tree automata Juris Viksna, 2015

Finite deterministic automata initial state accepting state transition [Adapted from P.Drineas]

Finite deterministic automata [Adapted from P.Drineas] Finite Automaton (FA) : set of states : input alphabet : transition function  : Q×   Q : initial state : set of accepting states L(M) = set of all words accepted by M

Finite non-deterministic automata [Adapted from P.Drineas] A word is accepted by NFA, if there exists an accepting path from the initial state to a final state

Finite non-deterministic automata [Adapted from P.Drineas] Set of states, i.e. Input aplhabet, i.e. Transition function  : Q×(   P(Q) Initial state Accepting states L(M) = set of all words accepted by M

Some basic results the class of languages accepted by NFAs with  -transitions is the same as the class of languages accepted by NFAs without  -transitions the class of languages accepted by NFAs is the same as the class of languages accepted by DFAs q3q3 q1q1 q2q2 0,1 1 0,  q4q4 0,1 1 [Adapted from S.Yukita] Nondeterministic finite automaton M

Some basic results [Adapted from S.Yukita] q 010 q 000 q q 110 q 011 q 001 q 101  q Deterministic finite automaton equivalent to M

Some basic results Nondeterministic finite automaton M [Adapted from R.Downey, M.Fellows]

Some basic results Corresponding deterministic finite automaton M [Adapted from R.Downey, M.Fellows]

Some basic results NDF with transitions [Adapted from R.Downey, M.Fellows]

Some basic results Corresponding NDF without transitions [Adapted from R.Downey, M.Fellows]

Regular expressions [Adapted from R.Downey, M.Fellows]

Regular languages [Adapted from R.Downey, M.Fellows]

Regular languages = languages accepted by DFA/NFA [Adapted from R.Downey, M.Fellows]

Regular languages = languages accepted by DFA/NFA [Adapted from R.Downey, M.Fellows]

Regular languages = languages accepted by DFA/NFA [Adapted from R.Downey, M.Fellows]

Regular languages = languages accepted by DFA/NFA [Adapted from R.Downey, M.Fellows]

Congruences [Adapted from R.Downey, M.Fellows]

Myhill-Nerode theorem [Adapted from R.Downey, M.Fellows]

Myhill-Nerode theorem [Adapted from R.Downey, M.Fellows]

Myhill-Nerode theorem [Adapted from R.Downey, M.Fellows]

Myhill-Nerode theorem [Adapted from R.Downey, M.Fellows]

Myhill-Nerode theorem [Adapted from R.Downey, M.Fellows]

Myhill’s congruence [Adapted from R.Downey, M.Fellows]

Myhill’s congruence Proof.  L has f.i.   L has f.i. Obvious (from definitions)  L has f.i.   L has f.i. ??? Assume the contrary. Then there are infinite number of  L equivalence classes x 1,x 2,x 3,... Consider all pairs u,v that can be used to show nonequivalence of x i and x j for some i  j by considering ux i v and ux j v. If there is finite number of choices of u in such pairs then there will be u for which we will have an infinite number of  L equivalences classes in form ux i. Otherwise u 1,u 2,u 3,... will form an infinite set of  L equivalences classes.

Pumping Lemma [Adapted from R.Downey, M.Fellows]

Myhill’s congruence [Adapted from R.Downey, M.Fellows]

Construction of automata [Adapted from R.Downey, M.Fellows]

Construction of automata [Adapted from R.Downey, M.Fellows]

Construction of automata [Adapted from R.Downey, M.Fellows]

State minimization [Adapted from R.Downey, M.Fellows]

State minimization [Adapted from R.Downey, M.Fellows]

State minimization - example [Adapted from R.Downey, M.Fellows]

Regular grammars A right regular grammar is a formal grammar (N, Σ, P, S) such that all the production rules in P are of one of the following forms: A → a - where A is a non-terminal in N and a is a terminal in Σ A → aB - where A and B are in N and a is in Σ A → ε - where A is in N and ε denotes the empty string, i.e. the string of length 0. In a left regular grammar all rules obey the forms: A → a - where A is a non-terminal in N and a is a terminal in Σ A → Ba - where A and B are in N and a is in Σ A → ε - where A is in N and ε is the empty string. Both right and left grammars generate regular languages

Automata and parameterized algorithms [Adapted from J.Flum,M.Grohe]

Tree automata [Adapted from R.Downey, M.Fellows]

Tree automata [Adapted from R.Downey, M.Fellows]

Tree automata [Adapted from R.Downey, M.Fellows]

Tree automata [Adapted from R.Downey, M.Fellows]

Tree automata [Adapted from R.Downey, M.Fellows]

Tree automata [Adapted from R.Downey, M.Fellows]

Tree grammars [Adapted from R.Downey, M.Fellows]

Tree grammars [Adapted from R.Downey, M.Fellows]

Tree grammars - example [Adapted from R.Downey, M.Fellows]

Tree grammars - example [Adapted from R.Downey, M.Fellows]

Normalized tree grammars [Adapted from R.Downey, M.Fellows]

Normalized tree grammars [Adapted from R.Downey, M.Fellows]

Kleene’s theorem for trees [Adapted from R.Downey, M.Fellows]

Kleene’s theorem for trees [Adapted from R.Downey, M.Fellows]

Regular tree expressions [Adapted from R.Downey, M.Fellows]

Regular tree expressions [Adapted from R.Downey, M.Fellows] X  Y is still forgotten

Regular tree expressions [Adapted from R.Downey, M.Fellows]

Kleene’s theorem for trees (II) [Adapted from R.Downey, M.Fellows]

Kleene’s theorem for trees (II) Unfortunately the definition of M(V,j,k) is never clearly explained... The current best guess is that M( ,j,k) refers to RE for reaching state j when processing trees with leaves labelled from . For V  Q the labels are correspondingly from the set V . The final RE is union of all M( ,j,n+1) for j  F. Initial M( ,j,0) is union of RE of both type a  and type a 1  a...  a a s. M(V,j,0) additionally allows for q i instead of a i. [Adapted from R.Downey, M.Fellows]

Kleene’s theorem for trees (II) [Adapted from R.Downey, M.Fellows]

Equivalence relation for tree languages [Adapted from R.Downey, M.Fellows]

Trees - Myhill-Nerode theorem [Adapted from R.Downey, M.Fellows]

Trees - Myhill-Nerode theorem [Adapted from R.Downey, M.Fellows]

Trees - Myhill-Nerode theorem [Adapted from R.Downey, M.Fellows]