On the Problem of Computing the Probability of Regular Sets of Trees

We consider the problem of computing the probability of regular languages of infinite trees with respect to the natural coin-flipping measure. We propose an algorithm which computes the probability of languages recognizable by \emph{game automata}. In particular this algorithm is applicable to all deterministic automata. We then use the algorithm to prove through examples three properties of measure: (1) there exist regular sets having irrational probability, (2) there exist comeager regular sets having probability $0$ and (3) the probability of \emph{game languages} $W_{i,k}$, from automata theory, is $0$ if $k$ is odd and is $1$ otherwise.


Introduction
Regular languages of trees are sets of infinite binary trees, labeled by letters from a finite alphabet Σ, definable by a formula of Monadic Second Order (MSO) logic interpreted over the full binary tree [25] or, equivalently, specified by an alternating tree automaton [19].
In this paper we consider the following problem. Suppose a Σ-labeled tree t is generated by labeling each vertex by a randomly and uniformly chosen letter a ∈ Σ. For a given regular language L, what is the probability that t belongs to L? By probability we mean the standard coin-flipping probability measure µ (see Section 2 for definitions) on the space of Σ-labeled trees. Hence a precise formulation of our problem is as follows.
Probability Problem: Does there exist an algorithm which for a given regular language of trees L computes the probability µ(L)?
A qualitative variant of the problem only asks for a decision procedure for the question "is µ(L) = 1?". The problem is well posed since it was recently shown in [12,Theorem 1] that regular sets of trees are measurable with respect to any Borel measure and thus, in particular, with respect to the coin-flipping measure. An extended version of this paper is availiable at [15].

Main Results
We give a positive solution to the Probability Problem for a subclass of regular languages. Theorem 1. Let L be a regular set of infinite trees recognizable by a game automaton. Then the probability of L is computable and is an algebraic number.
Game automata (see [10,11,21]) are special types of alternating parity tree automata. The class of languages recognizable by game automata includes, beside all deterministic languages, other important examples of regular sets. The most notable examples are the game languages W i,k which play a fundamental role in the study of tree languages with topological methods [3,12]. Game automata definable languages are, at the present moment, the largest known subclass of regular languages for which the long-standing Mostowski-Rabin index problem 1 is known to be decidable (see [10,11]). Theorem 1 confirms the good algorithmic properties of game automata. At the same time, however, we suspect that generalizing the result of Theorem 1 to arbitrary regular languages might be hard. Some ideas for further research in this direction are discussed in Section 6.
From Theorem 1 we derive the following propositions (for proofs see Section 5).

Proposition 2.
There exists a regular language of trees L definable by a deterministic automaton such that L has an irrational probability.

Proposition 3.
There exists a regular language of trees L definable by a deterministic automaton such that L is comeager and L has probability 0.
These two propositions should be contrasted with known properties of regular languages of infinite words. First, a result of Staiger in [22] states that a regular language L of infinite words has coin-flipping measure 0 if and only if it is of Baire first category (or meager). 3 shows that this correspondence fails in the context of infinite trees. Second, the coin-flipping measure of a regular language of infinite words is always rational (see, e.g., Theorem 2 of [7]). Hence, the probabilistic properties of regular languages of trees seem to be significantly more refined than in the case of languages of ω-words.
Lastly, we calculate the probability of all game languages W i,k (see [3,12] and Subsection 5.4), a result that might eventually be useful given the importance of game languages in the topological study of regular sets of trees.

Proposition 4.
For 0 ≤ i < k, the game language W i,k has probability 0 if k is odd and 1 if k is even.

