MSO with tests and reducts

Tests added to Kleene algebra (by Kozen and others) are considered within Monadic Second Order logic over strings, where they are likened to statives in natural language. Reducts are formed over tests and non-tests alike, specifying what is observable. Notions of temporal granularity are based on observable change, under the assumption that a finite set bounds what is observable (with the possibility of stretching such bounds by moving to a larger finite set). String projections at different granularities are conjoined by superpositions that provide another variant of concatenation for Booleans.


Introduction
Regular languages can be studied declaratively through formulas of Monadic Second-Order logic over strings (MSO; e.g., Libkin, 2010) or through equations built with the constructs +, ·, * , 0, 1 of a Kleene algebra (KA; e.g., Kozen, 1994). A KA with a subalgebra of tests forming a Boolean algebra is a KA with tests (KAT; e.g., Kozen, 1997). Tests are identified below with statives that serve as a basis for the approach to temporal semantics in linguistics initiated in Dowty (1979). This identification is justified by (i) a guarded string interpretation of KAT (Kozen and Smith, 1996), in which tests form states, as conceived in Propositional Dynamic Logic (PDL, Fischer and Ladner, 1979), and (ii) a notion of homogeneity associated (by Dowty and other linguists) with statives, and linked below to tests under a conception of time as observable change. These two points are developed below in MSO using reducts. Kozen and Smith's definition of guarded strings is reformulated so that ( †) the MSO-sentence ϕ picking out guarded strings over actions Σ and tests B does not mention B (or their Boolean complements), asserting only that exactly one action occurs at every position except for the final one, where no action occurs. Precisely what ( †) means is taken up in section 2, with the help of reducts. Why ( †) is significant becomes plain in section 3, where the reformulation is used to clarify the connection with tests and states in PDL. 1 A notion of temporal granularity based on observable change in MSO is built on projections that compress reducts. These projections are applied in section 4 to generalize interval networks from (Allen, 1983).

Guarded strings, MSO and reducts
For any finite set Σ, let Reg Σ be the set of languages over the alphabet Σ accepted by finite automata. Then Reg Σ , ∪, ·, * , ∅, is a KA -arguably, the Σ-canonical KA. For a KA with tests, we start in §2.1 with a finite set B of tests, and present the free Boolean algebra generated by B in terms of powersets 2 X of sets X. Strings over the alphabet 2 B∪Σ are then used in §2.2 for an extension to a KA. This deviates tellingly from Kozen and Smith (1996)'s presentation of guarded strings over the alphabet Σ ∪ B ∪ B with Boolean complements B of B, reviewed in §2.3. The deviation is natural from the perspective of MSO, which is brought into the picture along with reducts in §2.4.

Finite free Boolean algebras
Given a set B, the set T B of Boolean terms over B is the smallest set ⊇-containing B ∪ {0, 1} that is closed under the binary connectives +, · and the unary connective c (for complements). Assuming B is finite, the free Boolean algebra generated by B is (with addition ∪, multiplication ∩, and complement 2 B \ X of a subset X of 2 B ). A B-atom is a subset q of B, and is used to interpret Boolean terms over B as follows and for terms t, t ∈ T B ,

Guarded strings of sets
Next, given a set Σ disjoint from T B , Σ ∩ T B = ∅, let the set T Σ,B of (Σ, B)-terms be the smallest set containing Σ ∪ T B that is closed under the binary connectives +, · and the unary connective * .
(i) For any string s of length > 0, let α s be the symbol that occurs first in s.
(ii) For any symbol q and language L, let L[q] be the set of strings that, with q attached to the right, belong to L L[q] := {s | sq ∈ L}. Now, given sets L and L of strings of length > 0, the Σ-fused product of L and L is the set of strings ss from s ∈ L and s such that sq ∈ L where q is α s \ Σ. That is, where · Σ is a partial binary function on strings of length > 0 such that Notice that if L and L are both sets of B-atoms, then their Σ-fused product is just their intersection where the Σ-asterate Σ is the Σ-fused analog of Kleene star

