You are on page 1of 34

Büchi Automata

and Their Determinization

Wolfgang Thomas

Edinburgh, October 2015


Plan of the Day

1. Büchi automata and their determinization


2. Infinite games
3. Rabin’s Tree Theorem
4. Decidability of monadic theories

Wolfgang Thomas
Plan of the Lecture

1. Preparations on MSO-logic
2. MSO-logic over finite words
3. Büchi automata and their complementation
4. Determinization

Wolfgang Thomas
MSO-Logic

Wolfgang Thomas
MSO-Logic over (N, +1, 0)
We have

first-order variables x, y, z, . . . ranging over natural


numbers
set variables X, Y, Z, . . . ranging over sets of natural
numbers
terms formed from first-order variables and 0 by
application of “+1”
atomic formulas s = t and X (t ) for terms s, t and set
variables X
connectives ¬, ∨, ∧, →, ↔ and quantifiers ∃, ∀

Wolfgang Thomas
Transitive Closure
Consider a formula ψ(z, z′ )
Write ψ∗ ( x, y) for:
“each set containing x and closed under the relation defined
by ψ(z, z′ ) contains also y”
“there is a path of ψ(z, z′ )-steps from x to y”

Let doubsucc(z, z′ ) be the formula z + 1 + 1 = z′


Then we write Even(y) for doubsucc∗ (0, y)

Similarly with succ(z, z′ ) := z + 1 = z′ :


x < y definable as succ∗ ( x + 1, y)

Wolfgang Thomas
Example

“Each set with two successive elements contains an even


number”

∀ X (∃ x( X ( x) ∧ X ( x + 1)) → ∃y( X (y) ∧ Even(y)))

Wolfgang Thomas
First Step: MSO over Finite Words

Wolfgang Thomas
Words coded by Sets

Consider w = (01)(00)(00)(11)(10)
Domain of letter positions: D = {0, 1, 2, 3, 4}
For an infinite word this domain is N.

w is identified with a pair of sets: K1 = {3, 4} , K2 = {0, 3}

A word over {0, 1}n with domain D can be identified with an


n-tuple (K1 , . . . , Kn ) of subsets of D.

Wolfgang Thomas
A Definable Language

Consider the regular language L0 over {0, 1}2


containing the words where
between any two letters (∗1 ) there is a letter (∗0 )

w = (01)(00)(00)(11)(10) satsfies this.

ϕ( X1 , X2 ) = ∀ x∀y( x < y ∧ X2 ( x) ∧ X2 (y) →


∃z ( x < z ∧ z < y ∧ ¬ X1 (z)))

Wolfgang Thomas
BET Theorem

J.R. Büchi C.C. Elgot B.A. Trakhtenbrot

Theorem of Büchi-Elgot-Trakhtenbrot (1960):


Finite automata and monadic second-order fomulas can
express the same properties of finite words.
Wolfgang Thomas
From Automata to MSO-Logic

A0 :

1
0
q0 q1 1 q2

We look for an MSO-formula ϕ “equivalent” to A0


It should express over w that A0 accepts w.

Wolfgang Thomas
1
0
q0 q1 1 q2

An input word and an accepting run:

0 0 0 1 1
           
1 0 1 0 0 0
0 1 0 1 0 0
0 0 0 0 1 1

Wolfgang Thomas
1
0
q0 q1 1 q2

ϕ( X ) :=
∃Y0 ∃Y1 ∃Y2 (Partition(Y0 , Y1 , Y2 ) ∧ Y0 (min)
∧∀ x((Y0 ( x) ∧ ¬ X ( x) ∧ Y1 ( x + 1))
∨(Y1 ( x) ∧ ¬ X ( x) ∧ Y0 ( x + 1))
∨(Y1 ( x) ∧ X ( x) ∧ Y2 ( x + 1))
∨(Y2 ( x) ∧ X ( x) ∧ Y2 ( x + 1)))
∧(Y1 (max) ∨ Y2 (max)) ∧ X (max))

Wolfgang Thomas
Preparing MSO for Easy Induction
Work with a dialect of MSO in which the first-order variables
are cancelled.
Simulate x by a singleton variable { x}.
Atomic formulas: X ⊆ Y , Sing( X ), Succ( X, Y ), X < Y .