The Algorithm
In Section 4 we propose Algorithm 2 which computes the probability of regular languages recognized by game automata. Algorithm 2 is based on a reduction to Markov Branching plays (MBP's): to each game automaton A we associate a MBP M. The value of M can be computed and corresponds to the probability of the language recognized by A. This reduction to MBP's is described in Sections 3 and 4.
The notion of MBP, as a special kind of two-player stochastic meta-parity game has been introduced by the second author in [16,17] in order to interpret a probabilistic version of the modal µ-calculus. For a given MBP M having n states, the vector val ∈ [0, 1] n of values of M can be expressed as the solution of a system S of (nested) least and greatest fixed-point equations over the space [0, 1] n . From S one can then construct a first order formula φ S (val) in the language of real-closed fields having the property that val is the unique tuple of real numbers satisfying φ S . The tuple val can be computed by Tarski's quantifier elimination algorithm [24] and consists of algebraic numbers. See Algorithm 1 in Section 3 for a description of the procedure for computing the value of MBP's.
One can find interesting the connections between the machinery of MBP's (and thus, as mentioned, the probabilistic µ-calculus), the class of languages definable by game automata, the algorithmic problem of computing the probability of regular languages of trees and the usage of Tarski's quantifier elimination procedure.

Related Work
In [23] L. Staiger presented an algorithm for computing the Hausdorff measure of regular sets of ω-words. The method, based on the decomposition of the input language into simpler components, can be adapted to compute the coin-flipping measure of regular sets of ω-words. Our research on the coin-flipping measure of regular languages of trees can be seen as a continuation of Staiger's work.
Natural variants of the qualitative version of the Probability Problem, obtained by replacing "has probability 1" by other notions of largeness, are known to have positive solutions: in [20] D. Niwiński described an algorithm which takes as input a regular language of trees L (presented as a Rabin tree automaton) and decides if L is uncountable and, similarly, an algorithm for establishing if a regular language of trees L is comeager can be extracted from the result of [14].
Addendum. After the submission of this article we have been informed that the Probability Problem has already been implicitly considered in [8], although differently phrased as the verification problem for a class of stochastic branching processes. Following our terminology, in [8] the authors provide an algorithm for computing the probability of regular languages definable by deterministic tree automata. Hence our results can be seen as extending the work of [8] from deterministic to game-automata definable languages.

2
Background in Topology and Automata Theory

Topology and measure
In this section we present elementary topological and measure-theoretical notions required in this work. We refer to [13] as a standard reference on the subject. The set of natural numbers is denoted by ω. A topological space X is Polish if it is separable and completely metrizable. An important example of a Polish space is the Cantor space {0, 1} ω of infinite sequences of bits endowed with the product topology. In this paper we are interested in the probability Lebesgue measure µ on the product space Σ I for I, a countable set of indices. The measure µ is uniquely defined by the assignment µ({t ∈ Σ I | t(i 1 ) = a 1 , . . . , t(i k ) = a k }) = ( 1 |Σ| ) k for i 1 , . . . , i k ∈ I, a 1 , . . . , a k ∈ Σ (i j = i j whenever j = j , see [13,Chapter 17] for additional details). In particular, for the alphabet Σ = {0, 1} and I = ω this is known as the coin-flipping probability measure on the Cantor space.
The countable set V = {L, R} * of finite words over the alphabet {L, R} is called the full binary tree and each v ∈ {L, R} * is referred to as a vertex. The product space Σ V is denoted by T Σ and an element t ∈ T Σ is called a Σ-labeled tree, or just a Σ-tree. Intuitively, the stochastic processes associated with the coin-flipping measure µ on T Σ generates an infinite Σ-tree by labeling each vertex with a randomly (uniformly) chosen label in Σ.
Given a topological space X, a set A ⊆ X is nowhere dense if the interior of its closure is the empty set, that is int(cl(A)) = ∅. A set A ⊆ X is of (Baire) first category (or meager) if A can be expressed as a countable union of nowhere dense sets. The complement of a meager set is called comeager.

Alternating Parity Tree Automata and Game Automata
We include a brief exposition of alternating automata which follows the presentation in [19,Appendix C]. In this paper we are mostly interested in a subclass of alternating parity tree automata called game automata, which is introduced later in the Section. Definition 5 (Alternating Parity Tree Automaton). Given a finite set X, we denote with DL(X) the set of expressions e generated by the grammar e ::= x ∈ X | e ∧ e | e ∨ e. An alternating parity tree automaton over a finite alphabet Σ is a tuple A = Σ, Q, q 0 , δ, π) where Q is a finite set of states, q 0 ∈ Q is the initial state, δ : Q × Σ → DL({L, R} × Q) is the alternating transition function, and π : Q → ω is the parity condition.
An alternating parity tree automaton A over the alphabet Σ defines, or "accepts", a set of Σ-trees. The acceptance of a tree t ∈ T Σ is defined via a two-player (∃ and ∀) game of infinite duration denoted by The game A(t) starts at state , q 0 . Game states of the form #» x , q , including the initial state, have only one successor state, to which the game progresses automatically. The successor state is #» x , e with e = δ(q, a), where a = t( #» x ) is the labeling of the vertex #» x given by t. The dynamics of the game at states #» x , e depends on the possible shapes of e. If e = e 1 ∨ e 2 , then Player ∃ moves either to #» x , e 1 or #» x , e 2 . If e = e 1 ∧ e 2 , then Player ∀ moves either to #» x , e 1 or #» x , e 2 . If e = (L, q) then the game progresses automatically to the state #» x .L, q . Lastly, if e = (R, q) the game progresses automatically to the state #» x .R, q . Thus a play in the game A(t) is a sequence Π of game-states, that looks like: Π = ( , q 0 , . . . , L, q 1 , . . . , LR, q 2 , . . . , LRL, q 3 , . . . , LRLL, q 4 , . . . ), where the dots represent part of the play in game-states of the form #» x , e . Let ∞(Π) be the set of automata states q ∈ Q occurring infinitely often in configurations #» x , q of Π. We then say that the play Π of A(t) is winning for ∃, if max{π(q) | q ∈ ∞(Π)} is an even number. The play Π is winning for ∀ otherwise. The set (or "language") of Σ-trees defined by A is the collection {t ∈ T Σ | ∃ has a winning strategy in the game We reserve the symbols and ⊥ for two special sink states having even and odd priority, respectively. The transition function is defined, for all a ∈ Σ, as δ( , a) = (L, ) ∧ (R, ) and δ(⊥, a) = (L, ⊥) ∧ (R, ⊥). Clearly every tree is accepted at the state and rejected at ⊥. Game automata are a subfamily of alternating parity tree automata satisfying the constraint that, for each q ∈ Q and a ∈ Σ, the transition δ(q, a) = e has either the form e = (L, q L ) ∨ (R, q R ) or e = (L, q L ) ∧ (R, q R ) (see [10,11] for more information about this class of automata). Transitions of a game automaton A can be schematically depicted as in the figure above with the left-hand and right-hand diagrams representing the transitions (q, a) → (L, q L )∧(R, q R ) and (q, a) → (L, q L )∨(R, q R ), respectively. Deterministic automata are a subfamily of game automata satisfying the stronger constraint that, for each Introduction to meta-parity games In this Section we describe a class of stochastic processes called Markov branching plays (MBP's) [16,17] which, as we will observe, is closely related to game automata and will provide a method for calculating the probability of regular languages defined by such automata. For a quick overview, a procedure for computing the value associated with a MBP is presented as Algorithm 1, at the end of this section. The procedure for computing the probability of regular languages defined by game automata in presented as Algorithm 2 in the next section.
We assume familiarity with the standard concepts of Markov chain and two-player stochastic (2 1 2 -player) parity game (see, e.g., [6]). Ordinary 2 1 2 -player parity games are played on directed graphs whose set of states is partitioned into Player 1, Player 2 and probabilistic states. A 2 1 2 -player parity game with neither Player 1 nor Player 2 states can be identified with a Markov chain.
Two-player stochastic meta-parity games [16,17] generalize 2 1 2 -player parity games by allowing the directed graph to have two additional kinds of states called ∃-branching states and ∀-branching states. In this paper we will only consider 2 1 2 -player meta-parity games with neither Player 1 nor Player 2 states. Such structures, which thus constitute a generalization of Markov chains, are called Markov branching plays (MBP's). In what follows we provide a quick description of MBP and refer to [16] for a detailed account. Lastly, the function P ar : S → ω is the parity (or priority) assignment.
Recall that a Markov chain represents the stochastic process associated with a random infinite walk on its set of states. A MBP represents the more involved stochastic process, described below, of generation of a random unranked and unordered tree T whose vertices are labeled by states of the MDP.
MBP's as Stochastic Processes: given a MBP M = (S, E), (S P , B ∃ , B ∀ ), p, P ar and an initial vertex s 0 ∈ S, the stochastic process of construction of T is described as follows.
The construction starts from the root of T which is labeled by s 0 .
A leaf x in the so far constructed tree T is extended, independently from all other leaves, depending on the type of its labeling state s, as follows: If s ∈ S P then x is extended with a unique child which is labeled by a successor state s of s randomly chosen in accordance with p(s). If s ∈ B ∃ or s ∈ B ∀ and {s 1 , . . . , s n } are the successors of s in M, then x is extended with n children y 1 , . . . y n and y i is labeled by

Figure 2
The stochastic process associated with the MBP in Figure 1. We give in Figure 1 an example of a MBP. Probabilistic states, ∃-branching and ∀-branching states are marked as circles, diamond and boxes, respectively. The first six initial steps of the stochastic process associated with M at state q 1 are depicted in Figure 2. In the first step, the construction of T starts by labeling the root by q 1 . Since q 1 is a probabilistic state, the tree is extended (second step) with only one child labeled by either q 2 (with probability 1 3 ) or q 3 (prob. 2 3 ). The picture shows the case when q 2 is chosen. Since the new leaf is labeled by q 2 , and this is a ∃-branching state, the tree is extended by adding one new vertex for each successor of q 2 in M, i.e., for both q 1 and q 4 . The construction continues as described above. For example, the probability that the generated infinite tree will have the prefix as at the bottom right of Figure 2  Each branching play T can itself be viewed as an ordinary (infinite) two-player parity game G(T ), played on the tree structure of T , by interpreting the vertices of T labeled by ∃-branching and ∀-branching states as under the control of Player ∃ and Player ∀, respectively. All other states (i.e., those labeled by a probabilistic state) have a unique successor in T to which the game G(T ) progresses automatically. Lastly, the parity condition associated to each vertex corresponds to the parity assigned in M to the state labeling it. We denote with W s the set of branching plays starting at s and winning for Player ∃, i.e., the set defined as: W s = T ∈ BP(M, s) | Player ∃ has a winning strategy in G(T ) . We remark that the above definition is valid because the set W s is µ-measurable for every Borel measure µ on the space BP(M, s) ( [12]) and thus also for µ M .

How to compute the value of a MBP
In this subsection we show how the values val(M, s) can be computed. The algorithm is based on a result of [16,17], formulated as Theorem 10 below, characterizing such values as the solution of an appropriate system of (least and greatest) fixed-point equations. and denote the usual operations of sum and product on reals. We also use a "coproduct" operation defined as i∈I x i = 1 − i∈I 1 − x i .

Proposition 8. The equality val
Proof. Here we sketch the main idea of the argument, for a formal proof, see Theorem 4.22 of [17]. If s i is a probabilistic state, then val i is the weighted average of the value of its successors, since the stochastic process associated with the MBP chooses a unique successor s j of s i with probability p(s i )(s j ). If s i is a ∀-branching state, then val i is the probability that all independently generated subtrees are winning for Player ∃ and this is captured by the expression. Similarly, if s i is a ∃-branching state then val i is the probability that at least one generated subtree is winning for Player ∃, as formalized by the expression. Hence the vector val is one of the fixed-points of the function f : [0, 1] n → [0, 1] n . Theorem 10 below refines Proposition 8 by identifying val as the unique vector satisfying a system of nested (least and greatest) fixed-point equations. Its formulation closely follows the notation adopted in the textbook [1, §4.3] for presenting a similar result valid for ordinary parity games. To adhere to such notation, we will define a function g, a variant of the function f presented above. Let k = max{P ar(s) | s ∈ S} and l = min{P ar(s) | s ∈ S} be the maximal and minimal priorities used in the MBP, respectively, and let c = k − l + 1.
The function g depends, like the function f , only on n variables {x P ar(s1) 1 , . . . , x P ar(sn) n } appearing in the body of its definition. The input of g can indeed be regarded as the input of f divided in c baskets, where each variable x i is put in the basket corresponding to the priority of s i , for 1 ≤ i ≤ n.
The set [0, 1] n , equipped with the pointwise order defined as (x 1 , . . . , x n ) ≤ (y 1 , . . . , y n ) ⇔ ∀i.(x i ≤ y i ), is a complete lattice and the function g is monotone with respect to this order in each of its arguments. Hence the Knaster-Tarski theorem ensures the existence of least and greatest points. We are now ready to state the main result regarding the values of a given MBP. We adopt standard µ-calculus notation (see, e.g., [1] and [16,17]) to express systems of least and greatest fixed-points equations.

is a least-fixed point operator (µ) if i is an odd number and a greatest-fixed point operator if (ν) if i is even.
Proof. The proof goes by induction on the number of priorities in the MBP M and by transfinite induction on a rank-function defined on the space of branching plays. See [16] for a detailed proof.
The next theorem states that the value of a MBP is computable and is always a vector of algebraic numbers. The examples discussed in Section 5 will illustrate the applicability of this result. Proof. (sketch) Using known ideas (see, e.g., Lemma 9 in [9] and Proposition 4.1 in [18]) the unique vector val = (val 1 , . . . , val n ) satisfying the system of fixed-point expressions S given by Theorem 10 can be computed by a reduction to the first-order theory of real closed fields. A first order formula F (x 1 , . . . , x n ), inductively defined from S, is constructed with the property that (val 1 , . . . , val n ) ∈ R n is the unique vector of reals satisfying the formula F (x 1 , . . . , x n ). By Tarski's quantifier elimination procedure [24], the formula F (x 1 , . . . , x n ) can be effectively reduced to an equivalent formula G(x 1 , . . . , x n ) without quantifiers, that is, to a Boolean combination of equations and inequalities between polynomials over (x 1 , . . . , x n ). It then follows that the (val 1 , . . . , val n ), which can be extracted from G with standard methods, is a vector of algebraic numbers. In Section 5 we apply the above procedure to a number of examples.

From Game Automata to Markov Branching Plays
In this section we present a reduction of the problem of computing the probability of regular languages definable by game automata to the problem of computing the value of a given MBP, which is algorithmically solvable using Algorithm 1. We now describe how to construct from a game automaton A = (Q, q 0 , δ, π) over the alphabet Σ a corresponding MBP M = (S, E), (S P , B ∃ , B ∀ ), p, P ar . The set S of states of M contains a probabilistic state s q , for each q ∈ Q, a ∃-branching state s q,a for each pair (q, a), with q ∈ Q and a ∈ Σ, such that δ(q, a) = (L, q L ) ∨ (R, q r ), and a ∀-branching state s q,a for each pair (q, a) such that δ(q, a) = (L, q L ) ∧ (R, q r ). The transition relation E is defined as follows: a probabilistic state s q has as successors the states {s q,a | a ∈ Σ}, a ∃-branching (resp. ∀-branching) state s q,a have two successors s q1 and s q2 where δ(q, a) = (L, q 1 ) ∨ (R, q 2 ) (resp. δ(q, a) = (L, q 1 ) ∧ (R, q 2 )). Note that each state s q , for q ∈ Q has exactly |Σ| successors and that each state s q,a has exactly 3 two successors. The assignment p : S P → (S → [0, 1]) is defined as assigning to each probabilistic state (i.e., state of the form s q ) a uniform distribution over its successors, that is, p(s q )(s q,a ) = 1 |Σ| . Lastly, the parity assignment P ar : S → ω of the MBP M is defined as in the parity condition π of the game automaton A by the mapping P ar(s q ) = P ar(s q,a ) = π(q).
The corresponding MBP M is schematically 4 depicted in Figure 3 (right), by representing probabilistic states with circles, ∀-branching states with boxes and the probabilistic assignment p by the probabilities labeling the outgoing edges of probabilistic states. The soundness of our reduction is stated as follows.
Theorem 12 (Correctness of Reduction). Let L be a regular language recognized by a game automaton A and let M be the MBP corresponding to A. Then µ(L) = V al(M, s q0 ), where q 0 is the initial state of A.
Proof. (sketch) Since each probabilistic state has exactly one successor for every letter a ∈ Σ and each branching state have precisely two successors, there exists a one-to-one correspondence between Σ-trees t ∈ T Σ and branching plays T ∈ BP(M, s q0 ). Furthermore, it follows directly from the definition of acceptance by A (see Section 2.2) and the definition of the set W s (see Section 3) that t is accepted by A if and only if the corresponding branching play T is in W s . Lastly, due to the uniform assignment p of probabilities in M, the coin-flipping measure µ on T Σ and the probability measure µ M on BP(M, s q1 ) are identical.
The result of Theorem 1 in the Introduction then follows as a corollary of Theorem 12 above and the fact that the vector of values of a MBP can be computed using Algorithm 1. The final algorithm for computing the probability of regular languages definable by game automata is then as follows.

1:
i n p u t : a game automaton A = (Q, q0, δ, π) r e c o g n i z i n g a l a n g u a g e L . o u t p u t : a real number corresponding to µ(L) .

Examples
In this section we will apply Algorithm 2 to analyze examples which will prove Propositions 2, 3 and 4 stated in the Introduction. In some instances, in order to perform the quantifier elimination procedure required by Algorithm 1, we use the tool qepcad [5]. We fix the alphabet Σ = {a, b, c} and, for each n ∈ ω, we define the regular language L n ⊆ T Σ as L n = {t ∈ T Σ | a appears ≥ n times on every branch of t} and the language L ∞ as L ∞ = n∈ω L n , i.e., as the set of Σ-trees having, on every branch, infinitely many occurrences of the letter a.

An introductory example
The language L 1 is recognized by the deterministic automaton in Figure 4 (left) defined as is an accepting sink state (see Section 2.2 for automatarelated definitions), the priority assignment is π(q 1 ) = 1 and the transition function δ 1 is defined on q 1 as δ 1 (q 1 , a) = (L, ) ∧ (R, ) and δ 1 (q 1 , l) = (L, q 1 ) ∧ (R, q 1 ) for l ∈ {b, c}. g(  We will compute the probability µ(L 1 ) using the procedure of Algorithm 2. As a first step we construct the MBP M 1 corresponding to A 1 , as specified in Section 4. In order to improve readability, we have represented in Figure 4 (center) a simplified version of M 1 where the states s , s ,a , s ,b and s ,c have been identified with the single state s q1,a . This is convenient since, clearly, all of these states have value 1. Accordingly, the MBP M 1 has four states, all of priority 1. Following the procedure of Algorithm 2 we need to compute the values of the states of M 1 using Algorithm 1. In accordance with Theorem 10, the fixed-point equation characterizing the vector val = (val sq 1 , val sq 1 ,a , val sq 1 ,b , val sq 1 ,c ) of values of the states of M 1 is val = µ x.g( x), where g is defined as in Figure 4 (right). Then val sq 1 is the least solution in [0, 1] of the equation x = 1 3 + 2 3 x 2 . As it is simple to verify, even without running the solver based on Tarski's quantifier elimination procedure, the solution is val sq 1 = 1 2 , and this is the output returned by Algorithm 2. Hence the probability of L 1 is µ(L 1 ) = 1 2 .

Examples of regular languages having irrational probabilities
This subsection constitutes a proof of Proposition 2. The automaton A 2 recognizing the language L 2 is defined as A 2 = ({q 1 , q 2 , }, q 2 , δ 2 , π) where q 2 is the initial state, the priority function is defined as π(q 1 ) = π(q 2 ) = 1 and the transition function δ 2 is defined on q 1 as the function δ 1 of the previous example, and on the state q 2 as δ 2 (q 2 , a) = (L, q 1 ) ∧ (R, q 1 ) and δ 2 (q 2 , l) = (L, q 2 ) ∧ (R, q 2 ), for l ∈ {b, c}. The transition δ 2 is shown in Figure 5 (left). The MBP M 2 corresponding to A 2 extends the MBP M 1 of the previous example with the probabilistic state s q2 and the three ∀-branching states s q2,a , s q2,b and s q2,c . The new part of the automaton A 2 is depicted in Figure 5 (center). Noting the four new states are not reachable by the other states already present in M 1 , we already know that val sq 1 = 1 2 . Hence we can consider the simplified system of fixed-point equations µ x.g( x) for calculating the values val = (val q2 , val q2,a , val q2,b , val q2,c ) where g is defined in Figure 5

Example of a comeager language of probability 0
This subsection constitutes a proof of Proposition 3. The regular language L ∞ is recognized by the (deterministic) game automaton already defined in Section 4 and depicted in Figure 3 (left), where the states q 1 and q 2 have priority 1 and 2, respectively. The MBP associated with this automaton, depicted in Figure 3 (right), has eight states. The vector of values val is equal to ν y 2 .µ y 1 .g( y 1 , y 2 ) where 3 y 2 + 1 3 y 4 y 5 · y 5 y 1 · y 1 y 1 · y 1 1 3 y 5 + 1 3 y 1 + 1 3 y 1 y 5 · y 5 y 1 · y 1 By straightforward simplifications we obtain the system of fixed-point equations in the two variables x 1 and x 2 (corresponding to the variables y 1 , representing s q1 , and y 5 , representing s q2 ). The execution 6 of Algorithm 1 reveals that the solution of the system of equations is (0, 0). Hence val sq 2 = 0 and this shows that the probability µ(L ∞ ) of the language L ∞ is 0.  The family of regular languages W i,k , indexed by pairs i < k of natural numbers, constitutes a tool for investigating properties of regular languages using topological methods ([2, p. 329], see also [3,4,12]). The standard game automaton A i,k over the language Σ i,k = {∀, ∃}×{i, i+1, . . . , k−1, k} accepting W i,k ⊆ T Σ i,k is defined as A i,k = Q, q i , δ, π where Q = {q i , q i+1 , . . . , q k }, the initial state is q i and, for each i ≤ j ≤ k, the state q j has priority π(q j ) = j and the transition function δ is defined on q j as in Figure 6. Our proof of Proposition 4, stated in the Introduction, goes by analyzing the system of fixed-point equations associated with the game automaton A i,k . Importantly, such a system consists of linear equations and not, as in the general case, of higher order polynomials. This system can be solved using standard techniques of linear algebra. A detailed proof of Proposition 4 can be found in Subsection 5.6 of [15].

Conclusion
In this work we presented an algorithm for computing the probability of regular languages defined by game automata. The Probability Problem in its full generality remains open. A possible direction for future research is to investigate approximations of regular languages by simpler regular languages. For example, given a regular language L of trees, is it possible to find a regular language G defined by a game automaton such that L G = (L \ G) ∪ (G \ L) is of probability 0, i. e. L differs from G by a set of probability 0? An effective answer to this question, that is an algorithm constructing a language G from L, combined with the algorithm described in this paper would lead to a full solution to the Probability Problem.