2. • 読んだ資料
▶ Languages, Automata, and Logic. Thomas W. (1997)
• 今回の発表
▶ Chapter1 Introduction
▶ Chapter2 Models and Formulas
▶ Chapter3 Automata and MSO-Logic on Finite Words and Trees
2 / 26
3. Table of contents
1 Words, Trees, Graphs as Models
2 First-Order Logic
3 Monadic Second-Order Logic
4 Automata and MSO-Logic on finite words and trees
3 / 26
4. Words, Trees, Graphs as Models
Table of contents
1 Words, Trees, Graphs as Models
2 First-Order Logic
3 Monadic Second-Order Logic
4 Automata and MSO-Logic on finite words and trees
4 / 26
5. Words, Trees, Graphs as Models
Word model
A : finite alphabet
w = a0 · · · an−1 : word over A (∀i. ai ∈ A)
Word model
w = (dom(w), Sw
, <w
, (Qw
a )a∈A)
• dom(w) = {0, 1, · · · , n − 1}
• (i, i + 1) ∈ Sw (0 ≤ i < n − 1)
• <w : natural order
• Qw
a = {i ∈ dom(w) | ai = a}
5 / 26
6. Words, Trees, Graphs as Models
ω-word model
α = a0a1 · · · : ω-word over A
ω word model
α = (ω, Sα
, <α
, (Qα
a )a∈A)
• ω = {0, 1, 2, · · · }
6 / 26
7. Words, Trees, Graphs as Models
Tree model
t : proper binary tree over A
Tree model
t = (dom(t), St
0, St
1, <t
, (Qt
a)a∈A)
• node of tree : finite words over the alphabet {0, 1} (0 : branch left, 1 : branch right)
• (w, w0) ∈ St
0 (for w, w0 ∈ dom(t))
• <t : the proper prefix relation
7 / 26
8. Words, Trees, Graphs as Models
Graph model
G : edge-labelled directed graph
A : the alphabet of vertex label
B : the alphabet of edge label
Graph model
G = (V, (EG
b )b∈B, (QG
a )a∈A)
Word, Tree models are special case of Graph models
8 / 26
9. First-Order Logic
Table of contents
1 Words, Trees, Graphs as Models
2 First-Order Logic
3 Monadic Second-Order Logic
4 Automata and MSO-Logic on finite words and trees
9 / 26
11. First-Order Logic
Example formulae (first-order logic)
A = {a, b, c}
• a の後ろに b は続かない
¬∃x∃y(S(x, y) ∧ Qa(x) ∧ Qb(y))
• b の次は a
∀x(Qb(x) → ∃y(S(x, y) ∧ Qa(y)))
• 最後の文字は a
∃x(¬∃yS(x, y) ∧ Qa(x))
11 / 26
12. First-Order Logic
Notations
• φ(x1, . . . , xn)
▶ φ has at most n free variables
▶ If n = 0, φ is sentence
• (w, p1, . . . , pn) |= φ(x1, . . . , xn)
▶ φ is satisfied in w when S, <, Qa, x1, . . . , xn are interpreted by Sw
, <w
, Qw
a , p1, . . . , pn
• L(φ) = {w ∈ A∗ | w |= φ}
▶ The language defined by the sentence φ
12 / 26
13. First-Order Logic
Definability
• A language L is FO[S, <]-definable if a first-order sentence φ exists with L(φ) = L
• FO[S]-definability
▶ No use is made of < in φ
• For finite word, S can be expressed in terms of <
▶ x < y ∧ ¬∃z(x < z ∧ z < y)
13 / 26
14. First-Order Logic
Prenex normal form
• ∃x1∀x2 . . . ∃/∀xnφ0(x1, x2, . . . , xn)
▶ φ0 is quantifier-free
▶ Σ0
n-formula
14 / 26
15. Monadic Second-Order Logic
Table of contents
1 Words, Trees, Graphs as Models
2 First-Order Logic
3 Monadic Second-Order Logic
4 Automata and MSO-Logic on finite words and trees
15 / 26
17. Monadic Second-Order Logic
Prenex normal form for second-order formula
• Shift all second-order quantifiers in front of first-order quantifiers
Example
∀x∃Y φ(x, Y )
can be rewritten as
∀X∃Y ∀u∀v∀x((X(u) ∧ X(v) → u = v) ∧ (X(x) → φ(x, Y )))
• Σ1
n-formula
• Σ1
1-formula is also called EMSO-formula
17 / 26
18. Monadic Second-Order Logic
MSO0-Logic
• Second-order variables only
• Atomic formulas
X ⊆ Y, Sing(X), Suc(X, Y ), X ⊆ Qa
• Same expressive power as MSO-logic
Example
∀x(Qa(x) → ∃y(S(x, y) ∧ Z(y)))
can be rewritten as
∀X(Sing(X) ∧ X ⊆ Qa → ∃Y (Sing(Y ) ∧ Suc(X, Y ) ∧ Y ⊆ Z))
18 / 26
19. Automata and MSO-Logic on finite words and trees
Table of contents
1 Words, Trees, Graphs as Models
2 First-Order Logic
3 Monadic Second-Order Logic
4 Automata and MSO-Logic on finite words and trees
19 / 26
20. Automata and MSO-Logic on finite words and trees
MSO-Logic on words
Theorem 3.1(B¨uchi,Elgot)
A language of finite words is recognizable by a finite automaton if and only if it is
MSO[S]-definable, and both conversions, from autoamata to formulas and vice versa, are
effective
(⇒)
• Automaton accepts the nonempty word w iff
w |= ∃X0 . . . ∃Xk(
∧
i̸=j
∀x¬(Xi(x) ∧ Xj(x)) (pairwise disjoint)
∧ ∀x(¬∃yS(y, x) → X0(x)) (initial state)
∧ ∀x∀y(S(x, y) →
∨
(i,a,j)∈∆
(Xi(x) ∧ Qa(x) ∧ Xj(y)) (transition)
∧ ∀x(¬∃yS(x, y) →
∨
∃j∈F:(i,a,j)∈∆
(Xi(x) ∧ Qa(x)))) (final state)
20 / 26
21. Automata and MSO-Logic on finite words and trees
MSO-Logic on words
(⇐)
• By induction on the MSO0-formulas
• Consider connectives and quantifier only ¬, ∨, ∃
• Construct a finite automaton for any given formula φ(X1, . . . , Xn)
▶ φ(X1, . . . , Xn) is interpreted in a word model with P1, . . . , Pn
▶ such a model represents a word over the expanded alphabet A′
= A × {0, 1}n
• There are automata recognizing the sets defined by atomic formulas
Xj ⊆ Xk, Sing(Xj), Suc(Xj, Xk), Xj ⊆ Qa
▶ base case
▶ check additional bit
21 / 26
22. Automata and MSO-Logic on finite words and trees
MSO-logic on words
(⇐)
• Inductive step
• Easy for ¬, ∨
▶ well-known closure property
• Assume the language defined by the formula ψ(X1, . . . , Xn) over the alphabet
A × {0, 1}n is recognized by the automaton A
• Construct an automaton corresponding to φ(X1, . . . , Xn−1) = ∃Xnψ(X1, . . . , Xn)
▶ over alphabet A × {0, 1}n−1
▶ guess n-th bit by nondeterminism
22 / 26
23. Automata and MSO-Logic on finite words and trees
MSO-logic on words
Corollary 3.2
Any MSO[S]-formula can be written as an EMSO[S]-formula
w |= ∃X0 . . . ∃Xk(
∧
i̸=j
∀x¬(Xi(x) ∧ Xj(x)) (pairwise disjoint)
∧ ∀x(¬∃yS(y, x) → X0(x)) (initial state)
∧ ∀x∀y(S(x, y) →
∨
(i,a,j)∈∆
(Xi(x) ∧ Qa(x) ∧ Xj(y)) (transition)
∧ ∀x(¬∃yS(x, y) →
∨
∃j∈F:(i,a,j)∈∆
(Xi(x) ∧ Qa(x)))) (final state)
• Automata normal form
23 / 26
24. Automata and MSO-Logic on finite words and trees
MSO-logic on words
• Deterministic vs. Nondeterministic
▶ complement and projection
• It is shown that the time complexity of any algorithm converting MSO-formulas to
equivalent automata cannot be bounded by an elementary function
• Application of theorem 3.1
▶ The decidability of weak monadic second-order theory of one successor
▶ The decidability of Presburger arithmetic
24 / 26
25. Automata and MSO-Logic on finite words and trees
Tree automaton
Definition 3.7 Tree automaton
A = (Q, A, q0, ∆, F)
q0 ∈ Q, F ⊆ Q, ∆ ⊆ Q × A × Q × Q
• transition (q, a, q′, q′′) allows to proceed from q′, q′′ at
the successor nodes of a node u to state q at u while
reading letter a as label of u
• Example
▶ ∆ = {(q1, a, q0, q0), (q3, a, q1, q2), (q2, b, q0, q0)}
F = {q3}
▶ A successful run of A : ρ(ϵ) = q3, ρ(0) = q1, ρ(1) = q2
25 / 26
26. Automata and MSO-Logic on finite words and trees
MSO-Logic on trees
Theorem 3.8 (Thatcher and Wright, Doner)
A set of finite trees is recognizable by a finite tree automaton if and only if it is MSO-definable
• the nondeterministic and the deterministic tree automaton model are equivalent
26 / 26