Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "Büchi Tree Automata Based on “Weakly definable relations and special automata” By Michael Rabin."— Presentation transcript:

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

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

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

4 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

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

6 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

7 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

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

9 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).

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

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

12 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).

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

14 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

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

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

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

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

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

20 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}.

21 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).

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

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

24 “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…

25 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).

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

27 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 )}

28 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 )}

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

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

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

32 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 }

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

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

35 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”.

36 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 ).

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

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

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

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

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

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

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

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

45 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!

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

47 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).

48 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 ?)

49 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 .

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

51 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).

52 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

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

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

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

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

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

58 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).

59 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,  ))).

60 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}

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

62 THE END


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

Similar presentations


Ads by Google