• No results found

A Counting Logic for STSs

As mentioned above, we introduce a counting logic whose qualitative ana- logue is Lµ[MSO]. In fact, we replace the modal by the quantitative µ-calculus as introduced in Section 2.4.3. Then, instead of using MSO-sentences, we count the size of definable relations via counting terms.

Definition 5.2.1. An MSO counting term is of the form #xφ(x), where

x= (x0, . . . , xn−1) is a vector of variables and φ(x) is a formula of MSO with

the free variables free(φ) = x. (Note that φ does not contain free second- order variables.) We denote by #MSO the set of all counting terms (for a given, but usually omitted, signature ζ).

Given a finite structure A, a counting term evaluates to the number of satis- fying tuples:

⟦#(x0,...,xn−1)φ⟧

A∶= ∣{(a

0, . . . , an−1) ∈ An∣ A ⊧ φ(a0, . . . , an−1)}∣.

Note that for an MSO sentence φ, we define⟦#φ⟧Ato be 1 if A⊧ φ, and

0otherwise. Although this may appear surprising at first, it is useful later, as it permits to write #φ instead of just φ for guards of other formulas. That is, we avoid the otherwise necessary removal of counting quantifiers in the construction, which makes the proofs more readable.

The counting logic we propose is thus Qµ[#MSO]. Despite its matching the general definition above, we give the syntax again for better readability. Formulas of Qµ[#MSO] are built according to the following grammar:

ψ ∶∶= #xφ∣ X ∣ ¬ψ ∣ ψ ∨ ψ ∣ ψ ∧ ψ ∣ ◻aψ∣ ◇aψ ∣ µX.ψ ∣ νX.ψ,

where #xφ∈ #MSO is a counting term. As before for Lµ, we require that

for every subformula µX.ϑ or νX.ϑ, X appears only positively within ϑ. When evaluated on an STS, counting terms are evaluated on the relational labelings of states, while the Qµ-parts of a formula are evaluated on the Kripke structure itself. Recall that¬ translates to the product with −1, while ∨ corresponds to max, ◇ato the supremum over a-successors and∧ and ◻a

Remark 5.2.2. Lµ[MSO] ⊆ Qµ[#MSO], that is, the qualitative combination of Lµ with MSO can be embedded in the quantitative version with counting terms.

Proof. Note that the semantics of Qµ corresponds to that of Lµ if the values of the quantitative atoms are restricted. Using the convention that true corre- sponds to∞ or 1, while false corresponds to −∞ or 0, a formula φ ∈ Lµ[MSO] in negation normal form can be translated to Qµ[#MSO] by replacing every positive MSO formula (which can only be a sentence) φ by #φ, and every ¬φ by #¬φ. Accordingly, the thus translated formula evaluates to ∞ or 1 using Qµ[#MSO] semantics if and only if φ evaluates to true.

5.2.1

Model-Checking Games

It was already mentioned in the preliminaries that there is a close connection between Qµ and quantitative parity games. As we make use of this connection in the decidability proof of our counting logic, we recall the definition of model-checking games for Qµ here, adapted to Qµ[#MSO].

Therefore note that from now on we assume that formulas of Qµ[#MSO] are in negation normal form concerning the Qµ part: Negation is thus allowed only to occur at counting quantifiers (¬#xφ). This is not a proper restriction,

as the dual of every operator is part of the syntax. Furthermore, we assume that every fixed point variable is bound only once.

Definition 5.2.3. Let ψ∈ Qµ[#MSO] and let S be a structure transition sys- tem such that the #MSO subformulas of ψ fit the signatures of the relational structures inS. Then MC(ψ, S) = (V, V0, V1, E, Ω, τ) is a quantitative parity

game with the following components:

• V = (S × Sub(ψ)), with Sub(ψ) denoting the set of Qµ[#MSO] sub- formulas of ψ (i.e., using #MSO formulas as atoms).

• Positions of the form (s, #xφ) or (s, ¬#xφ) are the only terminals,

and τ(s, #xφ) = ⟦#xφ⟧m(s), while τ(s, ¬#xφ) = −⟦#xφ⟧m(s).

• Positions where the outermost operator in the formula component is a disjunction or a◇ belong to Pl. 0, while all other positions are Pl. 1’s. • The edges are as follows:

E ∶={((s, φ △ ϑ), (s, φ)), ((s, φ △ ϑ), (s, ϑ)) ∣ △ ∈ {∨, ∧}} ∪ {((s, △aφ), (s′, φ)) ∣ (s, s′) ∈ Ta,△ ∈ {◇, ◻}}

∪ {((s, ξX.φ), (s, φ)) ∣ ξ ∈ {µ, ν}}

• Ω depends only on the formula component, and all but positions(s, X) for fixed point variables receive unimportant priorities. The priorities at positions(s, X) are even if X is bound by a ν and odd in the case of µ. Furthermore, the fixed point variable quantified outmost receives the lowest priority, and a variable that is quantified within the scope of another variable receives a higher priority.

In the game, Pl. 0 as usual tries to maximize the payoff, while Pl. 1 tries to minimize it. This corresponds to Verifier and Falsifier in the classical model checking game for Lµ.

For more details, and a proof of correctness of the following theorem, we refer to [45]. Note that we omitted the discounts in the version of the model checking game given above, as they are not needed for our purposes. Theorem 5.2.4([45]). Let φ∈ Qµ[#MSO] and let S be a structure transition system. Then val(MC(φ, S), (s, φ)) = ⟦φ⟧S(s).

5.2.2

Examples

Before we introduce the class of pushdown systems we show that Qµ[#MSO] is decidable on, let us consider some examples of formulas to understand the expressiveness of the logic.

A classical example of a formula of Lµ is the one expressing reachabil- ity. In the quantitative setting, when replacing the monadic target predi- cate by a counting term, the formula computes the maximum/supremum over the values the counting term reaches on paths: Consider the formula µX.#x(Ax) ∨ ◇X. When evaluated on a structure transition system whose

states are labeled with words (for example a pushdown graph), the formula computes the supremum over the number of A occurring in the words. That is, the formula evaluates to∞ at a given state s if for every n ∈ N there is a state s′ reachable from s such that m(s) contains at least n positions

labeled with A. For an illustration of the computation of the fixed point, see Figure 5.1.

Conversely, the formula νX.#x(Ax)∧ ◻X computes the minimal number

of A-occurrences reachable from a state. To see that larger growth rates are also possible, note that if #x(Ax) is replaced by #x,y(Ax∧Ay), then instead

of the number of occurrences of A, this number squared is considered.