540 likes | 769 Views
Determinization of Büchi Automata. Ghila Castelnuovo Tel Aviv University. Agenda. Brief Review on Definitions: B ü chi, Muller and Rabin Automata Deterministic B ü chi Automata, Nondeterministic Automata and their unequivalence between them
E N D
Determinization of Büchi Automata GhilaCastelnuovo Tel Aviv University
Agenda • Brief Review on Definitions: • Büchi, Muller and Rabin Automata • Deterministic Büchi Automata, Nondeterministic Automata and their unequivalence between them • A bad tentative: Power-set construction on Büchi Automata. • Determinization of Büchi Automata: • Safra Construction
Definition of ω-Automaton Let Σ= {a,b,..} a finite alphabet. By Σωwe denote the set of infinite words over Σ. A ω-automaton over Σis a quintuple A = <Q, Σ, δ, qI, Acc>, where: Qis a finite set of states, Σis a finite alphabet. δ : Q×Σ → 2Q (orδ : Q×Σ → 2Q for the non-deterministic one),is the state transition function qI∈ Q is the initial state Accis the acceptance component.
BüchiAcceptance Condition An ω-automaton A = (Q, Σ, δ, qI, F) with acceptance component F ⊆ Q is called Büchi automaton if it is used with the following acceptance condition (Büchi acceptance component): A word α ∈ Σωis accepted by A iffthere exists a run ρof A on α satisfying the condition: Inf(ρ) ∩ F ≠∅.
Muller Acceptance Condition An ω-automaton A = (Q, Σ, δ, qI, F) with acceptance component F ⊆ Q is called Muller automaton if it is used with the following acceptance condition (Muller acceptance component): A word α ∈ Σωis accepted by A iffthere exists a run ρof A on α satisfying the condition: Inf(ρ) ∈ F
Rabin Acceptance Condition An ω-automaton A = (Q, Σ, δ, qI, Ω) with acceptance component Ω = {(E1, F1), . . . , (Ek, Fk)} with Ei, Fi ⊆ Q is called Rabin automaton if it is used with the following acceptance condition (Rabin acceptance component): A word α ∈ Σωis accepted by A iffthere exists a run ρof A on α satisfying the condition: ∃(E,F) Ω : (Inf(ρ) ∩ E = ∅) ∧ (Inf(ρ) ∩ F ≠ ∅).
Deterministic versus Nondeterministic Büchi Automata This automaton A accepts the language L := {α ∈ {a, b}ω | b(α) < ∞}, where b(α) denotes the number of ‘b’s occurring in word α. We saw in the first lecture that there does not exist a deterministic Automata which recognizes this language.
Deterministic versus Nondeterministic Büchi Automata From this we understand that not for all the nondeterministic Büchi Automata there exists an equivalent deterministic one.
Then, how do we determinize? We saw in the first lecture the following equivalence. • Therefore what we can do is to determinize a Büchi non deterministic Automatonto a Muller deterministic Automaton or to a Rabin deterministic Automaton
Determinization of Büchi Automata: Power Set Construction F = {{p,q}, {p,q,r}}. This automata A’ also recognizes the word (ab)ω L. The reason why the Power set Construction doesn’t work is because there if we look at the accepting run = {p} {p,q} {p,q,r} {p,q,r} {p,q,r} … in A’, we cannot extract a run of A from it, where we visit infinite times f. a a,b a,b {p,q, r} {p,q} {p} b
Determinization of Büchi Automata: Power Set Construction • The problem is due to the fact that we can’t really simulate the original run since the number of nodes in each level in the tree is unbounded. • Therefore what we do is that we approximate it and we represent each level by the states that we visited in the level. • In this way we represent much more paths than in the original tree, and especially we represent also a good path that didn’t originally exist.
Safra’s Construction By given a Büchi non deterministic AutomatonBit creates a Muller deterministic Automaton Mor a Rabin deterministic Automaton R, such that L(B) = L(M) = L(R).
How do we do that? Safra’s Trees The Construction
Safra’s Trees • Q is a fixed set of states. • A Safra Tree over Q is tree over a vocabulary V, and where each node is labeled by λ∈{2Q \ }x{‘’,‘!’} and which satisfies the following conditions: • The union of brother macrostates is a proper subset of their parent macrostate. • Brother macrostates are disjoint.
Safra’sTreesExample Q = {qI, f, g}, V={1,2,3} 1 {qI, f, g} 2 {f} 3 {g}
Safra’s Trees Lemma 1: The number of nodes in a Safra tree is bounded by |Q|. Proof: By induction on the height of Safra trees over Q. Base: If n is 0 or n is 1, then the tree is empty or only a root and then it is trivial.
Safra’s Trees • Induction’s Step: Each one of the sons of the root are Safra trees over disjoint sets Qiof states. By induction, the number of nodes in each one of the subtree is ≤ |Qi|, then the total number of nodes is ≤ ∑|Qi| + 1. By Condition 1 we also have that ∑|Qi| <|Q|, then we get that the total number ≤ |Q|
Safra’s Trees • Corollary 1: The height of a Safra trees is at most |Q|. In each level we have at least one node. • Corollary 2: Safra trees are finitely branching, and a node has at most |Q|-1 sons. Otherwise we will get more than |Q| nodes.
The Construction • B = (Q, Σ,qI, δ, F)is non-deterministic Büchi automaton. • We will create a new deterministic Muller automaton M = (Q’, Σ’,qI’, δ’, F)or a new deterministic Rabin automaton R = (Q’, Σ’,qI’, δ’, Ω) such that: • Q’ is a set of Safra trees. • qI’ is a Safra tree. • δ’: Q’ x Σ → Q’ is the states’ transition function.
The Construction - Running Example Q = {qI,f,g}, F = {f,g}
The Construction The vocabulary V = {1,2,…,2|Q|} – This is sufficient because the number of nodes is bounded by |Q| and in the intermediate states we add at most |Q| nodes. The initial state qI’is a single node labeled with macrostate {qI}. 1 {qI} qI’ =
The Construction The value of the transition function δ’(T, a)is computed as follows: Step 1: Remove all marks ‘!’ in the Safra tree T. Step 2: For every node v with macrostateM such that M ∩ F ≠∅, create a new node v ∈ (V \N), such that v becomes the youngest son of v and carries the macrostateM ∩ F. Step 3: Apply the powerset construction on every node v, i.e. replace its macrostateM by {q ∈ Q| ∃(m, a, q) ∈ Δ : m ∈ M}.
The Construction Step 4 (horizontal merge): For every node v with macrostateM and state q ∈ M, such that q also belongs to an older brother of v, remove q from M. Step 5: Remove all nodes with empty macrostates. Step 6 (vertical merge): For every node whose label is equal to the union of the labels of its sons, remove all the descendants of v and mark v with ‘!’
The Construction - Running Example Computing δ(1−{qI}, a) : Step 1: Step 2: Step 3: a Remove all marks ‘!’ in the Safra tree T. For every node v with macrostate M such that M ∩ F = ∅, create a new node v ∈ (V \N), such that v becomes the youngest son of v and carries the macrostate M ∩ F. a a 1 {qI,f} 1 {qI} 1 {qI} Apply the powerset construction on every node v, i.e. replace its macrostate M by {q ∈ Q| ∃(m, a, q) ∈ Δ : m ∈ M}. 1 {qI} 1 {qI} 1 {qI}
The Construction - Running Example Computing δ(1−{qI}, c) : Step 1: Step 2: Step 3: Remove all marks ‘!’ in the Safra tree T. For every node v with macrostate M such that M ∩ F = ∅, create a new node v ∈ (V \N), such that v becomes the youngest son of v and carries the macrostate M ∩ F. Apply the powerset construction on every node v, i.e. replace its macrostate M by {q ∈ Q| ∃(m, a, q) ∈ Δ : m ∈ M}. c c c a a a 1 {qI,f} 1 {qI,f} 1 {qI,f} 1 {qI} 1 ∅ 1 {qI} 1 {qI} 1 {qI} 1 {qI}
The Construction - Running Example Computing δ(1−{qI}, c) : Step 4: Step 5: For every node v with macrostate M and state q ∈ M, such that q also belongs to an older brother of v, remove q from M. Remove all nodes with empty macrostates. 1 {qI,f} ε c c a a 1 {qI,f} 1 {qI} 1 ∅ 1 {qI}
The Construction - Running Example Computing δ(1−{qI,f}, c) : Step 1: Step 2: Step 3: Remove all marks ‘!’ in the Safra tree T. 1 {qI,f} For every node v with macrostate M such that M ∩ F = ∅, create a new node v ∈ (V \N), such that v becomes the youngest son of v and carries the macrostate M ∩ F. c 1 {qI,f} 1 {f} 1 {qI,f} 1 {qI,f} 1 {qI,f} 2 {f} ε ε ε 2 {f} Apply the powerset construction on every node v, i.e. replace its macrostate M by {q ∈ Q| ∃(m, a, q) ∈ Δ : m ∈ M}. c c c a c a c a 1 {qI} 1 {qI} 1 {qI}
The Construction - Running Example Computing δ(1−{qI,f}, c) : Step 4: Step 5: Step 6: For every node v with macrostate M and state q ∈ M, such that q also belongs to an older brother of v, remove q from M. c 1 {f} 1 {f} Remove all nodes with empty macrostates. 1 {qI,f} 1 {qI,f} 1 {qI,f} 1 {f} ! 2 {f} ε ε ε 2 {f} For every node whose label is equal to the union of the labels of its sons, remove all the descendants of v and mark v with ‘!’ c a c a c a a c 1 {qI} 1 {qI} 1 {qI}
The Construction – Muller Automaton A Muller automatonis obtained by choosing the acceptance component as follows: A set S ⊆ Q of Safra trees is in the system F of final state sets if for some node v ∈ V the following holds: Muller 1: v appears in all Safra trees of S, and Muller 2: v is marked at least once in S.
The Construction – Rabin Automaton To obtain a Rabin automaton, one takes all pairs (Ev, Fv), v ∈ V, as acceptance component, where Rabin 1: Evconsists of all Safra trees without a node v, and Rabin 2: Fvconsists of all Safra trees with node v marked ‘!’.
Q’ consists of Safra Trees • Before proving the Algorithm’s correctness, we need to prove that we are indeed getting a Muller/Rabin Automaton. • For this, we need to prove that δ’(T, a)∈ Q’. • Step 1 -> Removing all the marks ‘!’ preserves the conditions 1 and 2.
Q’ consists of Safra Trees • Step 2 may violate Condition 1 because if M ⊆ F, then the son has the same macrostate as the father. • Step 3 (PowerSet) can violate even more: • Brothers may share a state q ∈Q’. • The new computed macrostate can be an empty set. • The Union of brothers macrostates can be equal to the father’s macrostate.
Q’ consists of Safra Trees • Step 4, Step 5, and Step 6 deal with these problems. • Step 4 ensures Condition 2 by horizontal merge of brother macrostates. • Step 5 removes nodes with empty macrostates. • By vertical merge Step 6 fixes situations where Condition 1 is violated. Thus, we finally obtain after all six steps a Safra tree.
Intuition behind Safra’s Construction The Safra’s construction uses three tricks. Trick 1: Initialize new runs of macrostates starting from recurring states. The idea behind this is to look at the paths which comes out from recurring states. This allows the construction of an accepting run of the original Automaton.
Intuition behind Safra’s Construction Trick 2: Keep track of joining runs of the nondeterministic Büchi automaton just once. Lets consider two finite runs: q1q2. . . fqi . . . qj−1qj . . . qnqn+1and q’1q’2. . . q’i−1q’i. . . f’q’j. . . q’nqn+1 As we converge at the end into the same state, and we visited a recurring states in both the runs, then we don’t actually care which one of the recurring states states we visited when we get to qn+1, then we can merge the macrostates into one.
Intuition behind Safra’s Construction Trick 3: If all states in a macrostate have a recurring state as predecessor, delete the corresponding components. If there is some node where the union of all its sons’smacrostate is equal to its macrostate, it means that all the states in the macrostate have a recurring state as predecessor, which means that in the original run, each time before that we get to any of the states in the macrostate we must visit a recurring state.
Algorithm’s Correctness Let B = (Q, Σ, qI, δ, F) be a nondeterministic Büchi automaton. Let M = (Q’, Σ, qI’, δ’, F’) be the deterministic Muller and R = (Q’, Σ, qI’, δ’, Ω) be the deterministic Rabin automaton obtained by Safra’s construction. Then L(B) = L(M) = L(R).
Part 1 - Completeness • We need to prove that L(B) ⊆ L(M) and L(B) ⊆ L(R). • Let α∈ L(B), we need to prove that α∈L(M) and α∈L(R); the initial state and the run ρ’ are the same on both the Automata. • We will first prove there exists some node v in the tree of run ρ’ such that • Claim 1: v – from a certain point on – is a node of all Safra trees in ρ’and • Claim 2: v is marked ‘!’ infinitely often.
Part 1 – Completeness for Muller • If the claims hold then: • Inf(ρ’) ∈F. • Indeed the Muller Conditions hold for v. • Condition 1: It holds because a Safra tree of ρ’ not including v is not in Inf(ρ’) – because of Claim 1. • v is marked ‘!’ infinitely often in ρ’ and Q’ is a finite set, therefore there exists some Safra tree in Inf(ρ’) with withv marked ‘!’. • Therefore ρ’ is an accepting run for M which means that α∈L(M).
Part 1 – Completeness for Rabin • Also, if the claims hold then: The Rabin Conditions hold for v. • Inf(ρ’)∩Ev= ∅ becauseof Claim 1 • Inf(ρ’)∩Fv≠ ∅because of Claim 2 ρ’ is an accepting run of the deterministic Rabin automaton R, and we obtain α ∈ L(R).
Part 1 – Prove of the claims • We will prove that there exists such a v on which both the claims hold. • The root node respects Claim 1: • α ∈ L(B), then there exists an accepting run ρ in the nondeterministic Büchi automaton B. • Thus the root of all Safra trees occurring in the run is nonempty: the root macrostate of the i-thSafra tree in ρ’ includes ρ(i) and therefore cannot be removed in Step 5 of the Safra construction.
Part 1 – Prove of the claims • If the root is marked with ‘!’ infinitely often we are done. • Otherwise: • Since ρ is an accepting run, there exists an state q ∈ Inf(ρ) ∩ F which occurs infinitely often in the root of the Trees of ρ’. • Consider the run after the last occurrence ‘!’ on the root. • Since q ∈ F, then it will be put in the root’s youngest son macrostate. • After some finite eventual steps all the states of the run ρ will appear in some son of the root (it may be possible that it will be some older brother of this son).
Part 1 – Prove of the claims • This son is the new candidate. • It cannot be removed by step 5 because it is not empty as it will always carry the states of ρ. • It cannot be removed by step 6 because it the root will not ever be marked by ‘!’ • So it will appear in each tree of the run. • If the son is marked with ‘!’ infinitely often then we are done – otherwise we will choose again one of its sons.
Part 1 – Prove of the claims We will eventually finish because the height of the Safra tree is finite. In addition to this, since α∈L(B), it means that the last son that we visited will always carry the states of ρ and in particular its macrostate will include a recurring state infinite times, and since it is the last son it will be marked by ‘!’ infinite times.
Part 2 - Soundness Lemma 1: Let R0…P0…R1!...Ri!a subrun of ρ’, such that Fi = Pi ∩F. Then for all r ∈Ri, there exists some p ∈R0, such that in Bmoves with input u1v1 … uivi from p to r and it visits the recurring states at least i times.
Part 2 - Soundness Lemma 1: Let R0…P0…R1!...Ri!a subrun of ρ’, such that Fi = Pi ∩F. Then for all r ∈Ri, there exists some p ∈R0, such that in Bmoves with input u1v1 … uivi from p to r and it visits the recurring states at least i times.
Part 2 - Soundness Lemma 2 (König’s Lemma): A finitely branching infinite tree contains an infinite path. Proof: We will define the path πinductivelyas following: for each v in π, v has infinitely many children. The root fulfills this by definition. Then, there must exists a son of the root which also fulfills this, as the tree is finitely branching.
Part 2 - Soundness Lemma 3: Let R0…R1!...Ri!...as definedin Lemma 1. Then there is a successful run of B on u1v1u2v2… beginning with state R0. Proof: Lets look at the directed tree which has (qI,0) as root, and where for each node (r, i) r ∈Riand u1v1…uivileads from qIto Ri. By the lemma, we know that for each r ∈Rithere exists some r’ ∈Ri-1 such that there is a path from r’ to r which visits a recurring state from Pi. In this way we will chose the parent, among one of those states (and there is at least one).
Part 2 - Soundness The word ac(aac)ωleads to the following sequence of macrostates: S0= {qI}, S3i+1= {f}, i ≥ 0, S3i+2= {g}, i ≥ 0, and S3i+3= {f, g}, i ≥ 0.