büchi tree automata

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

Upload: hamilton-tanner

Post on 31-Dec-2015

54 views

Category:

Documents


0 download

DESCRIPTION

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. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Büchi Tree Automata

Büchi TreeAutomata

Based on “Weakly definable relations and special automata”

By Michael Rabin

Page 2: Büchi Tree Automata

Reminder

The infinite tree: T={0,1}*.The root: .A subtree Tx={y|yT, x·y}

0 1

00 01 10 11

010 011

0100 0101 0110 0111

01

T T01

Page 3: Büchi Tree Automata

Reminder

A -valued tree:A pair (,Tx) such that : Tx.

={a,b}b a

b a b b

a01

010 011

0100 0101 0110 0111

Page 4: Büchi Tree Automata

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

Page 5: Büchi Tree Automata

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.

Page 6: Büchi Tree Automata

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.

Q0 Uq0 Q0 U

Page 7: Büchi Tree Automata

Union and Intersection

If A,B are definable, so are AB, AB.Proof: Standard constructions (similar to

Büchi word automata).

UA

UB

q0

q0A

q0B

ABAB

UAUB 1

UAUB 2

UAUB 3

Page 8: Büchi Tree Automata

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.

Page 9: Büchi Tree Automata

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

Page 10: Büchi Tree Automata

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.

Page 11: Büchi Tree Automata

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

ComplementationComplementation

Page 12: Büchi Tree Automata

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

Page 13: Büchi Tree Automata

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.

Page 14: Büchi Tree Automata

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 y (q)x (q) z

Page 15: Büchi Tree Automata

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.

Page 16: Büchi Tree Automata

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.

Page 17: Büchi Tree Automata

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.

Page 18: Büchi Tree Automata

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.

Page 19: Büchi Tree Automata

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.

Page 20: Büchi Tree Automata

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

Page 21: Büchi Tree Automata

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

Page 22: Büchi Tree Automata

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.

Page 23: Büchi Tree Automata

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.

Page 24: Büchi Tree Automata

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

Page 25: Büchi Tree Automata

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

Page 26: Büchi Tree Automata

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.

Page 27: Büchi Tree Automata

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

Page 28: Büchi Tree Automata

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

Page 29: Büchi Tree Automata

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.

Page 30: Büchi Tree Automata

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)

Page 31: Büchi Tree Automata

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.

Page 32: Büchi Tree Automata

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.

0,1,0,{q0,q2}

1,1,1,{q3}

1,1,0,{q1,q2}

Page 33: Büchi Tree Automata

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

0,1,0,{q0,q2}

1,1,1,{q3}

1,1,0,{q1,q2}

U accepts this subtree if it starts from q3.

Page 34: Büchi Tree Automata

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.

Page 35: Büchi Tree Automata

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

Page 36: Büchi Tree Automata

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

Page 37: Büchi Tree Automata

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.

Page 38: Büchi Tree Automata

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.

Page 39: Büchi Tree Automata

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.

Page 40: Büchi Tree Automata

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.

Page 41: Büchi Tree Automata

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.

Page 42: Büchi Tree Automata

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.

Page 43: Büchi Tree Automata

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.

Page 44: Büchi Tree Automata

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.

Page 45: Büchi Tree Automata

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!

Page 46: Büchi Tree Automata

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.

Page 47: Büchi Tree Automata

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

Page 48: Büchi Tree Automata

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

Page 49: Büchi Tree Automata

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.

Page 50: Büchi Tree Automata

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.

Page 51: Büchi Tree Automata

1st Goal (W regular, WWW)

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

Page 52: Büchi Tree Automata

Flagpoints

The position i in is a flagpoint if there exists j<i such that: (0,j)W. T(q0,(j,i))=T(q0,(0,i))

For all j<k<i, T(q0,(j,k))T(q0,(0,k))

0 j i

(0,j)W

Page 53: Büchi Tree Automata

1st Goal (Show that W=WW+)

For two flagpoints i1, i2, the corresponding j1, j2 are distinct (why?)

So if we have an infinite number of flagpoints i1<i2<... we can assume that j1<i1<j2<i2<...

So we define

W+={ | has infinitely many flagpoints} Easy (?) to see that W+W, so WW+W. WWW+ is harder so we skip it.

Page 54: Büchi Tree Automata

1st 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.

Page 55: Büchi Tree Automata

1st 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.

Page 56: Büchi Tree Automata

2nd 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.

Page 57: Büchi Tree Automata

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.

Page 58: Büchi Tree Automata

The Automata

A state in the automata is (q1, q, i) where:

q1 is the current state in the DFA A.

q is the current simulation. i is the size of q. Q={(q1, q, i)|q1SA, D(q)=q, i|QB|}

The initial state: (q0A,,0).

Page 59: Büchi Tree Automata

The Transition Function

Let (q1, q, i) be a state.

If q1FA:

((q1, q, i),)=

(A(q1,),D(B(qq0B,)),(B(qq0B,))).

If q1FA:

((q1, q, i),)=

(A(q1,),D(B(q,)),(B(q,))).

Page 60: Büchi Tree Automata

The Accepting Pairs

For every 0k|QB| and accepting pair (Ni,Pi) in B define:

Pi,k={(q1, q, j)|q(k)Pi}

Ni,k={(q1, q, j)|q(k)Ni or j<k}

Page 61: Büchi Tree Automata

Waving Hands

Suppose WL. Choose i=least number such that (0,i)W

and (i,)L. Let ki be the size of q in step i.

No qi(t) equals q0B, otherwise it would contradict the minimality of i.

For the same reason, no run would merge with the run starting at i.

Page 62: Büchi Tree Automata

THEEND