Example
ϕ( X1 , X2 ) = ∀ x∀y( x < y ∧ X2 ( x) ∧ X2 (y) → ∃z ¬ X1 (z))
ϕ′ ( X1 , X2 ) = ∀ X ∀Y ( X < Y ∧ X ⊆ X2 ∧ Y ⊆ X2 (y) →
∃ Z (Sing( Z ) ∧ ¬ Z ⊆ X1 ))

Task: Find for any ϕ( X1 , . . . , Xn ) a corresponding automaton


over {0, 1}n .
Wolfgang Thomas
From MSO to Automata (Finite Words)
Proceed by induction on formulas.
Example: Succ( X1 , X2 )

(00) (00)

(10) (01)
q0 q1 q2

Use nondeterministic automata:


Then atomic formulas, ∨, ∃ are easy.
For complementation use the subset construction to obtain a
deterministic automaton which is easily complementable.

Wolfgang Thomas
Büchi Automata and Their
Complementation

Wolfgang Thomas
Definition
A Büchi automaton (NBA) has the form A = ( Q, Σ, q0 , ∆, F )
with

finite state-set Q, initial state q0 , set F ⊆ Q of final states,


transition relation ∆ ⊆ Q × Σ × Q

A accepts the input word α ∈ Σω if there is a run ̺ of A on α


such that ∃ω i ̺(i ) ∈ F .
L(A) := {α ∈ Σω | A accepts α}
is the ω-language recognized by A.
L is called Büchi recognizable if L = L(A) for some Büchi
automaton A.

Wolfgang Thomas
Periodicity

Given A = ( Q, Σ, q0 , ∆, F ) define
w
Wpq = {w ∈ Σ∗ | A : p → q}

Then L(A) = Wq0 q · (Wq,q )ω


S
q∈ F

An ω-language is Büchi recognizable iff it is a finite union of


ω-languages U · V ω with regular U, V ⊆ Σ∗

Consequence: A nonempty Büchi-recognizable ω-language


contains an ultimately periodic ω-word.

Wolfgang Thomas
Büchi’s Theorem

An ω-language is MSO-definable iff it is Büchi recognizable

From automata to MSO: as over finite words.


From MSO to automata: Proceed again by induction.
Only complementation is difficult.

Wolfgang Thomas
Complementation

Wolfgang Thomas
Büchi-Equivalence
Idea: Represent also the complement-ω-language as a finite
union of sets U · V ω with regular U, V .
As U, V use equivalence classes of an equivalence relation:
u v
u ∼A v :⇔ A : p → q ⇔ A : p → q
u v
and A : p → q via F ⇔ A : p → q via F
This is an equivalence relation.
The ∼A -class of u is captured by two lists of edges ( p, q):
u
those ( p, q) with A : p → q
u
those ( p, q) with A : p → q via F

∼A is of finite index, and each ∼A -class is regular.

Wolfgang Thomas
A Crucial Property
Assume U · V ω ∩ L(A) , 6O, where U, V are ∼A -classes.
Then U · V ω ⊆ L(A).

By assumption we have:
u 1 v 2v v3
A : q0 → p1 → p2 → p3 → . . . with u ∈ U, vi ∈ V
where via infinitely many vi a final state is passed.
Consider β = u′ v1′ v2′ v3′ . . . in U · V ω with u′ ∈ U, vi′ ∈ V .
Apply u ∼A u′ and vi ∼A vi′ :
u′ 1 v′
2 v′ v3′
A : q0 → p1 → p2 → p3 → . . .
where via infinitely many vi′ a final state is passed.

Wolfgang Thomas
Last Missing Step

We want to show (with ∼A -classes U, V ):


L(A) = {U · V ω |U · V ω ∩ L(A) = 6O}
S

Missing step: Show that each α belongs to some U · V ω


where U, V are ∼A -classes.

Ramsey’s Theorem:
Given a coloring of all pairs i < j of natural numbers, there is
an infinite “homogeneous” set H ⊆ N and a fixed color c such
that each pair i < j with i, j ∈ H is colored with c.

Take as color for (i, j) the ∼A -class of α[i, j)


Wolfgang Thomas
Consequences

1. The MSO-theory of (N, +1, 0) is decidable.


