Büchi Tree Automata Based on “Weakly definable relations and special automata” By Michael Rabin.

Slides:



Advertisements
Similar presentations
Theory of Computation CS3102 – Spring 2014 A tale of computers, math, problem solving, life, love and tragic death Nathan Brunelle Department of Computer.
Advertisements

Chapter 5 Pushdown Automata
Deterministic Finite Automata (DFA)
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 3 School of Innovation, Design and Engineering Mälardalen University 2012.
Pushdown Automata Chapter 12. Recognizing Context-Free Languages We need a device similar to an FSM except that it needs more power. The insight: Precisely.
Determinization of Büchi Automata
FORMAL LANGUAGES, AUTOMATA, AND COMPUTABILITY
Tirgul 8 Graph algorithms: Strongly connected components.
Introduction to Computability Theory
1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
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 Lecture2: Non Deterministic Finite Automata Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture11: Variants of Turing Machines Prof. Amos Israeli.
Introduction to Computability Theory
1 Introduction to Computability Theory Lecture7: PushDown Automata (Part 1) Prof. Amos Israeli.
1 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY (For next time: Read Chapter 1.3 of the book)
61 Nondeterminism and Nodeterministic Automata. 62 The computational machine models that we learned in the class are deterministic in the sense that the.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Regular.
Validating Streaming XML Documents Luc Segoufin & Victor Vianu Presented by Harel Paz.
CHAPTER 4 Decidability Contents Decidable Languages
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Nondeterminism.
CS5371 Theory of Computation Lecture 4: Automata Theory II (DFA = NFA, Regular Language)
FSA Lecture 1 Finite State Machines. Creating a Automaton  Given a language L over an alphabet , design a deterministic finite automaton (DFA) M such.
1 Regular Languages Finite Automata eg. Supermarket automatic door: exit or entrance.
CS5371 Theory of Computation Lecture 8: Automata Theory VI (PDA, PDA = CFG)
Theory of Computing Lecture 22 MAS 714 Hartmut Klauck.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
Great Theoretical Ideas in Computer Science.
Regular Model Checking Ahmed Bouajjani,Benget Jonsson, Marcus Nillson and Tayssir Touili Moran Ben Tulila
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,
1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 5 School of Innovation, Design and Engineering Mälardalen University 2012.
Basics of automata theory
DECIDABILITY OF PRESBURGER ARITHMETIC USING FINITE AUTOMATA Presented by : Shubha Jain Reference : Paper by Alexandre Boudet and Hubert Comon.
Theory of Computation, Feodor F. Dragan, Kent State University 1 Regular expressions: definition An algebraic equivalent to finite automata. We can build.
Introduction to CS Theory Lecture 3 – Regular Languages Piotr Faliszewski
Pushdown Automata (PDAs)
Automating Construction of Lexers. Example in javacc TOKEN: { ( | | "_")* > | ( )* > | } SKIP: { " " | "\n" | "\t" } --> get automatically generated code.
Great Theoretical Ideas in Computer Science.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2010.
CHAPTER 1 Regular Languages
Closure Properties Lemma: Let A 1 and A 2 be two CF languages, then the union A 1  A 2 is context free as well. Proof: Assume that the two grammars are.
CS 203: Introduction to Formal Languages and Automata
Chapter 3 Regular Expressions, Nondeterminism, and Kleene’s Theorem Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction.
Deterministic Finite Automata COMPSCI 102 Lecture 2.
An Introduction to Rabin Automata Presented By: Tamar Aizikowitz Spring 2007 Automata Seminar.
Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1 Chapter 1 Regular Languages Some slides are in courtesy.
Modeling Computation: Finite State Machines without Output
Chapter 8 Properties of Context-free Languages These class notes are based on material from our textbook, An Introduction to Formal Languages and Automata,
Transparency No. 4-1 Formal Language and Automata Theory Chapter 4 Patterns, Regular Expressions and Finite Automata (include lecture 7,8,9) Transparency.
Great Theoretical Ideas in Computer Science for Some.
Overview of Previous Lesson(s) Over View  A token is a pair consisting of a token name and an optional attribute value.  A pattern is a description.
Algorithms for hard problems Automata and tree automata Juris Viksna, 2015.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen Department of Computer Science University of Texas-Pan American.
Chapter 5 Finite Automata Finite State Automata n Capable of recognizing numerous symbol patterns, the class of regular languages n Suitable for.
Finite Automata Great Theoretical Ideas In Computer Science Victor Adamchik Danny Sleator CS Spring 2010 Lecture 20Mar 30, 2010Carnegie Mellon.
FORMAL LANGUAGES, AUTOMATA, AND COMPUTABILITY
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
Regular Languages Chapter 1 Giorgi Japaridze Theory of Computability.
Complexity and Computability Theory I Lecture #5 Rina Zviel-Girshin Leah Epstein Winter
Pushdown Automata Chapter 12. Recognizing Context-Free Languages Two notions of recognition: (1) Say yes or no, just like with FSMs (2) Say yes or no,
Lecture #5 Advanced Computation Theory Finite Automata.
Context-Free and Noncontext-Free Languages Chapter 13.
PROPERTIES OF REGULAR LANGUAGES
PDAs Accept Context-Free Languages
Complexity and Computability Theory I
Hierarchy of languages
Lecture3 DFA vs. NFA, properties of RL
Alternating tree Automata and Parity games
Non-Deterministic Finite Automata
Instructor: Aaron Roth
Presentation transcript:

