Tutorial on automata and games (slides)
Tutorial on automata and games (slides)
Christof Löding
RWTH Aachen, Germany
automata on
infinite trees
games of infinite
duration
automata on
infinite words
2 Basics on games
4 Tree automata
Complementation
Emptiness
Problem:
Problem:
Modeled as a game:
• One player plays input signals, the other player output signals
• The specification is the winning condition for the output player
• A transformation f realizing the specification is a winning
strategy for the output player
2 Basics on games
4 Tree automata
Complementation
Emptiness
• | X | = size of X
• X ∗ = the set of finite sequences over X
• X ω = the set of infinite sequences over X
• For α ∈ X ω :
y1 x1 y2 x2
y3 x3 y4 x4 x5 y5
x6 y6 y7 x7
y1 x1 y2 x2
y3 x3 y4 x4 x5 y5
x6 y6 y7 x7
y1 x1 y2 x2
y3 x3 y4 x4 x5 y5
x6 y6 y7 x7
α: y7
c(α) : •
Infinite games and automata theory · Bertinoro, June 2009 10 / 84
Plays
A play in G is an infinite sequence α = v0 v1 v2 · · · of vertices such
that (vi , vi+1 ) ∈ E for all i ≥ 0.
By c(α) we denote the corresponding sequence of colors
c ( v0 ) c ( v1 ) c ( v2 ) · · ·
y1 x1 y2 x2
y3 x3 y4 x4 x5 y5
x6 y6 y7 x7
α: y7 x6
c(α) : • •
Infinite games and automata theory · Bertinoro, June 2009 10 / 84
Plays
A play in G is an infinite sequence α = v0 v1 v2 · · · of vertices such
that (vi , vi+1 ) ∈ E for all i ≥ 0.
By c(α) we denote the corresponding sequence of colors
c ( v0 ) c ( v1 ) c ( v2 ) · · ·
y1 x1 y2 x2
y3 x3 y4 x4 x5 y5
x6 y6 y7 x7
α: y7 x6 y3
c(α) : • • •
Infinite games and automata theory · Bertinoro, June 2009 10 / 84
Plays
A play in G is an infinite sequence α = v0 v1 v2 · · · of vertices such
that (vi , vi+1 ) ∈ E for all i ≥ 0.
By c(α) we denote the corresponding sequence of colors
c ( v0 ) c ( v1 ) c ( v2 ) · · ·
y1 x1 y2 x2
y3 x3 y4 x4 x5 y5
x6 y6 y7 x7
α: y7 x6 y3 y6
c(α) : • • • •
Infinite games and automata theory · Bertinoro, June 2009 10 / 84
Plays
A play in G is an infinite sequence α = v0 v1 v2 · · · of vertices such
that (vi , vi+1 ) ∈ E for all i ≥ 0.
By c(α) we denote the corresponding sequence of colors
c ( v0 ) c ( v1 ) c ( v2 ) · · ·
y1 x1 y2 x2
y3 x3 y4 x4 x5 y5
x6 y6 y7 x7
α: y7 x6 y3 y6 x3
c(α) : • • • • •
Infinite games and automata theory · Bertinoro, June 2009 10 / 84
Plays
A play in G is an infinite sequence α = v0 v1 v2 · · · of vertices such
that (vi , vi+1 ) ∈ E for all i ≥ 0.
By c(α) we denote the corresponding sequence of colors
c ( v0 ) c ( v1 ) c ( v2 ) · · ·
y1 x1 y2 x2
y3 x3 y4 x4 x5 y5
x6 y6 y7 x7
α: y7 x6 y3 y6 x3 y4 ···
c(α) : • • • • • • ···
Infinite games and automata theory · Bertinoro, June 2009 10 / 84
Game
G = ( G, Win)
• G: game graph
• Win ⊆ C ω : winning condition
• Büchi: given by F ⊆ C
Win contains all plays α with Inf(α) ∩ F , ∅
• Muller: given by F ⊆ 2C
Win contains all plays α with Inf(α) ∈ F
• Parity: set of colors is a finite set of natural numbers (priorities)
Win contains all plays α with max(Inf(c(α))) even
y1 x1
y2 x2
y2 ∈ Inf(α) ⇔ { x1 , x2 } ⊆ Inf(α)
y1 x1
y2 x2
y2 ∈ Inf(α) ⇔ { x1 , x2 } ⊆ Inf(α)
y1 x1
y2 x2
y2 ∈ Inf(α) ⇔ { x1 , x2 } ⊆ Inf(α)
α: y1
y1 x1
y2 x2
y2 ∈ Inf(α) ⇔ { x1 , x2 } ⊆ Inf(α)
α: y1 x1
y1 x1
y2 x2
y2 ∈ Inf(α) ⇔ { x1 , x2 } ⊆ Inf(α)
α: y1 x1 y1
y1 x1
y2 x2
y2 ∈ Inf(α) ⇔ { x1 , x2 } ⊆ Inf(α)
α: y1 x1 y1 x1
y1 x1
y2 x2
y2 ∈ Inf(α) ⇔ { x1 , x2 } ⊆ Inf(α)
α: y1 x1 y1 x1 y1
y1 x1
y2 x2
y2 ∈ Inf(α) ⇔ { x1 , x2 } ⊆ Inf(α)
α: y1 x1 y1 x1 y1 x2
y1 x1
y2 x2
y2 ∈ Inf(α) ⇔ { x1 , x2 } ⊆ Inf(α)
α: y1 x1 y1 x1 y1 x2 y1
y1 x1
y2 x2
y2 ∈ Inf(α) ⇔ { x1 , x2 } ⊆ Inf(α)
α: y1 x1 y1 x1 y1 x2 y1 x1
y1 x1
y2 x2
y2 ∈ Inf(α) ⇔ { x1 , x2 } ⊆ Inf(α)
α: y1 x1 y1 x1 y1 x2 y1 x1 y2
y1 x1
y2 x2
y2 ∈ Inf(α) ⇔ { x1 , x2 } ⊆ Inf(α)
α: y1 x1 y1 x1 y1 x2 y1 x1 y2 x1
y1 x1
y2 x2
y2 ∈ Inf(α) ⇔ { x1 , x2 } ⊆ Inf(α)
α: y1 x1 y1 x1 y1 x2 y1 x1 y2 x1 y1 ···
σ : V ∗ VE → V
σ : V ∗ VE → V
∀i : vi ∈ VE → σ(v0 · · · vi ) = vi+1
σ : V ∗ VE → V
∀i : vi ∈ VE → σ(v0 · · · vi ) = vi+1
By determinacy:
y1 x1
F = {{ x1 , y1 }, { x2 , y1 }, { x1 , x2 , y1 , y2 }}
y2 x2
x1 , y1 , y2 x2 , y1 , y2
x2
σ ( m0 , x1 ) = y1
m0 m1
x1 σ ( m1 , x1 ) = y2
y1 x1
F = {{ x1 , y1 }, { x2 , y1 }, { x1 , x2 , y1 , y2 }}
y2 x2
y1
m0
x1 , y1 , y2 x2 , y1 , y2
x2
σ ( m0 , x1 ) = y1
m0 m1
x1 σ ( m1 , x1 ) = y2
y1 x1
F = {{ x1 , y1 }, { x2 , y1 }, { x1 , x2 , y1 , y2 }}
y2 x2
y1 x1
m0 m0
x1 , y1 , y2 x2 , y1 , y2
x2
σ ( m0 , x1 ) = y1
m0 m1
x1 σ ( m1 , x1 ) = y2
y1 x1
F = {{ x1 , y1 }, { x2 , y1 }, { x1 , x2 , y1 , y2 }}
y2 x2
y1 x1 y1
m0 m0 m0
x1 , y1 , y2 x2 , y1 , y2
x2
σ ( m0 , x1 ) = y1
m0 m1
x1 σ ( m1 , x1 ) = y2
y1 x1
F = {{ x1 , y1 }, { x2 , y1 }, { x1 , x2 , y1 , y2 }}
y2 x2
y1 x1 y1 x1
m0 m0 m0 m0
x1 , y1 , y2 x2 , y1 , y2
x2
σ ( m0 , x1 ) = y1
m0 m1
x1 σ ( m1 , x1 ) = y2
y1 x1
F = {{ x1 , y1 }, { x2 , y1 }, { x1 , x2 , y1 , y2 }}
y2 x2
y1 x1 y1 x1 y1
m0 m0 m0 m0 m0
x1 , y1 , y2 x2 , y1 , y2
x2
σ ( m0 , x1 ) = y1
m0 m1
x1 σ ( m1 , x1 ) = y2
y1 x1
F = {{ x1 , y1 }, { x2 , y1 }, { x1 , x2 , y1 , y2 }}
y2 x2
y1 x1 y1 x1 y1 x2
m0 m0 m0 m0 m0 m0
x1 , y1 , y2 x2 , y1 , y2
x2
σ ( m0 , x1 ) = y1
m0 m1
x1 σ ( m1 , x1 ) = y2
y1 x1
F = {{ x1 , y1 }, { x2 , y1 }, { x1 , x2 , y1 , y2 }}
y2 x2
y1 x1 y1 x1 y1 x2 y1
m0 m0 m0 m0 m0 m0 m1
x1 , y1 , y2 x2 , y1 , y2
x2
σ ( m0 , x1 ) = y1
m0 m1
x1 σ ( m1 , x1 ) = y2
y1 x1
F = {{ x1 , y1 }, { x2 , y1 }, { x1 , x2 , y1 , y2 }}
y2 x2
y1 x1 y1 x1 y1 x2 y1 x1
m0 m0 m0 m0 m0 m0 m1 m1
x1 , y1 , y2 x2 , y1 , y2
x2
σ ( m0 , x1 ) = y1
m0 m1
x1 σ ( m1 , x1 ) = y2
y1 x1
F = {{ x1 , y1 }, { x2 , y1 }, { x1 , x2 , y1 , y2 }}
y2 x2
y1 x1 y1 x1 y1 x2 y1 x1 y2
m0 m0 m0 m0 m0 m0 m1 m1 m0
x1 , y1 , y2 x2 , y1 , y2
x2
σ ( m0 , x1 ) = y1
m0 m1
x1 σ ( m1 , x1 ) = y2
y1 x1
F = {{ x1 , y1 }, { x2 , y1 }, { x1 , x2 , y1 , y2 }}
y2 x2
y1 x1 y1 x1 y1 x2 y1 x1 y2 x1
m0 m0 m0 m0 m0 m0 m1 m1 m0 m0
x1 , y1 , y2 x2 , y1 , y2
x2
σ ( m0 , x1 ) = y1
m0 m1
x1 σ ( m1 , x1 ) = y2
y1 x1
F = {{ x1 , y1 }, { x2 , y1 }, { x1 , x2 , y1 , y2 }}
y2 x2
y1 x1 y1 x1 y1 x2 y1 x1 y2 x1 y1
m0 m0 m0 m0 m0 m0 m1 m1 m0 m0 m0
x1 , y1 , y2 x2 , y1 , y2
x2
σ ( m0 , x1 ) = y1
m0 m1
x1 σ ( m1 , x1 ) = y2
Theorem (Emerson/Jutla’88,Mostowski’91)
Parity games are positionally determined.
Theorem (Emerson/Jutla’88,Mostowski’91)
Parity games are positionally determined.
2 Basics on games
4 Tree automata
Complementation
Emptiness
a b C ∗ c( a + b)∗ cC ∗ + C ∗ d( a + b)∗ dC ∗
c d
a b C ∗ c( a + b)∗ cC ∗ + C ∗ d( a + b)∗ dC ∗
a b C ∗ c( a + b)∗ cC ∗ + C ∗ d( a + b)∗ dC ∗
a b
c d
0 a, b
c d
d
a, b 1 2 a, b
c
c d
3 a, b, c, d
a b a, 0 b, 0
c d c, 0 d, 0
0 a, b a, 1 b, 1 a, 2 b, 2
c d
d
a, b 1 2 a, b c, 1 d, 1 c, 2 d, 2
c
c d
3 a, b, c, d
a b a, 0 b, 0
c d c, 0 d, 0
0 a, b a, 1 b, 1 a, 2 b, 2
c d
d
a, b 1 2 a, b c, 1 d, 1 c, 2 d, 2
c
c d
3 a, b, c, d
a b a, 0 b, 0
c d c, 0 d, 0
0 a, b a, 1 b, 1 a, 2 b, 2
c d
d
a, b 1 2 a, b c, 1 d, 1 c, 2 d, 2
c
c d
3 a, b, c, d
a b a, 0 b, 0
c d c, 0 d, 0
0 a, b a, 1 b, 1 a, 2 b, 2
c d
d
a, b 1 2 a, b c, 1 d, 1 c, 2 d, 2
c
c d
3 a, b, c, d
a b a, 0 b, 0
c d c, 0 d, 0
0 a, b a, 1 b, 1 a, 2 b, 2
c d
d
a, b 1 2 a, b c, 1 d, 1 c, 2 d, 2
c
c d
3 a, b, c, d
a b a, 0 b, 0
c d c, 0 d, 0
0 a, b a, 1 b, 1 a, 2 b, 2
c d
d
a, b 1 2 a, b c, 1 d, 1 c, 2 d, 2
c
c d
3 a, b, c, d
a b a, 0 b, 0
c d c, 0 d, 0
0 a, b a, 1 b, 1 a, 2 b, 2
c d
d
a, b 1 2 a, b c, 1 d, 1 c, 2 d, 2
c
c d
3 a, b, c, d
a b a, 0 b, 0
c d c, 0 d, 0
0 a, b a, 1 b, 1 a, 2 b, 2
c d
d
a, b 1 2 a, b c, 1 d, 1 c, 2 d, 2
c
c d
3 a, b, c, d
q0 a q1
q0 a q1
There is no deterministic Büchi automaton for this language
q0 a q1
There is no deterministic Büchi automaton for this language
• A deterministic parity automaton for the same language:
a b
b
q0 q1
0 1
a
a a a a
{ q0 } −
→ { q0 , q1 } −
→ { q0 , q1 } −
→ { q0 , q1 } −
→ { q0 , q1 } · · ·
a b a b
a a a a
{ q0 } −
→ { q0 , q1 } −
→ { q0 , q1 } −
→ { q0 , q1 } −
→ { q0 , q1 } · · ·
a b a b
a a a a
{ q0 } −
→ { q0 , q1 } −
→ { q0 , q1 } −
→ { q0 , q1 } −
→ { q0 , q1 } · · ·
a b a b
Corollary
The class of regular ω -languages is closed under complementation.
positional
winning strategy
• LAR update:
Theorem
For a Muller condition F over C the corresponding deterministic
parity automaton ALAR accepts precisely those α ∈ C ω that satisfy
the Muller condition F .
compute
positional
winning strategy
From Muller to Parity Games
compute
compute
Theorem (Gurevich/Harrington’82)
Muller games are determined with the LAR automaton as memory.
G p2 ∧ F p1
µ ¶µ ¶µ ¶ µ ¶µ ¶µ ¶µ ¶µ ¶
0 0 0 0 1 0 0 1
··· ···
1 1 1 1 1 1 1 1
G p2 ∧ F p1
µ ¶µ ¶µ ¶ µ ¶µ ¶µ ¶µ ¶µ ¶
0 0 0 0 1 0 0 1
··· ···
1 1 1 1 1 1 1 1
F( p3 ∧ X(¬ p2 U p1 ))
0 0 1 0 0 0 1
1 0 · · · 0 0 0 0 1 · · ·
0 1 1 1 1 0 0
Proof:
Theorem (Büchi/Landweber’69)
For finite games ( G, ϕ) with a winning condition given by an S1S
formula one can decide the winner and can compute a
corresponding winning strategy.
n ¾
· ·2
2· k
22
for a fixed k.
compute
Examples:
• Muller conditions: LAR construction
• LTL conditions: nondeterministic automaton guessing
valuations of subformulas + determinization
• S1S conditions: inductive translation to automata
Infinite games and automata theory · Bertinoro, June 2009 45 / 84
Solving Church’s synthesis problem
input ∈ Σ1 circuit f output ∈ Σ2
with the input signals in the first row, the output signals in the
second row.
• The specification can be written as LTL formula over { p1 , p2 }
or as S1S formula ϕ( X1 , X2 ).
Infinite games and automata theory · Bertinoro, June 2009 46 / 84
Church’s synthesis problem as game
µ ¶
0
0
µ ¶
0
1
µ ¶
1
0
µ ¶
1
1
2 Basics on games
4 Tree automata
Complementation
Emptiness
Theorem (McNaughton’66,Safra’88)
For each nondeterministic Büchi automaton with n states there is
an equivalent deterministic parity automaton with 2O(n log n) states.
automata on infinite
trees
games of infinite
duration
automata on infinite
words
b
a b
b b b b
a a a a b a a a
..
.
t(ε) = b b
t (0) = a
t(01) = b
a b
b b b b t(110) = a
a a a a b a a a
..
.
automata on automata on
finite words finite trees
automata on automata on
infinite words infinite trees
Run of A : b
a b
b b b b
a a a a b a a a
..
.
Proof:
Proof:
..
.
..
.
..
.
..
.
..
.
..
.
..
.
..
.
..
.
..
.
..
.
..
.
..
.
Astrat has to check: the paths following the blue edges do not
satisfy the acceptance condition
..
.
Astrat has to check: the paths following the blue edges do not
satisfy the acceptance condition
Focus on single branches: infinite words over Σ × Γ × {0, 1}
..
.
path
Astrat : δ(q, ( a, γ, 0)) = q′ δ(q, ( a, γ, 1)) = q′′
• The game starts at the root of the tree t in the initial state of
A.
• The moves of the game from a position ( u , q) where
u is a node of t, and q is a state of A:
1. C picks a transition (q, a, q0 , q1 ) that matches q
and the label a of t at u
2. S chooses a direction and the game moves on to position
( u0 , q0 ) or ( u1 , q1 ).
• Winning condition for C: acceptance condition of A
• The game starts at the root of the tree t in the initial state of
A.
• The moves of the game from a position ( u , q) where
u is a node of t, and q is a state of A:
1. C picks a transition (q, a, q0 , q1 ) that matches q
and the label a of t at u
2. S chooses a direction and the game moves on to position
( u0 , q0 ) or ( u1 , q1 ).
• Winning condition for C: acceptance condition of A
• The game starts at the root of the tree t in the initial state of
A.
• The moves of the game from a position ( u , q) where
u is a node of t, and q is a state of A:
1. C picks a transition (q, a, q0 , q1 ) that matches q
and the label a of t at u
2. S chooses a direction and the game moves on to position
( u0 , q0 ) or ( u1 , q1 ).
• Winning condition for C: acceptance condition of A
Lemma
C has a winning strategy in the emptiness game for A iff
T (A) , ∅
1
q1
(q1 , a, q1 , q+ ) (q1 , a, q2 , q+ )
2
q2 (q2 , a, q1 , q1′ )
2
q+
(q1′ , a, q+ , q1′ )
1
q1′
(q+ , a, q+ , q+ ) (q+ , b, q+ , q+ ) (q1′ , b, q+ , q+ )
1
q1
(q1 , a, q1 , q+ ) (q1 , a, q2 , q+ )
2
q2 (q2 , a, q1 , q1′ )
2
q+
(q1′ , a, q+ , q1′ )
1
q1′
(q+ , a, q+ , q+ ) (q+ , b, q+ , q+ ) (q1′ , b, q+ , q+ )
(q1 , (q1 , a, q2 , q+ ))
0
0
1
0,1
0,1 (q1′ , (q1′ , b, q+ , q+ ))
Corollary (Rabin’69)
S2S is decidable.
2 Basics on games
4 Tree automata
Complementation
Emptiness
Proposition
The problem of finding the winner in a game ( G, Win), where Win
is defined by a nondeterministic pushdown ω -automaton is
undecidable.
Corollary
The problem of deciding the winner in a game ( G, Win) for a finite
game graph, where Win is defined by a deterministic pushdown
ω -automaton (with parity condition) is decidable.
Infinite games and automata theory · Bertinoro, June 2009 82 / 84
Recursive games
In general, one can study games on recursive game graphs (infinite
set of vertices, computable edge relation and coloring).
For recursive parity games winning strategies need not be
computable:
i−1 i i+1
··· ···
.. .. .. .. .. .. .. .. .. ..
. . . . . . . . . .
.. ..
Eva wins if she visits . .
finitely many green ver- Switch at level k if Turing ma-
tices chine number i halts after k
steps for the empty input
.. ..
. .
Infinite games and automata theory · Bertinoro, June 2009 83 / 84
Summary
1. Solving infinite games with the help of automata: Extend the
game by running a deterministic automaton along the plays
• Determinization: nondeterministic Büchi → deterministic parity
• Muller conditions: LAR construction
• LTL conditions: nondeterministic automaton guessing
valuations of subformulas
• S1S conditions: inductive translation to automata
• Solution to Church’s synthesis problem
2. Games as a tool for tree automata constructions
• Complementation
• Emptiness test
• Application: decidability of S2S
3. Nonregular conditions and infinite graphs
• Pushdown games
• Recursive games