Strings in place of sets
Guarded strings in Kozen and Smith (1996) are conceived over an alphabet different from 2 B∪Σ by fixing a string b 1 · · · b n that enumerates without repetition (making n the cardinality of B). Each b ∈ B is paired with a fresh test b, relative to which a B-atom q ⊆ B can be understood as n choices c 1 · · · c n between b i and b i , with 2 B is repackaged as the language of guarded strings over Σ and B, with alphabet In place of the Σ-fused product • Σ , we have the coalesced product n L n L := {sŝs | sŝ ∈ L,ŝs ∈ L and length(ŝ) = n}.
Inasmuch as the two KATs over 2 G B Σ and 2 G Σ,B are isomorphic, it is tempting to dismiss the difference recorded in Table 1 as cosmetic. Nonetheless, there are reasons for preferring 2 B over A B from the perspective of MSO, a natural home for Boolean tests, with or without atoms.

MSO and reducts
Given a finite set A, an MSO A -model is understood (in this paper) to be a structure [n], S n , {U a } a∈A over the set [n] := {1, . . . , n} of integers from 1 to n (for some positive integer n), with the successor relation , and for each a ∈ A, a subset U a of [n]. We can identify [n], S n , {U a } a∈A with the string α 1 · · · α n over the alphabet 2 A given by making U a the set of positions where a occurs To construe a string a 1 · · · a n ∈ A + as an MSO Amodel, we lift it to a 1 · · · a n ∈ (2 A ) + , drawing boxes instead of curly braces {, } for sets qua string symbols, as opposed to sets qua languages. 2 Given a string s over the alphabet 2 A and a subset Indeed, we can describe G B Σ by embedding Σ into 2 Σ∪B via or by MSO A -formulas built with unary predicate symbols P a labeled by a ∈ A and the binary predicate symbol S (for successors).
Proposition 1. For any disjoint sets Σ and B, (saying no two symbols from Σ occur at x).
Note that ∀xχ Σ (x) is an MSO Σ -sentence stating ( †) exactly one symbol from Σ occurs at every string position except for the last position, where no symbol from Σ occurs.
Inasmuch as ( †) describes a very particular encoding of guarded strings (applicable to G B Σ but not to G Σ,B ), it is natural to ask: can we motivate ( †) without resorting to details of encoding? We will argue in section 3 that we can, observing for now that χ Σ (x) makes no mention of B (belonging, as it does, to MSO Σ ).
The price for working with as opposed to Kozen and Smith (1996) is a complication in the alphabet of strings interpreting MSO A from A to 2 A . But since MSO Amodels are already strings over 2 A , that price has already been paid. Rather it is the step from G B Σ to G Σ,B that is costly, complicating the label set A with a set B of labels for complements of B. It is telling that a string in G Σ,B satisfies the MSO {b,b}biconditionals only at positions x where b or b occurs. By contrast, every string in G B Σ can be expanded to a MSO Σ∪B∪B -model satisfying . A crude measure of the complexity of a regular language L ⊆ (2 A ) + is given by Proposition 2. For any finite set A and regular language L ⊆ (2 A ) + , there is a smallest subset A of A such that for some MSO A -formula ϕ, Proposition 2 follows from ( ‡) for all strings s ∈ (2 A ) + , subsets A of A and MSO A -formulas ϕ, Provable by induction on ϕ, ( ‡) is an instance of the satisfaction condition characteristic of institutions (Goguen and Burstall, 1992), to which we shall return in §3.3 below.
If the least set A that Proposition 2 associates with L is called the grain of L, then G B Σ has grain Σ (by Proposition 1 and a moment's reflection). Not so the regular language G Σ,B , whose image under the map a 1 · · · a n → a 1 · · · a n has grain Σ ∪ B ∪ B. Proposition 1 consigns B to the background (using MSO's propositional connectives to interpret the Boolean structure of a KAT), drawing all attention to Σ. Indeed, as conceived in PDL, tests belong in Σ -or so we argue in the next section (pace Kozen) The remainder of this section fleshes out, for and is best skipped by readers for whom χ Σ (x) is ugly enough. We let ψ B Σ be ∀x ψ Σ,B (x) for ψ Σ,B (x) given with the help of some abbreviations. For A ⊆ A, let one A (x) be the MSO disjunction one A (x) := a∈A P a (x) saying some symbol from A occurs in position x, and let atm B (x 1 . . . x n ) abbreviate formula ϕ action in Σ program (e.g., test ϕ?) B-atom ⊆ B state ∈ Q guarded string input/output pair ∈ Q × Q  (2) says b n + b n can only be followed by a symbol from Σ ∀y(one {bn,bn} (x) ∧ xSy ⊃ one Σ (y)) (2) (allowing for the case where x is the last position of the string), and (3) puts atoms before and after x whenever a symbol from Σ occurs at x and after B (x) abbreviates ∃x 1 · · · ∃x n (xSx 1 ∧ atm B (x 1 . . . x n )).

