620 likes | 640 Views
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. 00. 01. 10. 11. 0100. 0101. 0110. 0111. 0. 1. 010. 011. . 01. Reminder.
E N D
Büchi TreeAutomata Based on “Weakly definable relations and special automata” By Michael Rabin
Reminder • The infinite tree: T={0,1}*. • The root: . • A subtree Tx={y|yT, x·y} T T01 00 01 10 11 0100 0101 0110 0111 0 1 010 011 01
Reminder • A -valued tree: • A pair (,Tx) such that : Tx. b a b b 0110 0111 0100 0101 ={a,b} b a 010 011 a 01
Reminder • A Büchi tree automaton (“automata” from now on) is defined as U=(,Q,Q0,,F). • :QP(QQ) • A run of U on a tree t=(,Tx) is a mapping r: TxQ such that: • For each yTx: (r(y0),r(y1))(r(y),(y)) • r()Q0
Definition of Acceptence • In(r|): The set of states that appear times on a path during the run r. • U accepts (,Tx) if for every path of Tx 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.
U U Q0 Q0 q0 Unique Initial State • For every definable set A, we have an automata U such that Q0={q0}, and for every (q1,q2)(q,), q0q1, q0q2.
Union and Intersection • If A,B are definable, so are AB, AB. • Proof: Standard constructions (similar to Büchi word automata). AB AB UA q0A UAUB 1 UAUB 3 q0 UB UAUB 2 q0B
Projection and Cylindrification • For a 12 tree t=(,T) and the projection p0(x,y)=x define p0(t) as the 1 tree (p0,T). • The projection of a set of trees A is p0(A)={p0(t)|tA}. • The 2 cylindrification of a set B of 1 trees is the largest set A of 12 trees such that p0(A)=B.
Projection and Cylindrification (cont.) • Theorem: Definable sets are closed under projection and cylindrification. • Proof (projection): A=T(U) with U=(12,Q,q0,,F) • U1=(1,Q,q0,’,F). • ’(q,1)= 22(q,(1,2)). • Easy to see that T(U1)=p0(A).
Projection and Cylindrification (cont.) • Theorem: Definable sets are closed under projection and cylindrification. • Proof (cylindrification): A=T(U) with U=(1,Q,q0,,F) • U1=(12,Q,q0,’,F) • ’(q,(1,2))=(q,1) for each 22. • It is easy to see that T(U1) is the 2 cylindrification of A.
Complementation Complementation • No long proofs, since we do NOT have closure for complementation.
Complementation • Let ={0,1} and B the set of all -trees (,Tx) such that for some path we have 1In(|). • We already saw that B is definable (an automaton that “guesses” and acts like the corresponding Büchi automaton on it).
Complementation (cont.) • A=BC is the set of all trees such that for every we have 1In(|). • 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)=qF and (z)=1, then there exists a tree t’A such that t’T(U) x (q) z y (q) x (q) z x (q) z y (q)
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 xunv for some n and v<u. • We get a path similar to the path xv… in the original tree.
Complementation: Building a counterexample. • Let t1=(1,T) such that 1()=1, 1(x)=0 for <x. • t2 is obtained by “pasting” t1 on all the nodes 1k0. • In general, tn is obtained by “pasting” tn-1 on the same nodes.
Complementation: Building a counterexample. • If our automata has n states, we use tn+2: • Go along the path 1k. 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,q0,,F) and . • Define D as the set of all trees such that t=(T,)D if and only if for every xt, (x)= implies (Tx,)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, yE}. • An automaton on a finite tree is U=(,Q,q0,,f) with fQ and :Q\{f}P(QQ). • 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 En of frontiers, En<En+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,q0,,f) we define B=(,QQ’,(q0,f),’,F) with: • ((s1,s1’),(s2,s2’))’((s,s’),) iff (s1,s2)(s,), (s1’,s2’)(s’,) for s’f (s1’,s2’)(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 En. • 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=(A1,…,An) – 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 K1 be the set of all (A1,…,An) such that |A1|=1. • Let K2 be the set of all (A1,…,An) such that |A1|<. • K1, K2 are representable. • Note that because of our cylindrification theorem, it suffices to consider the case n=1.
Proof For K1 • Define U1=(,{s0,s1,s2},1,s0,{s1}). • 1(s0,0)={(s0,s1),(s1,s0)} • 1(s0,1)={(s1,s1)} • 1(s1,0)={(s1,s1)} • 1(s1,1)={(s2,s2)} • 1(s2,0)={(s2,s2)} • 1(s2,1)={(s2,s2)}
Proof For K2 • Define U2=(,{s0,s1,s2},2,s0,{s1}). • 2(s0,0)={(s0,s0),(s1,s1)} • 2(s0,1)={(s0,s0),(s1,s1)} • 2(s1,0)={(s1,s1)} • 2(s1,1)={(s2,s2)} • 2(s2,0)={(s2,s2)} • 2(s2,1)={(s2,s2)}
Types • We say that A is of type (m,n,k) if A=(x1,…,xm,1,…,n,A1,…,Ak), with: • xiT • iT,|i|< • AiT • 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,QP(T)n are representable. • The following sets are also representable: • RQ • RQ • R1={(A1,…,An-1)|An:(A1,…,An)R} • R2={(A1,…,An-1)|n:(A1,…,An-1,n)R}(n finite)
Proof • RQ, RQ, R1 follow from closure properties (union, intersection, projection). • For R2 we will show two representable sets A,B such that R2=AB.
The Set A • Since n is finite, (A1,…,An-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. 1,1,1, {q3} 1,1,0, {q1,q2} 0,1,0, {q0,q2}
The Set A (cont.) • A is the set of all ‘ trees (,T) such that for every xT, U accepts Tx if it starts from one of the states in p1(x), and sees only “0” in the last coordinate. • A is representable by our “another closure result”. 1,1,1, {q3} 1,1,0, {q1,q2} U accepts this subtree if it starts from q3. 0,1,0, {q0,q2}
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)p1(x) for all x in the frontier of H. • A tree is in B if and only if there is a sequence Hn<Hn+1 of subtrees in P.
End of the Proof • It can be shown that R2=p0(AB). • 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 PP(T)n, such that for every (A1,…,An)P we have Ai={x} and xwAj. (i,j, are fixed). • Let Q be similarly defined with xwAj. • 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 xwAj).
The Main Theorem • Let F(x1,…,xm,1,…,n,A1,…,Ak) 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 “t1=t2” by “(t1t2)”. • Replace “A=B” by “x(xAxB)” • “Push in” the negations: • Replace ~(FG)by (~F~G). • Replace ~(FG) by (~F ~G). • Replace ~vF by v~F. • Replace ~vF by v~F. • Therefore, F is obtained from atomic formulas tA and ~tA by using , and finite-set quantifiers.
Proof (cont.) • The proof is by induction on the structure of F. • If F=tA then t is xw for a variable x and some w{0,1}* (for example, x10 is S0S1(x)). • Therefore, by the previous lemma, F is definable. • Same goes for F=~tA.
Proof (cont.) • The proof is by induction on the structure of F. • If F=tA then t is xw for a variable x and some w{0,1}* (for example, x10 is S0S1(x)). • Therefore, by the previous lemma, F is definable. • Same goes for F=~tA.
Proof (cont.) • If F,G are representable then so are FG and FG, because: • R(FG)=R(F)R(G) • R(FG)=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: • R1={(A1,…,An-1)|An:(A1,…,An)R} • R2={(A1,…,An-1)|n:(A1,…,An-1,n)R • Here R=R(F), R1=R(F) and R2=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 HS define R(H) as the set of all sS 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 GR(G), AND q0R(G), we are done!
Getting Down to Earth (cont.) • Define the sequence Fk inductively: • F0=F. • Fi+1=FiR(Fi). • The sequence has only finitely many elements. Set the last one as G. • T(U) if and only if q0R(G). • It remains to show how to compute R(H) for a given H.
Computing R(H) • Given H, we define a sequence Hi. • H0=. • Hi+1= Hi{q|q1,q2[(q1,q2)(q) {q1,q2}HHi]}. • 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 n3 steps. • I only see the trivial n4 steps algorithm… • When computing G we compute R(Fi) at most n times. • Thus the runtime of the algorithm is n4 steps (n5?)
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 VW, with V,W regular languages and WWW. • Müller automata is closed to unions so we only need to prove it for VW.
Müller – Büchi Equivalence for Words • 1st Goal: Show that if W is regular language with WWW then W=WW+, with W+Müller recognizable. • 2nd Goal: Show that if W is regular and L Müller recognizable then WL is Müller recognizable. • Then we’ll have: • VW=V(WW+)=(VW)W+. • VW is regular, W+ is Müller recognizable.