5.4 Model Checking the Counting Logic on TPPDSs
5.4.3 Reducing to Counter Parity Games
To conclude the proof of Theorem 5.4.1, we use the affine counter updates introduced above to transform ̂MCinto a finite counter parity game. As we proved in Chapter 3, such games can be solved effectively, and accordingly, the counting logic Qµ[#MSO] is decidable over TPPDSs.
Constructing ̃MC Let again ψ be the Qµ[#MSO] formula and let T be the TPPDS with initial state q, and let t be the initial tree. Let further ̂MCbe as defined above.
First of all, we fix an enumeration #x1φ1, . . . , #xnφn of the counting
terms in Sub(ψ). Let now ki, Ii, Ei and upi
r (r ∈ R) be the vectors and
functions for #xiφi according to Theorem 5.4.8. Combine the initial vectors
to a new vector I = ⟨I1, . . . , In⟩ of dimension ∑n
i=1ki, and compose the update
functions accordingly:
upr(⟨c1, . . . , cn⟩) ∶=⟨upr1(c1), . . . , upnr(cn)⟩.
As for the evaluation vectors Ei, we extend these to vectors ̃Ei by inserting
0s at all positions not belonging to the respective positions for ki. Note that
it now holds that
⟦#xiφi⟧
tr1...rs = ̃Ei⋅ (up
rs○ ⋅ ⋅ ⋅ ○ upr1)(I). (5.2)
The counter parity game ̃MCis obtained from ̂MCby replacing every edge label r by the respective affine function upr, and by updating the terminal
function τ such that at terminal positions belonging to a positive occurrence of the counting term #xiφi, the payoff is ̃E
i⋅ c for the respective current
counter value, while at positions for a negated counting term¬#xiφi it is
− ̃Ei⋅ c. (Technically, this is achieved via the introduction of dummy nodes
along which the counters are updated according to ̃Ei, and stored in a single
Lemma 5.4.9. Let ψ ∈ Qµ[#MSO] and let T be a TPPDS. Let q ∈ Q be an initial state, and t an initial tree. Let ̂M C and ̃MCbe defined as above. Then, for the respective initial state q′, val̂MC(q′,) = val̃MC(q′,).
Proof. Note that for corresponding plays, the payoffs in ̂MCand ̃MCcoincide due to Equation 5.2. As the correspondence between plays, moves, and strate- gies is a one-to-one correspondence, this means that values are preserved as well, and the games are equivalent.
Proving the main theorem Combining the results of the previous sec- tions, the decidability result of Qµ[#MSO] on TPPDSs follows.
Proof of Theorem 5.4.1. For a given formula ψ and a TPPDS T with initial state q and initial tree t= Q, we construct the counter parity game ̃MC. By Lemma 5.4.9 and Lemma 5.4.2, the value of ̃MCfrom the respective starting position coincides with the value of the formula at the initial configuration. By Theorem 3.2.1, the value of ̃MCcan be computed.
5.5
Summary
In this chapter we introduced structure transition systems, which model computation in such a way that the data parts of the system are separated from the temporal aspects and made available as relational structures. We then defined the format in which logics for such systems should be given, and defined a counting logic based on counting terms of monadic second- order logic and the quantitative µ-calculus. For the class of tree-producing pushdown systems, which is a class of systems that generalizes the class of pushdown systems in that the stack is used to store rules that rewrite trees, we proved that the counting logic is decidable. This we did by considering the model-checking game and by introducing a way to iteratively evaluate counting terms using counter update functions upon every application of a rewriting rule. At last, we used the decidability result for counter parity games from Chapter 3 to obtain the value.
A Quantitative Counting Variant
of Monadic Second-Order Logic
In the previous chapter, we presented a counting logic for structure transition systems. The logic is based on the quantitative µ-calculus, and extends it with counting terms of monadic second-order logic. In the present chapter, we consider monadic second-order logic directly, and define a quantitative variant where the emphasis is again on a counting mechanism. Although this logic is inspired by other extensions of MSO (for example, costMSO and MSO+U), we follow the approach used for the quantitative µ-calculus, as we keep the standard definitions of the semantics, but change the domain of evaluations from true and false to the natural numbers (with∞).
This chapter is based on joint work with Łukasz Kaiser, Martin Lang and Christof Löding, and the results have been submitted for publication [62].
6.1
Syntax and Semantics
As in the case of Qµ, formulas of the new extension, which we call qcMSO, are syntactically very close to formulas of traditional MSO. However, as this simplifies the proofs, we define the logic based on the variant MSO0 of
monadic second-order logic where all variables are second-order. Note that a translation to classical MSO with first-order variables and back is possible.
Accordingly, to be able to simulate first-order variables, we not only have relations and the usual operators, but also have a binary relation∈ to denote set membership, and a unary construct= ∅ to test sets for emptiness. The quantitative aspects are introduced using the operator∣ ⋅ ∣, which counts the size of a set. As in this context it is rather unclear what negation should mean, we omit negation, but add constructs to compare evaluations of subformulas to∞. As we explain later, this allows us to simulate negation on formulas with
⟦RX⟧A,β=⎧⎪⎪ ⎨⎪⎪ ⎩ ∞, β(X) ∈ RA 0, otherwise ⟦X ∈ Y ⟧ A,β=⎧⎪⎪⎪⎪ ⎨⎪⎪⎪ ⎪⎩ ∞, β(X) = {a}, a∈ β(Y ) 0, otherwise ⟦∣X∣⟧A,β= ∣β(X)∣ ⟦X = ∅⟧A,β=⎧⎪⎪ ⎨⎪⎪ ⎩ ∞, β(X) = ∅ 0, β(X) ≠ ∅ ⟦φ ∧ ψ⟧A,β= min(⟦φ⟧A,β,⟦ψ⟧A,β) ⟦φ ∨ ψ⟧A,β= max(⟦φ⟧A,β,⟦ψ⟧A,β)
⟦φ = ∞⟧A,β=⎧⎪⎪ ⎨⎪⎪ ⎩ ∞, ⟦φ⟧A,β= ∞ 0, otherwise ⟦φ < ∞⟧ A,β=⎧⎪⎪ ⎨⎪⎪ ⎩ ∞, ⟦φ⟧A,β< ∞ 0, otherwise ⟦∃Xφ⟧A,β= sup A′⊆A⟦φ⟧ A,β∪{X↦A′} ⟦∀Xφ⟧A,β= inf A′⊆A⟦φ⟧ A,β∪{X↦A′}
Figure 6.1: Semantics for qcMSO
Boolean evaluations. Formally, the formulas of qcMSO are built according to the following grammar:
ψ∶∶=RX ∣ X ∈ X ∣ ∣X∣ ∣ X = ∅ ∣ ψ∧ ψ ∣ ψ ∨ ψ ∣ ψ = ∞ ∣ ψ < ∞ ∣ ∃Xψ ∣ ∀Xψ.
Following the extension approach already used for Qµ, we define the semantics in a way similar to the classical MSO case. However, as we focus explicitly on counting—keeping questions like boundedness in mind—and treat negation differently, we use N∪ {∞} as the domain for evaluating formulas. (Note that∞ is needed to properly define suprema.)
Thus, given a relational structure A= (A, R1, . . . , Rn) and an evaluation
βof the second-order variables, the semantics is given in Figure 6.1.
On several occasions, especially regarding decidability, we do not con- sider the full logic qcMSO, but its weak variant qcWMSO: As in the case of WMSO, quantification in qcWMSO is restricted to finite sets. Formally, in the semantics of∃ and ∀, A′⊆ A is changed to A′⊆ A, ∣A∣ < ∞.