Büchi Tree Automata Based on “Weakly definable relations and special automata” By Michael Rabin

Reminder The infinite tree: T={0,1}*. The root: . A subtree T x ={y|y  T, x · y}  T T 01

Reminder A  -valued tree: A pair ( ,T x ) such that  : T x .  ={a,b} ba babb a

Reminder A Büchi tree automaton (“automata” from now on) is defined as  U=( ,Q,Q 0, ,F).  :Q  P(Q  Q) A run of U on a tree t=( ,T x ) is a mapping r: T x  Q such that:  For each y  T x : (r(y0),r(y1))  (r(y),  (y))  r(  )  Q 0

Definition of Acceptence In(r|  ): The set of states that appear  times on a path  during the run r. U accepts ( ,T x ) if for every path  of T x we have In(r|  )  F  (Büchi condition). T(U) is the set of trees accepted by U. A set B of trees is definable if there exists U such that T(U)=B.

Unique Initial State For every definable set A, we have an automata U such that Q 0 ={q 0 }, and for every (q 1,q 2 )  (q,  ), q 0  q 1, q 0  q 2. Q0Q0 U q0q0 Q0Q0 U

Union and Intersection If A,B are definable, so are A  B, A  B. Proof: Standard constructions (similar to Büchi word automata). UAUA UBUB q0q0 q 0A q 0B ABAB ABAB UAUB 1UAUB 1 UAUB 2UAUB 2 UAUB 3UAUB 3

Projection and Cylindrification For a  1  2 tree t=( ,T) and the projection p 0 (x,y)=x define p 0 (t) as the  1 tree (p 0 ,T). The projection of a set of trees A is p 0 (A)={p 0 (t)|t  A}. The  2 cylindrification of a set B of  1 trees is the largest set A of  1  2 trees such that p 0 (A)=B.

Projection and Cylindrification (cont.) Theorem: Definable sets are closed under projection and cylindrification. Proof (projection): A=T(U) with U=(  1  2,Q,q 0, ,F) U 1 =(  1,Q,q 0,  ’,F).  ’(q,  1 )=   2  2  (q,(  1,  2 )). Easy to see that T(U 1 )=p 0 (A).

Projection and Cylindrification (cont.) Theorem: Definable sets are closed under projection and cylindrification. Proof (cylindrification): A=T(U) with U=(  1,Q,q 0, ,F) U 1 =(  1  2,Q,q 0,  ’,F)  ’(q,(  1,  2 ))=  (q,  1 ) for each  2  2. It is easy to see that T(U 1 ) is the  2 cylindrification of A.

No long proofs, since we do NOT have closure for complementation. Complementation

Let  ={0,1} and B the set of all  -trees ( ,T x ) such that for some path  we have 1  In(  |  ). We already saw that B is definable (an automaton that “guesses”  and acts like the corresponding Büchi automaton on it).

Complementation (cont.) A=B C is the set of all trees such that for every  we have 1  In(  |  ). We saw that this set is not definable. Reminder: A “pumping lemma” for trees.

Complementation (cont.) “Pumping lemma”: If there exists nodes x<z<y such that r(x)=r(y)=q  F and  (z)=1, then there exists a tree t’  A such that t’  T(U) x (q)zy (q) x (q)zy (q)x (q)z

Complementation 3 Types of paths: The one path created by the pumping. Paths not touching the pumped area. Paths traversing the pumped area and then leaving (by not going towards “y”).  If y=xu then the paths leave at xu n v for some n and v<u.  We get a path similar to the path xv… in the original tree.

