• No results found

Resource-Automatic Structures and FO+RR

6.3 Deciding qcWMSO on the Natural Linear Order

6.3.1 Resource-Automatic Structures and FO+RR

Resource-automatic structures extend the well-studied theory of automatic structures (see for example [1,81]) by so-called resources: being in a relation now involves a certain cost, and thus it may be expensive to satisfy a given formula. To model this, instead of classical nondeterministic finite automata (see Chapter 2.3), one uses B- and S-automata to define languages that represent the universe and the relations upon it. The introduction to resource- automatic structures is based on [72].

Definition 6.3.1. A B-/S-automaton is an NFAAB/AS = (Q, Σ, δ, q0, F)

that, additionally, is equipped with a finite set Γ of counters. Thus, the transition function is of the form δ∶ Q × Σ → P(Q × CΓ), where C is the set

of counter operations. For B-automata, we use CB = {ιc, r, n}, while for

S-automata one uses CS = {ι,cr, r, n}.

The notion of a run is as for NFAs, with the addition that a Γ-dimensional vector of counters is maintained. Upon each transition with counter opera- tions γ= γ1, . . . , γ∣Γ∣, the counter vector c∈ NΓis updated to γ(c): If γi= r,

then γ(c)i = 0. If γi = n, then γ(c)i = ci. If γi = ι , then γ(c)i = ci+ 1.

The actions ιc and cr update the counters just as the operations ι and r,

respectively. Additionally, however, they check the counter value ci: This

means that the counter value is added to the set Ci(ρ) of checked values for

counter i. These sets are used for the semantics, where R(A, w) is the set of accepting runs ofA on w: AB(w) ∶= inf ρ∈R(AB,w) sup(⋃ i∈Γ Ci(ρ)), AS(w) ∶= sup ρ∈R(AB,w) inf(⋃ i∈Γ Ci(ρ)).

Here, we make use of the convention that inf(∅) = ∞ and sup(∅) = 0. To work with these automata later, we use that one can effectively trans- form B- into S-automata, and vice versa:

Theorem 6.3.2([29, 30]). 1. Every B-automatonABcan be transformed

effectively into an equivalent S-automatonAS.

2. Every S-automatonAScan be transformed effectively into an equiva-

lent B-automatonAB.

Equivalence is understood as equivalent up to a monotone correction function α∶ N ∪ {∞} → N ∪ {∞} where α(x) = ∞ if and only if x = ∞: ABis

equivalent toAS, if there exists a correction function α∶ N ∪ {∞} → N ∪ {∞}

such that for all words w:AB(w) ≤ α(AS(w)) and AS(w) ≤ α(AB(w)).

Note that correction functions preserve boundedness: IfA is α-equivalent toA′, then for all L⊆ Σ:{A(w) ∣ w ∈ L} is bounded if and only if {A(w) ∣

w∈ L} is bounded.

6.3.1.1 Resource-Automatic Structures

Resource-automatic structures are (infinite) resource structures that are repre- sentable by B- and S-automata. A resource structure A= (A, R1, . . . , Rn) is an

extended relational structure, where relations are now functions Ri∶ Aar(Ri)→

N∪ {∞}. The intended meaning of this is that it may be costly for a tuple to be in a relation, and the cost is∞ if it is not in the relation at all.

To represent n-ary relations as words, we use n-tuples of letters, that is, the alphabet(Σ ∪ {◻})n, where◻ is a padding symbol that may only appear

at the end of words. For example, the tuple(0110, 01111100) is represented as the convolution

σ(0110, 01111100) ∶= 0 1 1 0 ◻ ◻ ◻ ◻

0 1 1 1 1 1 0 0 ∈ (Σ∪ {◻})

2.

For a formal definition of such convolutions and of the respective transducers, we refer to [72].

Definition 6.3.3. A resource structure A = (A, R1, . . . , Rn) is resource-

automatic, if there is a regular language L⊆ Σ∗= {0, 1}, a bijection π∶ L → A,

and B-automataA1, . . . ,Ansuch that for all i, and all tuples(a1, . . . , aar(Ri)):

Ri(a1, . . . , aar(Ri)) = Ai(σ(π

−1(a

1), . . . , π−1(aar(Ri)))).

Example 6.3.4. As an example for a resource-automatic structure, we con- sider the structure F= (FinPot(N), ∈, <, = ∅, ∣ ⋅ ∣) of finite subsets of natural numbers, together with the∈- and <-relations (technically, the respective complements) and a test for the empty set as well as a relation which evaluates to the size of set. Note that this structure will also be used in the reduction from qcWMSO to the extension of FO+RR.

As the regular language representing the universe, we take the set of all words ending with a 1, and the additional word 0 to represent the empty set, thus L= {0, 1}∗1∪ {0}. As for the bijection, a word w = w0. . . wn−1is

mapped to the set{i ∣ wi= 1}.

For the relation∈, we want that a ∈F b= ∞ if a is a singleton set which is

a subset of b, and a∈Fb= 0 otherwise. This amounts to a B-automaton that

can be viewed as an NFA which rejects all words { 00 , 0 1 } ∗ 1 1 { ◻ 0 , ◻1 } ∗ ,

and accepts all other words. Similarly, as a<F b = ∞ if and only if a and b

are singletons and the natural order holds on the respective elements, this amounts to an NFA which rejects all words

( 00 )∗ 10 (0 )∗ ◻1

and accepts otherwise. The automaton for= ∅ rejects only 0, and accepts all other words.

For∣ ⋅ ∣, we take a 1-counter B-automaton A, that accepts all words and increases the counter upon seeing a 1. Clearly,A(w) = ∣{wi ∣ wi = 1}∣.

6.3.1.2 FO+RR

In [72], the authors introduce a logic for resource-automatic structures based on classical first-order logic. As the syntax is precisely that of FO without negation, it suffices to give the definition of the semantics of this logic called FO+RR. The semantics closely follows the intuition that the further away from being in a relation a tuple is, the more costly it is, with∞ indicating that a tuple is not in the relation at all. This amounts to viewing 0 as true, and∞ as false.

As stated above, the syntax of FO+RR is precisely as the syntax of FO without negation. The semantics of FO+RR is given below, where A is a resource structure, and β is an interpretation of the free variables:

⟦Rx1. . . xn⟧A,β ∶= RA(β(x1), . . . , β(xn))

⟦φ ∨ ψ⟧A,β∶= min(⟦φ⟧A,β,⟦ψ⟧A,β) ⟦φ ∧ ψ⟧A,β∶= max(⟦φ⟧A,β,⟦ψ⟧A,β)

⟦∃xφ⟧A,β∶= inf a∈A⟦φ⟧

A,β∪{x↦a} ⟦∀xφ⟧A,β∶= sup

a∈A⟦φ⟧

A,β∪{x↦a}

Up to equivalence up to a correction function, the operators of FO+RR can be simulated by B- and S-automata. The key ingredient in the proof of the following theorem, which can be found in [72], is showing that automata for the projections in the convolutions—which correspond to the quantifiers—can indeed be constructed. This corresponds to a combination of the projections from [29, 30] and a kind of ϵ-transition elimination.

Theorem 6.3.5([72]). Given a resource-automatic structure A and the re- spective automata as well as an FO+RR sentence φ, it is decidable if⟦φ⟧A< ∞.