



Chapter 7 in the textbook: 

Games for SO, application to reachability 

Buchi’s theorem 

Star Free Languages 

Tree automata 




Proof 

Part 1: regular languages µ MSO 



Every regular language is in 9MSO
[in class] 



Every regular language is in 8 MSO
[in class] 




MSO µ regular languages 

This is harder: let f 2 MSO. Need to show that the set {M  M ² f} is
regular 



Proof 1 (not in the book): induction on f [in
class] 



Proof 2 (from the book): using types [in class] 




Corollary
Over strings, 9 MSO = 8 MSO = MSO 



Does this hold in general ? 




Consider s = {<} 



A structure M = a string in {1}^{*} = a
number 






Proposition Hamiltonean path on undirected
graphs is not definable in MSO 





Proof in class 




Let S = {a,b,c}
(can be larger in general) 

A regular language is defined by the
grammar:
E ::= ;
E ::= e  a
 b 
c
E ::= E [ E
E ::= E.E
E ::= E^{*} 

A starfree regular language:
drop E^{*},
add E (need overline, not
underline) 




Which of the following are starfree ? 











Theorem
L is starfree iff it is in FO.
L is regular iff it is in MSO 





A ranked alphabet is a set S and r : S ! N 

For a 2 S, r = r(a) ¸ 0 is it’s rank; also write
a^{r} 

Rank(S)=max(r(a)  a 2 S) 



A ranked tree T is a tree labeled with symbols
in S s.t. each node x labeled with a has exactly r(a) children 




Notations: 



Trees(S) 



A tree language is L µ Tree(S) 



This generalizes languages over strings (why ?) 




Symbolic expressions:
S =
{a,b,c,f^{1},g^{2},h^{2},k^{3}} 




A = (S, Q, q_{0}, d, F) where:
q_{0}
2 Q, F µ Q
d is a set of
tuples of the form: 

(w, a, q) w 2 Q^{*},
a 2 S, q 2 Q, s.t. w = r(a) 



Execution: given a tree T, A executes
bottom up or top down [show in
class] 

A language L µ Tree[S] is a regular tree
language iff there exists A s.t. L = {T  T accepted by A} 




Example: S = {0,1,:, Æ, Ç} 



A = (S, Q, q_{0}, d, F) 

Q = {false, true} 

q_{0} = (not needed) 

F = { true } 

d = (e,
0, false), (e, 1, true)
(false, :,
true), (true, :, false)
(false.false, Æ,
false), …, (true.true, Æ, true)
(false.false, Ç,
false), …, (true.true, Ç, true) 




Let’s restrict to Rank(S) = 2
easy to generalize 

Let s = {<, (P_{a})_{a }_{2}_{
}_{S}, succ_{1}, succ_{2}} 

Consider only structures in STRUCT[s] that are
trees, where < is the ancestordescendant relation, and succ_{1},
succ_{2} are the left and right child respectively 






Theorem A set of trees is definable in MSO iff
it is regular 



Proof: almost identical to Buchi’s theorem 



What are starfree regular tree languages ? 