Tests and observable change
A test in PDL is a program ϕ? built from a proposition ϕ, where, given a set Q of states, where is the KAT counterpart of ϕ? in Σ, which is assumed disjoint from the set B of Booleans?
The present section fills this gap by introducing for every b ∈ B, a test ?b that is interpreted the way an action p in Σ is in KAT, albeit with more care than the "anything-goes" clause that accepts any input/output pair q, q . To regulate the changes effected by an action in Σ, we introduce a labeled transition relation and interpret each p ∈ Σ as the subset writing E(q, p, q ) and (q, p, q ) ∈ E interchangably). The "anything-goes" interpretation is the special case But to capture the meaning of a test ?b in the manner PDL does for ϕ?, we require that E(q, ?b, q ) =⇒ b ∈ q and q = q for all q, q ⊆ B. To align the interpretation closer to the input/output semantics of PDL programs, we will interpret and form B-reducts (removing actions p ∈ Σ buried in guarded strings) before compressing them (according to bc from §3.1).

Regulated programs including tests
Given sets Σ and B, and for every b ∈ B, a label ?b ∈ Σ ∪ B such that We can then extend any set E ⊆ 2 B × Σ × 2 B to and pick out the subset G E (pronounced "G restricted by E") of G to interpret a term t from T Σ ] E , a few definitions are helpful. Let us call a string α 1 · · · α n stutterless if α i = α i+1 for all i ∈ [n − 1]. The block compression bc(s) of a string s = α 1 · · · α n deletes from s every α i such that α Clearly, bc(s) is stutterless and s is stutterless ⇐⇒ s = bc(s).  otherwise leaving t as is

Observable change
Also, let us say Σ is E-active if for every p ∈ Σ, E(q, p, q ) =⇒ q = q for all q, q ⊆ B (requiring that states change under p).
and assuming Σ is E-active, The two parts of Proposition 3 can be sharpened at the cost of complicating the notation.
Given p ∈ Σ, let us say p is Part 2 For all t ∈ T Σ,B , assuming that every p ∈ Σ from which t is formed is (E, C)-observable.

Actions for a specific Boolean
The condition that p is (E, C)-observable can be formulated in MSO C∪{p} as saying x and y can be separated by a unary predicate with label from C. Dropping the action p from (4) results in the requirement that every temporal step S change C ∀x∀y (xSy ⊃ diff C (x, y)) (ntc C ) designated (ntc C ) for the slogan no time without change C .
This slogan is behind the function bc C that maps a string s to the block compression of its C-reduct Proposition 4. For any C ⊆ A and s ∈ (2 A ) * , s |= (ntc C ) ⇐⇒ bc C (s) = s and bc C (bc C (s)) = bc C (s).
To understand the importance of the subscript C, recall that MSO satisfaction |= has the property ( ‡) for all strings s ∈ (2 A ) + , subsets C of A and MSO C -sentences ϕ, ( ‡) brings out a fundamental limitation of an MSO C -sentence ϕ, its insensitivity to differences between strings with the same C-reduct. The significance of the subscript C is easy to overlook when describing G E in MSO. Consider from Proposition 1, the χ Σ (x) conjunct banning two programs in Σ from occurring simultaneously at x. The problem with running p ∈ Σ simultaneously with ?b ∈ Σ at x is that the state transitions they describe under E B may clash. Indeed, programs in PDL and more generally, Dynamic Logic (Harel et al., 2000) are interpreted as executing in isolation; for instance, the PDL test ϕ? ensures the input state does not change, and a random assignment x :=? changes at most the value of x. In both cases, any change from a program running concurrently is ruled out. Put another way, χ Σ (x)'s conjunct ¬two Σ (x) expresses the assumption that each program in Σ is to be understood as covering all programs that might run at x.
By contrast, actions described in everyday speech are invariably partial in that (i) their effects are bounded, and (ii) they never occur in isolation.
Keeping (i) and (ii) in mind, and zeroing in on a specific Boolean b ∈ B, let us add labels l(b) and r(b) to Σ for actions that mark the left and right borders of b as follows.
More precisely, since for every b ∈ C, suppressing ∀x∀y to simplify the notation. Returning now to points (i) and (ii) above, notice that under (l b ) and (r b ), (i) the effects of l(b) and r(b) are confined to b and although Complex actions can be built from a finite set of b-specific actions l(b) and r(b), provided we stay away from the G B Σ postulate ¬two Σ (x), which effectively pretends actions are indivisible atoms.

