Advanced Automata Theory 7 Automatic Functions

Similar documents
Advanced Automata Theory 2 Finite Automata

Advanced Automata Theory 10 Transducers and Rational Relations

Advanced Automata Theory 9 Automatic Structures in General

Theory of Computation 3 Deterministic Finite Automata

Advanced Automata Theory 11 Regular Languages and Learning Theory

Theory of Computation 4 Non-Deterministic Finite Automata

Theory of Computation 1 Sets and Regular Expressions

CS4232 Theory of Computation

Theory of Computation 8 Deterministic Membership Testing

Automata: a short introduction

Chapter 3. Regular grammars

PS2 - Comments. University of Virginia - cs3102: Theory of Computation Spring 2010

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

CPSC 421: Tutorial #1

Büchi Automata and their closure properties. - Ajith S and Ankit Kumar

CISC 4090: Theory of Computation Chapter 1 Regular Languages. Section 1.1: Finite Automata. What is a computer? Finite automata

ω-automata Automata that accept (or reject) words of infinite length. Languages of infinite words appear:

Uncountable Automatic Classes and Learning

CS5236 Advanced Automata Theory

Chapter 0 Introduction. Fourth Academic Year/ Elective Course Electrical Engineering Department College of Engineering University of Salahaddin

3515ICT: Theory of Computation. Regular languages

What we have done so far

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

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

Logic and Automata I. Wolfgang Thomas. EATCS School, Telc, July 2014

Part I: Definitions and Properties

Theory of Computation (II) Yijia Chen Fudan University

Sri vidya college of engineering and technology

DM17. Beregnelighed. Jacob Aae Mikkelsen

Theory of Computation 7 Normalforms and Algorithms

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

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

Closure Properties of Regular Languages. Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism, Inverse Homomorphism

Automata, Logic and Games: Theory and Application

Theory of Computation

CS 455/555: Finite automata

V Honors Theory of Computation

Languages, regular languages, finite automata

Automata-based Verification - III

CS256/Spring 2008 Lecture #11 Zohar Manna. Beyond Temporal Logics

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

Büchi Automata and Their Determinization

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

(Refer Slide Time: 0:21)

Automata-based Verification - III

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET

AUTOMATIC FUNCTIONS, LINEAR TIME AND LEARNING

Computational Models - Lecture 4

Notes on Pumping Lemma

Computational Models - Lecture 3

Computer Sciences Department

Formal Languages, Automata and Models of Computation

CS 154. Finite Automata, Nondeterminism, Regular Expressions

Theory Bridge Exam Example Questions

CS5371 Theory of Computation. Lecture 5: Automata Theory III (Non-regular Language, Pumping Lemma, Regular Expression)

Decision Problems with TM s. Lecture 31: Halting Problem. Universe of discourse. Semi-decidable. Look at following sets: CSCI 81 Spring, 2012

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

Griffith University 3130CIT Theory of Computation (Based on slides by Harald Søndergaard of The University of Melbourne) Turing Machines 9-0

