3.3 The Logic WSkS 95
Conversely, if u is accepted by the automaton, then there is a successful run
of A on u and we can label its positions with states in such a way that this
labeling is compatible with the transition rules in A.
Putting together Lemmas 3.3.4 and 3.3.6, we can state the following slogan
(which is not very precise; the precise statements are given by the lemmas):
Theorem 3.3.7. L is definable if and only if L is in Rec.
And, as a consequence:
Theorem 3.3.8 ([TW68]). WSkS is decidable.
Proof. Given a formula φ of WSkS, by Lemma 3.3.4, we can compute a finite
tree automaton which has the same solutions as φ. Now, assume that φ has no
free variable. Then the alphabet of the automaton is empty (or, more precisely,
it contains the only constant ⊤ according to what we explained in Section 3.2.4).
Finally, the formula is valid iff the constant ⊤ is in the language, i.e. iff there is
a rule ⊤ −→ q
f
for some q
f
∈ Q
f
.
3.3.7 Complexity Issues
We have seen in chapter 1 that, for finite tree automata, emptiness can be de-
cided in linear time (and is PTIME-complete) and that inclusion is EXPTIME-
complete. Considering WSkS formulas with a fixed number of quantifier al-
ternations N, the decision method sketched in the previous section will work
in time which is a tower of exponentials, the height of the tower being O(N ).
This is so because each time we encounter a sequence ∀X, ∃Y , the existential
quantification corresponds to a projection, which may yield a non-deterministic
automaton, even if the input automaton was deterministic. Then the elimination
of ∀X requires a determinization (because we have to compute a complement
automaton) which requires in general exponential time and exponential space.
Actually, it is not really possible to do much better since, even when k = 1,
deciding a formula of WSkS requires non-elementary time, as shown in [SM73].
3.3.8 Extensions
There are several extensions of the logic, which we already mentioned: though
quantification is restricted to finite sets, we may consider infinite sets as models
(this is what is often called weak second-order monadic logic with k s uccessors
and also written WSkS), or consider quantifications on arbitrary sets (this is
the full SkS).
These logics require more sophisticated automata which recognize sets of in-
finite terms. The proof of Theorem 3.3.8 carries over these extensions, with the
provision that the devices enjoy the required closure and decidability properties.
But this becomes much more intricate in the case of infinite terms. Indeed, for
infinite terms, it is not possible to design bottom-up tree automata. We have to
use a top-down device. But then, as mentioned in chapter 1, we cannot expect
to reduce the non-determinism. Now, the closure by complement becomes prob-
lematic because the usual way of computing the complement uses reduction of
non-determinism as a first step.
TATA — November 18, 2008 —