Projections and superpositions
Having re-interpreted concatenation · as • Σ and n in section 2 so that its restriction to tests is Boolean conjunction, we present in this section yet another notion of conjunction for combining descriptions of change at varying granularities. We start with the descriptions in §4.1, computing their conjunctions in §4.2.

Some star-free descriptions
Given a subset C of some fixed set A (determining a fragment MSO A ) and a string s of subsets of C, let us agree the pair (C, s) describes the set of stutterless strings over the alphabet 2 A that bc C maps to s. 4 That is, if we gather together all stutterless strings over 2 A in To illustrate, for Next, we interpret a finite subset C of 2 A × L A as the intersection ] A is also star-free. Continuing the example above, if 2} consists of exactly 13 strings, one for each of the interval relations from Allen (1983), such as 2 1,2 2 depicting 1 during 2 4 The restriction here to stutterless strings is motivated by the Aristotelian dictum, no time without change, a Crelativization of which is enforced by bcC (Proposition 4).
(e.g., Fernando, 2016). Generalizing from 2 intervals to any integer n ≥ 2, we can extend the set to a partial function C from 2 [n] to L [n] , defined on certain pairs {i, j} which C maps to a string C({i, j}) depicting an Allen relation between i and j. The result is an interval network with node set [n] and edge set {C ∈ domain(C) | |C| = 2}, each C in which is labeled by the Allen relation depicted by C(C). We can label the edge C by a set L ⊆ L C if we loosen (C, s) to the pair (C, L), interpreted as the inverse image of L under bc C restricted to L A

Conjunction as superposition
We now define, for any subsets C and C of A, a binary operation & C,C on languages such that for all s ∈ L C and s ∈ L C , As a first stab, observe that if & • forms the componentwise union of strings of the same length α 1 · · · α n & • α 1 · · · α n := (α 1 ∪ α 1 ) · · · (α n ∪ α n ) then ρ C∪C (s) = ρ C (s) & • ρ C (s).

More projections
Recalling the KAT dichotomy between Booleans in B and actions in Σ (paralleling that between formulas and programs in Dynamic Logic 5 ) it should be noted that the sets C and C have been construed throughout to be subsets of B. The MSOformulas ∆ l b (x) and ∆ r b (x) introducing the actions l(b) and r(b) in §3.3 define a border translation from B to Σ under which bc becomes the removal d 2 of empty boxes underlying projections in the S-strings of Durand and Schwer (2008), with, for instance, the Allen relation 1 during 2 recast as l(2) l(1) r(1) r(2) (Fernando, 2019;Fernando and Vogel, 2019). This section has focused on bc (for tests/statives) to lighten the notation. We can adapt § §4.1, 4.2 for C, C ⊆ Σ, putting d 2 in place of bc.

Conclusion
The present paper is essentially an argument for interpreting MSO A relative to strings over the alphabet 2 A , rather than strings over the alphabet A. The latter smuggles in an assumption ∀x spec A (x) where spec A (x) is the MSO A (x)-formula a∈A (P a (x) ∧ a ∈A\{a} ¬P a (x)) specifying exactly one label from A for the string position x. For a KAT generated by Booleans B and actions Σ, the alphabet A may contain B ∪ Σ (not to mention B), with the guarded string interpretation in (Kozen and Smith, 1996) imposing spec B (x) and spec Σ (x) at various positions x, treating states as Boolean atoms (absent in an infinite free Boolean algebra) and actions as programs running in isolation (as in Dynamic Logic). Neither spec B (x) nor spec Σ (x) is necessary or desirable for applications where descriptions of states and actions are partial. Section 2 challenges spec B (x), slighting B with a Σ-reduct (Proposition 1), while section 3 puts notions of observable change (described in Propositions 3 and 4) ahead of spec Σ (x) to account for tests. Casting spec aside, section 4 compresses C-reducts, for C ⊆ B, and conjoins them by superposition. (More in Fernando, To appear.)