Proof: Transform a sentence ϕ into a Büchi automaton
over {0, 1}0 (i.e. with unlabelled transitions) and check
whether there is a reachable q ∈ F with a loop back to q.

2. MSO-formulas over (N, +1, 0) can be rewritten as


EMSO-formulas.

3. Model checking:
Check whether for each path of a transition system S a
formula ϕ holds.
Check whether the intersection automaton of S and A¬ϕ
accepts some ω-word.

Wolfgang Thomas
Determinization

Wolfgang Thomas
Deterministic Büchi Automata (DBA)
are of the form A = ( Q, Σ, q0 , δ, F ) with δ : Q × Σ → Q
A accepts α if its unique run on α visits F infinitely often.

This means: The DFA A accepts infinitely many prefixes of α

Let ϕ( X1 , . . . , Xn ) be a formula equivalent to the DFA A


Modify ϕ( X1 , . . . , Xn ) to a formula ϕ′ ( X1 , . . . , Xn , y) saying
“the segment up to position y satisfies ϕ”
Then the DBA A is equivalent to the formula
∀ x∃y ( x < y ∧ ϕ′ ( X1 , . . . , Xn , y)) where ϕ′ is bounded in y.

So: DBA-recognizable ω-languages are Π02 -sets of the Borel


hierarchy (as opposed to Σ11 sets for NBA).
Wolfgang Thomas
Weakness of DBA
Consider the ω-language (0 + 1)∗ 0ω , recognized by an NBA:

0, 1 0

q0 0 q1

Assume the DBA A recognizes (0 + 1)∗ 0ω .

Reading 0ω it will reach a final state after 0n0


Reading 0n0 10ω it will reach a final state after 0n0 10n1
etc.

So on 0n0 10n1 10n2 1 . . . A will visit final states infinitely often,


contradiction.
Wolfgang Thomas
Muller Automata
are a form of ω-automata that recognize the Boolean
combinations of DBA-recognizable sets.
Format: A = ( Q, Σ, q0 , δ, F )
with δ : Q × Σ → Q, F = { F1 , . . . , Fk } where Fi ⊆ Q
Acceptance: A accepts α iff for the unique run ̺ we have

k
∃ω m ̺(m) = q ∧ ¬∃ω m ̺(m) = q)
_ ^ ^
(
i =1 q∈ Fi q∈ Q\ Fi

Write Aq for the det. Büchi automaton ( Q, Σ, q0 , δ, {q}).


k
[ \ \
L(A) = ( L(Aq ) ∩ L(Aq ))
i =1 q∈ Fi q∈ Q\ Fi

Wolfgang Thomas
McNaughton’s Theorem

R. McNaughton (1924 - 2014)

Each Büchi automaton an be transformed into a (deterministic)


Muller automaton.
Wolfgang Thomas
Constructions of Automata

Muller (1963), with a flaw


McNaughton (1966)
Choueka (1974)
Th., using logic (1981)
Safra (1988)
with optimal growth rate 2O(n log n) for number of states
presented here
Muller and Schupp (1995)
Fogharty, Kähler, Vardi, Wilke (2013)
and others . . .

Wolfgang Thomas
Safra Trees
The desired Muller automaton has states that are “Safra trees”.
A Safra tree is a finite ordered tree of macrostates, possibly
some of them ticked, where the children of a node are disjoint
and their union a proper subset of the parent.
There are only finitely many such trees. These are the states of
the desired Muller automaton M.

Wolfgang Thomas
Transitions of M
From a Safra tree s via letter a the following Safra tree results:

1. For each node whose label contains final states, branch


off a new son containing these final states.
2. To each node label apply the subset construction via input
letter a.
3. Cancel state q if it occurs also in an older brother node.
Cancel a node if it has label 6O
4. Cancel all children (and their descendants) if the union of
their labels equals the parent label, and in this case tick
the parent.

Wolfgang Thomas
Acceptance
A run s0 s1 s2 . . . is accepting if from some si onwards some
node stays uncancelled in si si+1 si+2 . . . and is ticked infinitely
often.
Then by construction we have L(M) ⊆ L(B).
This is a Boolean combination of Büchi conditions on the run
s0 s1 s2 . . .:
For some node name k:

there are only finitely many si where k is missing.


there are infinitely many si where the label of k is ticked.

Wolfgang Thomas

You might also like