Compilers. Lexical analysis. Yannis Smaragdakis, U. Athens (original slides by Sam

COMP4141 Theory of Computation

Theory of Computation

Introduction to Languages and Computation

Before we show how languages can be proven not regular, first, how would we show a language is regular?

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

3130CIT Theory of Computation

CS 341 Homework 16 Languages that Are and Are Not Context-Free

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

CS481F01 Prelim 2 Solutions

10. The GNFA method is used to show that

Undecidability COMS Ashley Montanaro 4 April Department of Computer Science, University of Bristol Bristol, UK

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

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Further discussion of Turing machines

Clarifications from last time. This Lecture. Last Lecture. CMSC 330: Organization of Programming Languages. Finite Automata.

Computational Models - Lecture 3 1

Fundamentele Informatica II

CISC4090: Theory of Computation

CS5371 Theory of Computation. Lecture 14: Computability V (Prove by Reduction)

Nondeterministic Finite Automata

Computational Models: Class 3

ACS2: Decidability Decidability

arxiv: v2 [cs.fl] 29 Nov 2013

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

Name: Student ID: Instructions:

MA/CSSE 474 Theory of Computation

Non-emptiness Testing for TMs

Equivalence of DFAs and NFAs

The Pumping Lemma. for all n 0, u 1 v n u 2 L (i.e. u 1 u 2 L, u 1 vu 2 L [but we knew that anyway], u 1 vvu 2 L, u 1 vvvu 2 L, etc.

UNIT-III REGULAR LANGUAGES

Pushdown Automata. Notes on Automata and Theory of Computation. Chia-Ping Chen

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

Finite Automata Part Two

Proofs, Strings, and Finite Automata. CS154 Chris Pollett Feb 5, 2007.

Turing Machines Part III

Proving languages to be nonregular

Definition: A binary relation R from a set A to a set B is a subset R A B. Example:

6.1 The Pumping Lemma for CFLs 6.2 Intersections and Complements of CFLs

Foundations of Informatics: a Bridging Course

Lecture 23 : Nondeterministic Finite Automata DRAFT Connection between Regular Expressions and Finite Automata

Lecture 17: Language Recognition

Transcription:

Advanced Automata Theory 7 Automatic Functions Frank Stephan Department of Computer Science Department of Mathematics National University of Singapore fstephan@comp.nus.edu.sg Advanced Automata Theory 7 Automatic Functions p.

Repetition Automaton QΣδsF) with QΣδsF being defined as a usual non-deterministic automaton but a different semantic for dealing with infinite words. Given an infinite word b b b 2... Σ ω a run is a sequence q q q 2... Q ω of states such that q = s and q k b k q k+ ) δ for all k. Let U = {p Q : k[q k = p]} be the set of infinitely often visited states on this run. The run is accepting iff U F. The Büchi automaton accepts an ω-word iff it has an accepting run on this ω-word otherwise it rejects the ω-word. Advanced Automata Theory 7 Automatic Functions p. 2

Repetition 2 The following deterministic Büchi automaton accepts all ω-words of reals between and which are not almost always 9. 9 2345678 9 start s 2345678 t Here a Büchi automaton is called deterministic iff for every p Q and a Σ there is at most one q Q with paq) δ; in this case one also writes δpa) = q. This automaton goes infinitely often through the accepting state t iff there is infinitely often one of the digits 2 3 4 5 6 7 8 and therefore the word is not of the form w9 ω. Advanced Automata Theory 7 Automatic Functions p. 3

Repetition 3 Theorem [Büchi 96] The following are equvivalent for a language L of ω-words: a) L is recognised by a non-deterministic Büchi automaton; b) L = m {...n} A m B ω m for some n and 2n regular languages A B...A n B n. Here B ω m is the concatenation of infinitely many non-empty strings from B m. Theorem [Büchi 96] There are ω-languages which are only recognised by a non-deterministic Büchi automaton but not by a deterministic one; for example {} {} ω. Advanced Automata Theory 7 Automatic Functions p. 4

Repetition 4 Theorem [McNaughton 966 Safra 988] The following conditions are equivalent for an ω-language L. a) L is recognised by a non-deterministic Büchi automaton; b) L is recognised by a deterministic Muller automaton; c) L is recognised by a non-deterministic Muller automaton. Application If a language L is recognised by a non-deterministic Büchi automaton so is its complement. There is an algorithm which constructs from a Büchi automaton for L a Büchi automaton for its complement. The number of states grows exponentially. Advanced Automata Theory 7 Automatic Functions p. 5

Automatic Relations and Functions Lexicographical Order a a 2...a n < lex b b 2...b m iff either the first string is a proper prefix of the second or there is a k with k n k m a k < b k a h = b h for all h with h < k. NUH < lex NUHS < lex NUS < lex SOC. Algorithm Processing inputs xy symbol by symbol.. If x is exhausted and y not then x < lex y Halt. 2. If y is exhausted and x not then y < lex x Halt. 3. If x and y are exhausted then x = y Halt. 4. Read symbol a from x and b from y. 5. If a = b then go to. 6. If a < b then x < lex y else y < lex x. Halt. Advanced Automata Theory 7 Automatic Functions p. 6

More Formally Use special symbol # to be returned from exhausted inputs. Relation R X Y is automatic iff there is an automaton reading both inputs at the same speed one symbol per cycle) such that xy) R iff the automaton is in an accepting state after having read both x and y completely. Similarly one can define that a relation of several parameters is automatic. A function f : X Y is automatic iff the relation {xy) : x domf) y = fx)} is automatic. Advanced Automata Theory 7 Automatic Functions p. 7