Complementation: Building a counterexample. Let t 1 =(  1,T) such that  1 (  )=1,  1 (x)=0 for  <x. t 2 is obtained by “pasting” t 1 on all the nodes 1 k 0. In general, t n is obtained by “pasting” t n-1 on the same nodes.

Complementation: Building a counterexample. If our automata has n states, we use t n+2 : Go along the path 1 k. When you reach an accepting state, turn left, then right again. On each turn you see a “1” right after being in the accepting state. After n+1 turns we will reach the same accepting state twice.

Another Closure Result Theorem: Let U=( ,Q,q 0, ,F) and . Define D as the set of all trees such that t=(T,  )  D if and only if for every x  t,  (x)=  implies (T x,  )  T(U) D is definable.

Proof Idea Simulate many copies of U on the tree at once. Each time  is encountered, create a new copy of U. Infinitely many copies, but only a finite number of states they can be in – hence, only a finite memory is needed.

Finite trees A finite tree is obtained by taking a frontier E in T and all the nodes {x|x · y, y  E}. An automaton on a finite tree is U=( ,Q,q 0, ,f) with f  Q and  :Q\{f}  P(Q  Q). A run is accepting if it marks all the nodes in E with f: r(Ft(E))={f}.

Finite trees - Theorem Let U be an automaton. Define B as the set of all infinite trees for which exists a sequence E n of frontiers, E n <E n+1, such that U accepts all the trees defined by those frontiers. B is definable (in the ordinary sense).

Finite trees - Theorem Proof idea: Run two copies of U on a tree from B, one avoiding f and one entering it. The copy that enters f is “stuck” afterwards, so we duplicate the other copy instead (i.e. the second copy moves to the same state as the first copy). The accepting states are those for which the second copy is in f.

Finite trees - Theorem Formally: Given U=( ,Q,q 0, ,f) we define B=( ,Q  Q’,(q 0,f),  ’,F) with:  ((s 1,s 1 ’),(s 2,s 2 ’))  ’((s,s’),  ) iff (s 1,s 2 )  (s,  ), (s 1 ’,s 2 ’)  (s’,  ) for s’  f (s 1 ’,s 2 ’)  (s,  ) for s’=f. F=S  {f}. Full proof: Technical… One side is easy, the other is a “build run by limit” method.

“Run build by limit” Finite number of possible runs on this finite subtree. Infinite number of runs accepting the finite trees defined by E n. On the finite subtree take a run appearing infinitely many times. Continue to the next finite subtree…

First step towards S2S: Defining Sets  ={0,1}  A – characteristic function of A A=(A 1,…,A n ) – tuple of subsets of T Associate a  n tree  (A) with A:  A (x)=(  A1 (x),…,  An (x)). An automaton U represents A if it accepts  (A).

Lemma Let K 1 be the set of all (A 1,…,A n ) such that |A 1 |=1. Let K 2 be the set of all (A 1,…,A n ) such that |A 1 |< . K 1, K 2 are representable. Note that because of our cylindrification theorem, it suffices to consider the case n=1.

Proof For K 1 Define U 1 =( ,{s 0,s 1,s 2 },  1,s 0,{s 1 }).  1 (s 0,0)={(s 0,s 1 ),(s 1,s 0 )}  1 (s 0,1)={(s 1,s 1 )}  1 (s 1,0)={(s 1,s 1 )}  1 (s 1,1)={(s 2,s 2 )}  1 (s 2,0)={(s 2,s 2 )}  1 (s 2,1)={(s 2,s 2 )}

Proof For K 2 Define U 2 =( ,{s 0,s 1,s 2 },  2,s 0,{s 1 }).  2 (s 0,0)={(s 0,s 0 ),(s 1,s 1 )}  2 (s 0,1)={(s 0,s 0 ),(s 1,s 1 )}  2 (s 1,0)={(s 1,s 1 )}  2 (s 1,1)={(s 2,s 2 )}  2 (s 2,0)={(s 2,s 2 )}  2 (s 2,1)={(s 2,s 2 )}

Types We say that A is of type (m,n,k) if A=(x 1,…,x m,  1,…,  n,A 1,…,A k ), with:  x i  T   i  T,|  i |<   A i  T The set K(m,n,k)={A|A of type (m,n,k)} is representable. Follows from the previous lemma and closure to intersection.

Theorem R,Q  P(T) n are representable. The following sets are also representable:  R  Q  R  Q  R 1 ={(A 1,…,A n-1 )|  A n :(A 1,…,A n )  R}  R 2 ={(A 1,…,A n-1 )|  n :(A 1,…,A n-1,  n )  R}(  n finite)