Convolution Relations can be translated into singular sets using convolution. Convolution has combined characters of matching positions in the words with # used for exhausted words # is not in the alphabet). conv 23456789) = ) ) ) ) ) # ) # ) # ) # ) # 2 3 4 5 6 7 8 9 ). Now one can formalise automaticity of a relation using a convolution. For example a ternary relation R of words over Σ is automatic iff the set {convx y z) : x y z) R} is regular. Advanced Automata Theory 7 Automatic Functions p. 8

Example Let Σ = {}. Then {convxy) : xy Σ x = y } is the set { } or more general Σ Σ). Quiz Which relations are coded by the sets { ) } { # # ) } and { ) } { # # } { # # }? Advanced Automata Theory 7 Automatic Functions p. 9

Automaton comparing string length ) # ) # # ) # start s r ) ) ) ) # ) # # ) # Automaton processes strings correctly when it is the convolution of two binary strings. Advanced Automata Theory 7 Automatic Functions p.

Lexicographic Order as AR For binary alphabet {} the following automaton recognises lexicographic ordering. ) start x = y ) # ) # x < y a b) x > y ) ) # #) a b) Here a b) on an arrow means that the automaton always goes this way. Advanced Automata Theory 7 Automatic Functions p.

Automatic Functions An automatic relation R X Y defines a function f iff x y[fx) = y xy) R]. ) } # For example fx) = x has the graph { #. Quiz. Consider the following expressions: { ) } { } { # # ) } { #) #) } ) { ) } {ε} { 2 #) } { #) #) 2 #) } ) { 2... 9 }. Which of these three relations define functions? What are the domains and ranges of these functions? Advanced Automata Theory 7 Automatic Functions p. 2

Exercise 7.6 Which of the following relations are automatic where x k is the k-th symbol of x = x x 2...x n and x = n): R xyz) k {2...min{ x y z }}[x k = y k x k = z k y k = z k ]; R 2 xyz) x + y = z ; R 3 xz) y[ x + y = z ]; R 4 xyz) k {2...min{ x y z }}[x k = y k = z k ]; R 5 xyz) ijk[x i = y j = z k ]; R 6 xy) y = 2 x 2. Give a short explanations why certain relations are automatic or not; it is not needed to construct the corresponding automata by explicit tables or diagrammes. Advanced Automata Theory 7 Automatic Functions p. 3

Theorem 7.7 Theorem If a relation or function is first-order definable from automatic parameters then it is automatic. Example Length-lexicographic ordering: x < ll y x < y x = y x < lex y). Length-lexicographic successor: y = Succx) x < ll y z[z < ll x z = x z = y y < ll z]. Range R of a function f with domain D: y R x[x D y = fx)]. Advanced Automata Theory 7 Automatic Functions p. 4

Exercise 7.9: Automatic Family A family L e of sets with a regular index set I is automatic iff {convex) : x L e } is a regular set. The set D = {x : e I[x L e ]} is regular. Show that the following relations are also automatic. {ij) I I : L i = L j }; {ij) I I : L i L j }; {ij) I I : L i L j = }; {ij) I I : L i L j is infinite}. Show this by showing that the corresponding relations are first-order definable from given automatic relations. You can use for the fourth the length-lexicographic order in the first-order definition. Advanced Automata Theory 7 Automatic Functions p. 5

Example 7. Let NΣPS) be a grammar and R = {xy) N Σ) N Σ) : x y} be the set of all pairs of words where y can be derived from x in one step. The relation R is automatic. Furthermore for each fixed n the relation {xy) : z z...z n [x = z y = z n z z z z 2... z n z n ]} of all pairs of words such that y can be derived from x in exactly n steps is automatic. Similarly the relation of all xy) such that y can be derived from x in at most n steps is automatic. Advanced Automata Theory 7 Automatic Functions p. 6

Remark 7. The relation is usually not automatic for a non-regular grammar even if the language generated is regular. The grammar {S}{ 2}{S SS 2} S) generating all non-empty words over {2}. Consider a derivation S S m 2S k m 2 n. If would be automatic then also the set R = {convs m 2S k m 2 n ) : k > m > n > }. Use pumping lemma and choose n = h+4 m = h k = h+4 for h much larger than the pumping constant. Then for every r the string ) h # h+4 2) ) h c d 2 ) S ) # S ) ) ) c ) dr is in R where c d > and h c d are some parameters. For the given r the substring h+r d 2 becomes h 2 in the derivation impossible for r. Advanced Automata Theory 7 Automatic Functions p. 7

Derivarability in Regular Grammars However the relation is regular grammar NΣPS) in the case that the grammar used is regular. For every AB N let L AB = {w Σ : A wb} and L A = {w Σ : A w}. All sets L A and L AB are regular. Note that the concatenation of regular languages is regular. Now {convxy) : x y} is the union of all sets {convvavwb) : v Σ w L AB } and {convvavw) : v Σ w L A } with AB N; this union is a regular set. Advanced Automata Theory 7 Automatic Functions p. 8

Exercise 7.2 Exercise Let R be an automatic relation over Σ Γ such that whenever v w) R then v w and let L be the set of all words x Σ for which there exists a sequence y y...y m Γ with y = ε y k y k+ ) R for all k < m and y m x) R. Note that ε L iff εε) R. Show that L is context-sensitive. Comment The converse direction is also true as one could take a grammar for L {ε} where each rule v w satisfies v w and either vw N + or v = w v N + w Σ +. Then xy) R if either xy N + x y or x N + y Σ + x y by rules making non-terminals to terminals) or x y) = ε ε) ε L. Advanced Automata Theory 7 Automatic Functions p. 9

Context-Sensitive Languages Theorem [Immerman and Szelepcsényi 987] The complement of a context-sensitive language is context-sensitive. Representation of Σ L The complent of L will be represented by an automatic relation R such that vw) R v w and x L iff l d d...d l [d = ε d d ) R d d 2 ) R... d l d l ) R d l x) R]. Proof-Method: Nondeterministic Counting If i strings can be derived in l steps then one can non-deterministically check which string y can be derived in i+ steps and count their number j. Advanced Automata Theory 7 Automatic Functions p. 2

Basic Algorithm. For any x Σ try to verify x / L as follows; 2. Let u be the length-lexicographically largest string in N Σ) x ; 3. Let i = Succ ll ε); 4. For l = ε to u Do Begin 5. Let j = ε; 6. For all y ll u Do Begin 7. Derive words w w 2...w i non-deterministically in length-lexicographic order in up to l steps each and check: 8. If some w m satisfies w m y or w m = y then let j = Succ ll j); 9. If some w m satisfies w m = x or w m x then abort computation as x L); End of For-Loop 6);. Let i = j; let j = ε; End of For-Loop 4);. If the algorithm has not been aborted then x / L. Advanced Automata Theory 7 Automatic Functions p. 2

Refined Algorithm I : Choose an x Σ + and initial all other variables as ε; 2: Let u = max ll N Σ)) x ; 3: Let i = Succ ll ε) and l = ε; 4: While l < ll u Do Begin 5: Let j = ε; 6: Let y = ε; 7: While y < ll u Do Begin 8: Let y = Succ ll y); 9: h = ε and w = ε; : While h < ll i Do Begin : Nondeterministically replace w by w with w < ll w ll u; 2: Let v = S; 3: Let k = ε; Advanced Automata Theory 7 Automatic Functions p. 22

Refined Algorithm II 4: While v w) k < ll l) Do Begin 5: Nondeterministically replace kv) by k v ) with k < ll k and v v End of While in 4); 6: If v w Then abort the computation; 7: If w = x or w x Then abort the computation; 8: If w y and w y 9: Then Let h = Succ ll h) 2: Else Let h = i 2: End of While in ; 22: If w = y or w y Then j = Succ ll j) 23: End of While in 7); 24: Let i = j; 25: Let l = Succ ll l) End of While in 4); 26: If the algorithm has not yet aborted Then generate x; Advanced Automata Theory 7 Automatic Functions p. 23

Exercise 7.4 Algorithm Generate all nonempty strings which do not have as length a power of 2.. Guess x Σ + ; Let y = ; 2. If x = y then abort; 3. Let z = y; 4. If x = y then generate x and halt; 5. Remove last in z; 6. Let y = y; 7. If z = ε then goto 2 else goto 4. Make an R using the subset of Γ consisting of convline x y z). R should have rules mapping ε to possible outcomes of line before line 2) updates from line to line and final moves producing the output from line 4. Advanced Automata Theory 7 Automatic Functions p. 24