Proof R  Q, R  Q, R 1 follow from closure properties (union, intersection, projection). For R 2 we will show two representable sets A,B such that R 2 =A  B.

The Set A Since  n is finite, (A 1,…,A n-1,  n ) is represented by a valued tree whose last coordinate is 0 everywhere except for a finite subtree. Let U be the automata for R. A is defined as a set of  ‘=  n-1  (P(Q)-{  }) trees. 0,1,0, {q 0,q 2 } 1,1,1, {q 3 } 1,1,0, {q 1,q 2 }

The Set A (cont.) A is the set of all  ‘ trees ( ,T) such that for every x  T, U accepts T x if it starts from one of the states in p 1  (x), and sees only “0” in the last coordinate. A is representable by our “another closure result”. 0,1,0, {q 0,q 2 } 1,1,1, {q 3 } 1,1,0, {q 1,q 2 } U accepts this subtree if it starts from q 3.

The Set B We define B using a set P of finite trees over  ‘. A tree H is in P if for all the possible labelings of the last coordinate, there is a run r of U on H such that r(x)  p 1  (x) for all x in the frontier of H. A tree is in B if and only if there is a sequence H n <H n+1 of subtrees in P.

End of the Proof It can be shown that R 2 =p 0 (A  B). For each finite  n, B “handles” the part of the tree marked with elements of  n, and A “handles” the rest of the tree. If  n is not finite we can’t do such a “split”.

Last Lemma Before the Main Theorem w  {0,1}* and P  P(T) n, such that for every (A 1,…,A n )  P we have A i ={x} and xw  A j. (i,j, are fixed). Let Q be similarly defined with xw  A j. P and Q are representable. Proof: Trivial. Cylindrification & intersection allow us to consider only the case n=2, and the automatas are straightforward. (Guess x; check if xw  A j ).

The Main Theorem Let F(x 1,…,x m,  1,…,  n,A 1,…,A k ) be a formula of S2S involving quantifiers over individual variables and finite-set variables only. Let P the set defined by F, then P is representable.

Proof Transform F into an equivalent form: Replace “t 1 =t 2 ” by “  (t 1  t 2  )”. Replace “A=B” by “  x(x  A  x  B)” “Push in” the negations:  Replace ~(F  G) by (~F  ~G).  Replace ~(F  G) by (~F  ~G).  Replace ~  vF by  v~F.  Replace ~  vF by  v~F. Therefore, F is obtained from atomic formulas t  A and ~t  A by using ,  and finite-set quantifiers.

Proof (cont.) The proof is by induction on the structure of F. If F=t  A then t is xw for a variable x and some w  {0,1}* (for example, x10 is S 0 S 1 (x)). Therefore, by the previous lemma, F is definable. Same goes for F=~t  A.

Proof (cont.) The proof is by induction on the structure of F. If F=t  A then t is xw for a variable x and some w  {0,1}* (for example, x10 is S 0 S 1 (x)). Therefore, by the previous lemma, F is definable. Same goes for F=~t  A.

Proof (cont.) If F,G are representable then so are F  G and F  G, because: R(F  G)=R(F)  R(G) R(F  G)=R(F)  R(G) We saw earlier that union and intersections of representable sets are representable.

Proof (cont.) For  F and  F we also use the previous theorem:  R 1 ={(A 1,…,A n-1 )|  A n :(A 1,…,A n )  R}  R 2 ={(A 1,…,A n-1 )|  n :(A 1,…,A n-1,  n )  R Here R=R(F), R 1 =R(  F) and R 2 =R(  F). The proof is finished by induction.

The Emptiness Problem There is an algorithm to determine for an automaton U if T(U)= , which uses |Q| 4 computational steps. First we transform the problem to an automata on a single letter alphabet {  } by “guessing” the input tree:  ’(q)  ’(q,  )=    (q,  ). It remains to decide if U’ accepts the only possible input tree.

Some Philosophy What does it mean, to accept a tree? It means that if we’re scanning the tree with BFS, we’ll reach a frontier of accepting states. Moving on, we’ll get from this frontier to another one. And another… So there’s a subset of the accepting states which is “closed” in a sense.

Getting Down to Earth For a set H  S define R(H) as the set of all s  S such that:  There’s a finite tree E  {  } and a run on E that starts from s and finishes inside H. If we’ll have a set G of accepting states such that G  R(G), AND q 0  R(G), we are done!

Getting Down to Earth (cont.) Define the sequence F k inductively: F 0 =F. F i+1 =F i  R(F i ). The sequence has only finitely many elements. Set the last one as G. T(U)  if and only if q 0  R(G). It remains to show how to compute R(H) for a given H.

Computing R(H) Given H, we define a sequence H i. H 0 = . H i+1 = H i  {q|  q 1,q 2 [(q 1,q 2 )  (q)  {q 1,q 2 }  H  H i ]}. This sequence is also finite. It is easy to see that the last element is R(H).

Complexity Issues According to Rabin, R(H) can be computed in n 3 steps. I only see the trivial n 4 steps algorithm… When computing G we compute R(F i ) at most n times. Thus the runtime of the algorithm is n 4 steps (n 5 ?)

Müller – Büchi Equivalence for Words We show that for every Büchi recognizable language there is a corresponding Müller automata. Reminder: Büchi recognizable language is of the form of unions of V  W , with V,W regular languages and W  W  W. Müller automata is closed to unions so we only need to prove it for V  W .

Müller – Büchi Equivalence for Words 1 st Goal: Show that if W is regular language with W  W  W then W  =W  W +, with W + Müller recognizable. 2 nd Goal: Show that if W is regular and L Müller recognizable then W  L is Müller recognizable. Then we’ll have:  V  W  =V(W  W + )=(V  W)W +.  V  W is regular, W + is Müller recognizable.

1 st Goal (W regular, W  W  W) We want to define W + which is “easy” in some sense. For this we use the concept of flagpoints. Let A be deterministic finite automaton, and W=L(A). All computations on A are unique. Let  . T(q,  (a,b))=the state reached by A starting on q and reading  (a,b).

Flagpoints The position i in  is a flagpoint if there exists j<i such that:   (0,j)  W.  T(q 0,  (j,i))=T(q 0,  (0,i))  For all j<k<i, T(q 0,  (j,k))  T(q 0,  (0,k)) 0 ji  (0,j)  W

1 st Goal (Show that W  =W  W + ) For two flagpoints i 1, i 2, the corresponding j 1, j 2 are distinct (why?) So if we have an infinite number of flagpoints i 1 <i 2 <... we can assume that j 1 <i 1 <j 2 <i 2 <... So we define W + ={  |  has infinitely many flagpoints} Easy (?) to see that W +  W , so W  W +  W . W   W  W + is harder so we skip it.

1 st Goal (W + is Müller recognizable) Enough to show that W + is the set of all words with infinite number of prefixes in some regular V. Then the (finite) deterministic automata for V can “serve” as a deterministic Büchi automata for W + ; and this is easy to simulate using Müller automata.

1 st Goal (W + is Müller recognizable) In our case, V=all the words which are flagpoints of W. A (nondeterministic) automata for V: read word until reaching an accepting state, then “guess” if to continue or “split”. If splitting, the two copies must synchronize again exactly at the end – otherwise, go to a nonaccepting pit.

2 nd Goal (WL is Müller recognizable) Let A be DFA for W. Let B be Rabin automata for L. We’ll show WL is Rabin recognizable (and so, Müller recognizable). Idea: Run A on . Each time A reaches an accepting state, start a copy of B. Infinite number of copies… So we “merge” them.

Some Definitions q denotes a sequence of states. D(q) is the “contraction” of q: keeping only the first appearance of each state. If q=D(q) we say that q is a “display”. q will serve to record the current “memory” of the infinite simulations.  (q): largest i such that q(0)…q(i) is a display.

The Automata A state in the automata is (q 1, q, i) where: q 1 is the current state in the DFA A. q is the current simulation. i is the size of q. Q={(q 1, q, i)|q 1  S A, D(q)=q, i  |Q B |} The initial state: (q 0A, ,0).

The Transition Function Let (q 1, q, i) be a state. If q 1  F A :  ((q 1, q, i),  )= (  A (q 1,  ),D(  B (qq 0B,  )),  (  B (qq 0B,  ))). If q 1  F A :  ((q 1, q, i),  )= (  A (q 1,  ),D(  B (q,  )),  (  B (q,  ))).

The Accepting Pairs For every 0  k  |Q B | and accepting pair (N i,P i ) in B define: P i,k ={(q 1, q, j)|q(k)  P i } N i,k ={(q 1, q, j)|q(k)  N i or j<k}

Waving Hands Suppose  WL. Choose i=least number such that  (0,i)  W and  (i,  )  L. Let k i be the size of q in step i. No q i (t) equals q 0B, otherwise it would contradict the minimality of i. For the same reason, no run would merge with the run starting at i.

THE END