Vincenzo Ciancia

Yde Venema

Stream automata are coalgebras

Stream automata (also called ω-automata) and ω-regular languages are of paramount importance in Computer Science and Logic. A coalgebraic treatment of these structures has not been given yet. We study a simple two-sorted setting where deterministic Muller automata can be cast as coalgebras, so that coalgebraic bisimilarity coincides with language equivalence. From this characterisation, we derive concise and natural decision procedures for complementation, union, intersection, and equivalence check.

Introduction

Finite state automata and their variants are among the most fundamental structures in Computer Science. Their applications range over a wide domain, including for instance controlling digital circuits, representing languages in formal language theory, parsing expressions in compilers, model-checking of software systems. Deterministic finite state automata (DFAs) are possibly the simplest finite memory machines, although they can represent infinite sets; part of their usefulness is that set-theoretical operations, such as complementation, union and intersection of languages can be implemented directly on DFAs.

DFAs are key examples of coalgebras [START_REF] Rutten | Automata and coinduction (an exercise in coalgebra)[END_REF]. The crucial observation is that they admit a universal model, namely the final coalgebra. States of the final coalgebra represent the regular languages. The most direct consequence of the coalgebraic presentation is that language equivalence coincides with bisimilarity, yielding a coinductive proof method to decide language equivalence. Applications range over a wide domain, including the probabilistic setting [START_REF] Bartels | A hierarchy of probabilistic system types[END_REF], and weighted automata [START_REF] Bonchi | Deriving syntax and axioms for quantitative regular behaviours[END_REF].

Stream automata (or ω-automata, see [START_REF] Pin | Infinite Words: Automata, Semigroups, Logic and Games[END_REF] for a comprehensive reference) accept languages of infinite words. Besides being a fundamental tool in the study of modal fixpoint logics, they are of vital importance in the field of automated program verification. There are various kinds of stream automata in the literature, among which we mention Büchi, parity and Muller automata, in their deterministic and non-deterministic variants. With the exception of deterministic Büchi automata, all these models accept the same class of languages, namely the ω-regular ones. The accepting condition is usually expressed in terms of the set Inf (ρ) of states that are passed infinitely often in a run ρ of the automaton on an infinite word. A coalgebraic formulation of stream automata would endow the theory of ω-regular languages with coinduction, a universal model, and possible generalisations, similarly to DFAs. However, such a characterisation is non-obvious, since the accepting condition of stream automata has non-local flavour: it depends on the whole structure of an automaton, not on single states.

In this paper we show that nevertheless it is possible to represent stream automata as coalgebras. We take Muller automata (DMAs) as the subject of our investigation, as they can express all the ω-regular languages, even if they are deterministic. The starting point is a well-known characterisation of ω-regular languages by their ultimately periodic fragment, that is, the set of infinite words of the form sl ω , consisting of the concatenation of a finite word s and a nonempty word l which is repeated infinitely many times. This result simplifies the theory of ω-regular languages, as one just needs to study languages of ultimately periodic words. Such words admit a finite syntactic representation as lassos, that is, pairs (s, l) representing the word sl ω .

In [START_REF] Calbrix | Ultimately periodic words of rational ωlanguages[END_REF], Calbrix, Nivat and Podelski proposed to describe the lasso languages corresponding to Büchi automata using automata over finite words, whose alphabet is augmented with a special symbol "$". The dollar syntactically represents the moment when an ultimately periodic word sl ω starts to repeat l. Well-formed automata only accept strings with a single occurrence of $, which ought not to be the last symbol in a word. We continue this program by taking a two-sorted coalgebraic perspective, that is, we define coalgebras whose state spaces live in a category of two-sorted structures. This improves on the existing characterisation as there is no need to augment the alphabet with a special symbol. The "switch" to the periodic part of a ultimately periodic word is semantically represented by changing the sort; thus no special conditions on accepted words are needed.

Technically, we present two results. First, we represent Muller automata as coalgebras for an endo-functor, called Ω, in the functor category Set 2 . The representation is such that language equivalence coincides with the coalgebraic formulation of bisimilarity. This is done in Section 3. The inclusion of DMAs into Ω-coalgebras is proper. More precisely, we call balanced those coalgebras whose states correspond in a suitable sense to ω-regular languages. The ones whose image in the final coalgebra is finite are (up-to bisimilarity) the image of DMAs into Ω-coalgebras. Balanced coalgebras are in a special form, which makes them accept bisimulation invariant lasso languages. Our second result is described in Section 4. Therein, we identify two conditions, namely circularity and coherence, that are equivalent to bisimulation invariance, and we characterise the coalgebras corresponding to DMAs as those that are circular and coherent, and have finite image in the final coalgebra.

The most basic application of coalgebras, in the presence of a final object, is a generalised notion of partition refinement, yielding minimisation up-to coalgebraic bisimilarity. When the states are finite, one obtains a decision procedure; this is the case for the coalgebras obtained from DMAs. We spell out the procedure in Section 5; in the same section, we go further in considering balanced coalgebras as acceptors of lasso languages, by showing that boolean operations are defined in a particularly simple and natural way.

Preliminaries

Here we recall the notion of deterministic Muller automaton and ω-regular language. For more background on these topics, the reader is referred to [START_REF] Pin | Infinite Words: Automata, Semigroups, Logic and Games[END_REF].

Remark 1 (Notation). We often omit parentheses in function (and functor) application, writing e.g. f x in place of f (x). We write X ∼ Y to signify that X is isomorphic to Y . We denote the set of natural numbers with the symbol ω. Throughout the paper, we fix a finite set C called the alphabet. We let C * be the free monoid over C, called the set of finite words, or just words, whose neutral element is the empty word . The length of a word u is denoted with |u|. We let C + = C * \ { } be the set of non-empty words, and C ω be the set of infinite words or streams over C, that is, the function space ω → C . Concatenation, denoted by juxtaposition, is defined over finite words as the binary operation of the monoid, and extended to uα, for u finite and α infinite, in the obvious way. For u ∈ C * , we let u ω be the stream that repeats u infinitely many times. For f : X → X C a (deterministic transition) function, we write x c -→ f y for y = f (x)(c), omitting the subscript f when clear from the context. The two projections of a binary product are written π 1 , π 2 . For f : X → Y × Z, we let

f 1 = π 1 • f and f 2 = π 2 • f (f is the pairing of f 1 and f 2 ). Definition 1 (DMA). A deterministic Muller automaton (DMA in the follow- ing) is a tuple (X, δ, M) such that X is a finite set of states, δ : X → X C is the transition function, M ⊆ P(X) is the Muller acceptance condition.
We adopt a formulation of DMAs that does not include initial states, thus we will speak of the language of a given state, not of an automaton; in other words every state can be chosen as initial. The definition of accepted language is also simplified by the deterministic setting.

Definition 2 ( δ, δ • ). Given δ : X → X C , we define by induction on the structure of words the functions δ : X → X C * as δx( ) = x, δx(cu) = ( δ(δxc)u), and δ

• : X → P(X) C * as δ • x( ) = ∅, δ • x(cu) = {δxc} ∪ δ • (δxc)u.
In words, δx(u) is the state reached by the automaton after it processed the word u, starting at position x, and δ • x(u) is the set of states the automaton passed along the way (the starting state x not being included). Definition 3 (Inf ). For x ∈ X, and α a stream, we let Inf (x, α) ⊆ X represent the set of states that are traversed infinitely often when following α starting from x, that is, y ∈ Inf (x, α) if and only if for each u, β such that α = uβ there are u , β such that β = u β , and δx(uu ) = y. Definition 4 (L(x)). For x ∈ X, we let L(x) denote the language of x, defined as the set of streams {α ∈ C ω |Inf (x, α) ∈ M}. We call a set of streams ωregular if it is L(x) for x a state in a DMA.

Muller automata are coalgebras

DMAs can be turned into coalgebras, in such a way that behavioural equivalence coincides with language equivalence. In Section 3.1 we introduce a simple, abstract construction, which is meant to be propaedeutic to a more concrete definition. The latter is provided in Section 3.5. The prerequisites are: the fact that the looping language of a state in a DMA is regular, which we prove in Section 3.2; the framework of dependent coalgebras, presented in Section 3.3; a coalgebraic characterisation of regular languages of non-empty words, given in Section 3.4. We assume basic prerequisites on coalgebras, and refer the reader to [START_REF] Rutten | Universal coalgebra: a theory of systems[END_REF] for further details.

An abstract characterisation

Definition 5 (Loop(x)). We call looping language of x ∈ X the set Loop(x) = {u ∈ C + |u ω ∈ Lx}.

Consider the set P(C + ) (that is, the set of sets of non-empty words over the finite set C ). We will treat its elements as observations, or colours associated to each state of a coalgebra. We are going to describe DMAs as coalgebras for the functor T(X) = X C × S, where S = P(C + ). We have that T is ωaccessible (finitary) and weak-pullback preserving. Thus a final coalgebra exists, and behavoural equivalence (that is, identifiability by coalgebra morphisms) can be equivalently defined as bisimilarity (connectability via a bisimulation). Definition 6 ( ). Let X be a set and (X, f ) be a T-coalgebra. Behavioural equivalence ⊆ X × X is the kernel of the unique morphism f into the final coalgebra, that is = {(x, y) | f (x) = f (y)}.

Remark 2. Equivalently, call R ⊆ X × X a bisimulation if and only if, whenever x R y, then π 2 (f (x)) = π 2 (f (y)), and, for all c ∈ C , π 1 (f (x))(c) R π 1 (f (y))(c). It is easy to see that two states are behaviourally equivalent if and only if they are bisimilar, that is, linked by some bisimulation. Behavioural equivalence can also be defined as a relation over two different coalgebras, using cospans of morphisms; the two conditions can be obtained from each other using coproducts of coalgebras.

Definition 7 (Coalgebra of a DMA). Given a DMA (X, δ, M), the coalgebra map f :

X → X C × P(C + ) is defined as f (x) = (δ(x), Loop(x)).
The transition structure of the automaton is preserved in the translation. For each state, its looping language is observed. Roughly, we may say that the ability to observe the looping language of a state in a coalgebra plays the same role of the acceptance condition of a DMA.

In Proposition 1 below, we prove that language equivalence coincides with bisimilarity. For this we need to introduce lasso languages and a well-known characterisation theorem for ω-regular languages.

Definition 8 (UP (L)

). An ultimately periodic word is a stream α ∈ C ω of the form s(l ω ). For L a set of streams, we denote with UP (L) the subset of its ultimately periodic words, called the ultimately periodic fragment of L. Definition 9 (Lasso(L)). A lasso is a pair (s, l), with s ∈ C * and l ∈ C + (the spoke and the loop of the lasso). A lasso (s, l) is a syntactic representation for the ultimately periodic word sl ω . For L a set of streams, call Lasso(L) the set {(s, l)|sl ω ∈ UP (L)}. For x a state in a Muller automaton, let Lasso(x) = Lasso(UP (L(x))).

Fact 1 below is well known (see Fact 1, [START_REF] Calbrix | Ultimately periodic words of rational ωlanguages[END_REF]), and needed for Proposition 1.

Fact 1 (Lasso iff. ω-regular) The sets Lasso(x) and L(x) uniquely determine each other: we have L(x) = L(y) if and only if Lasso(x) = Lasso(y).

Proposition 1 (Language equivalence is bisimilarity). Let (X, δ, M) be a DMA, and (X, f ) be the corresponding coalgebra. For x, y ∈ X, we have L(x) = L(y) if and only if x y.

Proof. (Proposition 1) By Fact 1, it suffices to prove that Lasso(x) = Lasso(y) if and only if x y. First we prove that R = {(x, y) ∈ X ×X|Lasso(x) = Lasso(y)} is a bisimulation with respect to f . Observe that Lasso(x) uniquely determines

Loop(x) = {u ∈ c + |( , u) ∈ Lasso(x)}. Thus (x, y) ∈ R ⇒ π 2 f x = π 2 f y. On the other hand, Lasso(x) = Lasso(y) ⇒ [Fact 1] L(x) = L(y) ⇒ ∀c ∈ C .L((δx)c) = L((δy)c) ⇒ [Fact 1] ∀c.Lasso((δx)c) = Lasso((δy)c) ⇒ ∀c.((π 1 f x)c, (π 1 f y)c) ∈ R. Thus, Lasso(x) = Lasso(y) ⇒ x y.
For the other direction, assume Lasso(x) = Lasso(y). Then there is a lasso (s, l) such that (without loss of generality) sl ω ∈ L(x) \ L(y). We have

l ω ∈ L( δxs) ∧ l ω / ∈ L( δys) ⇒ l ∈ Loop( δxs) ∧ l / ∈ Loop( δys) ⇒ π 2 f ( δxs) = π 2 f ( δys) ⇒ δxs / δys.
For all s ∈ C * , it is easy to prove by induction on the length of s that x y ⇒ δxs δys, so we may conclude that x / y.

Loop(x) is regular

Here we prove that, given a state x of a DMA, it is possible to construct a deterministic finite automaton (DFA) that accepts Loop(x). The construction is similar to the one provided in [START_REF] Calbrix | Ultimately periodic words of rational ωlanguages[END_REF] for Büchi automata.

Definition 10 (DFA for Loop(x)). Fix a DMA (X, δ, M). For x ∈ X, let (T, γ, F x , t 0 ) be a DFA having:

-states in T = (X × P(X)) X ; -transition function γ : T → T C , defined as γ(t)(c) = λy.(δ(π 1 (t y))c, π 2 (t y)∪ {δ(π 1 (t y))c}). -initial state t 0 = λy.(y, ∅); -accepting states in F x ⊆ T defined as follows. Consider t ∈ (X × P(X)) X .
Define a sequence of states indexed by ω:

x 0 = x, x i+1 = π 1 (t(x i )). Since X is finite, there is a least index k such that x k ∈ {x h |h < k}, so there is i < k such that x i = x k . Let t ∈ F x if and only if i≤j<k π 2 (t(x j )) ∈ M.
In Definition 10, notice that only F x depends on x, and that it is never the case that t 0 ∈ F x , thus the language of t 0 does not include the empty word. Intuitively, the DFA we define consumes a word u by following it in parallel starting from all the states of the automaton. Moreover, in each of these parallel runs, the states that are traversed are collected. Therefore states of the system are tuples in (X × P(X)) X indexed by the elements of X. At each index x we can find a pair (z, s), consisting of a reached state z and a set of traversed states s. This idea is formalised by Lemma 1 (whose proof is a routine induction on u) and its Corollary 1.

Lemma 1. Consider the DFA of Definition 10. For each u ∈ C * , t ∈ T , and z ∈ X with tz = (x 1 , s 1 ), we have

( γtu)z = ( δx 1 u, s 1 ∪ δ • x 1 u).
Corollary 1. For each u ∈ C * and x 1 ∈ X, we have

( γt 0 u)x 1 = ( δx 1 u, δ • x 1 u).
Lemma 1 is concerned with the structure of the DFA for x, that is T , γ, t 0 . The idea behind the definition of F x is to compute Inf (x, u ω ) for u a finite word. This is clarified by Lemma 2.

Lemma 2. For u a finite non-empty word, consider the state t = γt 0 u, and the objects (x h ) h∈ω , i, k from Definition 10. We have i≤j<k π 2 (t(x j )) = Inf (x, u ω ).

Proof. By Corollary 1 and the hypothesis, for each h, we have δx h u = x h+1 , and π 2 (t(x h )) = δ • x h u. Since the sequence (x h ) loops, by the automaton being deterministic we get the thesis.

Finally, as a direct consequence of Lemma 2, we get regularity of Loop(x).

Proposition 2 (Loop(x) is regular). Given a DMA (X, δ, M) and x ∈ X, the language of finite words Loop(x) is regular, and it is accepted by the automaton of Definition 10.

Proof. Importing definitions from Definition 10, by Lemma 2, a non-empty word is accepted from t in the DFA if and only if Inf (x, u ω ) ∈ M, that is u ω ∈ Loop(x). Remark 3. In case we are dealing with parity automata rather than with Muller automata, the above construction can be somewhat simplified. Let A = (X, δ, Ω) be a parity automaton, with Ω : X → ω the priority map. Now we can still base the DFA for Loop(y) (where y ∈ X) on the idea of considering parallel runs from each state of A. We no longer have to collect the full set of states that were passed during each run, but only the maximal priority of these states. In other words, the carrier set of the automaton recognizing the looping language for y can be based on the set T Ω = (X × Ran(Ω)) X , where Ran(Ω) ⊆ ω is the (finite) range of Ω. We leave further details to the reader.

Dependent coalgebras

We now develop a kind of dependent behavioural equivalence. Behavioural equivalence depends on observations on states. In our setting, observations are in turn states of another system. Dependent behavioural equivalence dictates that these observations are behavioural equivalent in turn, instead of just equal. This notion is captured by coalgebras in a category where objects are not merely sets, but rather two-sorted structures.

Let 2 be the two-elements set {1, 2} considered a discrete category. The category Set 2 is the category of functors from 2 to Set and their natural transformations. In other words, an object X can be represented as a pair (X 1 , X 2 ). We shall call the sets X 1 and X 2 the first and second sorts. An arrow f :

X → Y is a pair of functions f 1 : X 1 → Y 1 , f 2 : X 2 → Y 2 .
Consider two functors T 1 , T 2 : Set → Set. We define the dependent functor

T 1 T 2 : Set 2 → Set 2 .
Definition 11 (T 1 T 2 ). The functor T 1 T 2 is defined on objects as

(T 1 T 2 X) 1 = (T 1 X 1 ) × X 2 (T 1 T 2 X) 2 = T 2 X 2
The action on arrows is

(T 1 T 2 (f : X → Y )) 1 = T 1 f 1 × f 2 (T 1 T 2 f ) 2 = T 2 f 2 A T 1 T 2 -coalgebra is nothing but a pair of sets (X 1 , X 2 )
, together with a T 1 -coalgebra on X 1 , a T 2 -coalgebra on X 2 , and a map from X 1 to X 2 . To see this formally, note that a functor X : 2 → Set is just a pair of sets (X 1 , X 2 ). For (X, f ) a T 1 T 2 -coalgebra, f is a natural transformation, therefore a pair of maps (f 1 :

X 1 → (T 1 X 1 ) × X 2 , f 2 : X 2 → T 2 X 2 )
. Moreover, f 1 can be decomposed (by the universal property of the product) in the pairing of

f 1 1 : X 1 → T 1 X 1 and f 2 1 : X 1 → X 2 .
A coalgebra morphism h : (X, f ) → (Y, g) is in turn a pair of functions (h 1 , h 2 ) giving rise to two separate commutativity requirements

((T 1 h 1 ) × h 2 ) • f 1 = g 1 • h 1 T 2 h 2 • f 2 = g 2 • h 2
As f 1 and g 1 are pairings, we see that h being a coalgebra morphism amounts to commutativity of the three diagrams in Figure 1 X1 Throughout the paper, we are mostly interested into equivalence in the first sort of a coalgebra in Set 2 . However, we remark that behavioural equivalence in Set 2 is a two sorted relation, which we denote by i for i ∈ {1, 2}. We shall omit the index i when clear from the context.

f 1 1 h 1 / / Y1 g 1 1 T1X1 T 1 h 1 / / T1Y1 X1 f 2 1 h 1 / / Y1 g 2 1 X2 h 2 / / Y2 X2 f 2 h 2 / / Y2 g 2 T2X2 T 2 h 2 / / T2Y2
Definition 12 (Final T 1 T 2 -coalgebra). Assume that T 2 has a final coalgebra (Z 2 , z 2 ). Suppose that the functor F(X) = T 1 (X) × Z 2 has a final coalgebra (Z 1 , z 1 ) in turn. Define the T 1 T 2 -coalgebra (Z, z) as Z = (Z 1 , Z 2 ), z = (z 1 , z 2 ).
Proposition 3 (The final coalgebra is final). Assume the coalgebras from Definition 12. For (X,

f ) a T 1 T 2 -coalgebra, define a morphism h : (X, f ) → (Z, z) as follows. The arrow h 2 is the unique morphism from (X 2 , f 2 ) to (Z 2 , z 2 ). The arrow h 1 is the unique morphism from the F-coalgebra (X 1 , f 1 ) to (Z 1 , z 1 ), where f 1 (x) = (f 1 1 (x), h 2 (f 1 2 (x))
). Such h is unique as a coalgebra morphism.

Proof. First, observe that h fulfils the requirements in Figure 1. The rightmost diagram commutes since h 2 is a coalgebra homomorphism. The leftmost and middle diagrams commute simultaneously since h 1 is an F-coalgebra homomorphism.

Regular languages of non-empty words

As we discussed, Loop(x) is a regular language in C + . To describe DMAs as coalgebras, we need a precise characterisation of such regular languages of nonempty words. This can be done by a variant of the coalgebraic description of classical DFAs. In doing so, one omits the initial state in the spirit of coalgebraic presentations of automata, where one speaks of the language of a given state instead of the language of an automaton.

Definition 13 (DFAs accepting non-empty words). Consider the endofunctor in Set D(X) = (X × 2) C . Let (X, γ, F ) a DFA having unspecified initial state, with states in X, transition function γ : X → X C and final states F ⊆ X.

Define the D-coalgebra (X, f γ ), where

f γ xc = (γxc, 1) if γxc ∈ F , f γ xc = (γxc, 2) otherwise.
States of finite D-coalgebras are intended to represent regular languages of nonempty words; thus it is sensible to define acceptance on them.

Definition 14 (Language of x). For u ∈ C + , (X, f ) a D-coalgebra and x ∈ X, define the language L D (x), by induction on the length of u.

If u = c has length one, we let u ∈ L D (x) ⇐⇒ π 2 (f xc) = 1. If u = cv, with v ∈ C + , we let u ∈ L D (x) ⇐⇒ v ∈ L D (π 1 (f xc)).
The following proposition is easy to prove.

Proposition 4 (Languages of non-empty words). Given an uninitialised DFA D and the corresponding coalgebra C, a non-empty word u is is accepted from x in C if and only if it is accepted from x in D.

Corollary 2. Each regular language of non-empty words is accepted by some state in a finite D-coalgebra.

A construction in the reverse direction, obtaining a DFA accepting non-empty words from a finite D-coalgebra is possible. This proves that the states of the final coalgebra, that are images of states of finite D-coalgebras, are isomorphic to the regular languages of non-empty words. We omit the details of the construction. It is worth noting that, just like in the standard case, the structure map of the final D-coalgebra computes a form of "derivative" of a language; however, since the languages in question are of non-empty words, the derivative behaves accordingly, thus being equal to the standard derivative of languages, where, in addition, the empty word is excluded from the result. In the following we will sometimes blur the distinction between DFAs of non-empty words and the corresponding D-coalgebras.

Deterministic Muller automata as coalgebras

The characterization of language equivalence given by Section 3.1 can be refined, by incorporating in the definition of coalgebraic bisimilarity the ability to check that two looping languages are the same. This can be done using the characterisation of languages of non-empty words in Section 3.4.

First, we define the functor Ω, using the construction for dependent functors (Definition 11) and the functor D for DFAs of non-empty words (Definition 13).

Definition 15 (Functor Ω). We define the functor Ω :

Set 2 → Set 2 as Ω = (-) C D.
For an intuition about Ω-coalgebras, recall that a

T 1 T 2 -coalgebra f is composed of of a T 1 -coalgebra (X 1 , f 1 1 ), a T 2 -coalgebra (X 2 , f 2 )
, and a map f 1 2 from X 1 to X 2 . Roughly, in our case, the T 1 -coalgebra can be thought of as the structure of a DMA, while the T 2 -coalgebra can be used to represent the DFAs that accept Loop(x) for x ∈ X 1 . The map f 1 2 provides a link between the two. Before showing our first result, we give a characterisation of behavioural equivalence in an Ω-coalgebra (X, f ).

Proposition 5 (Dependent bisimilarity). For (X, f ) an Ω-coalgebra, x, y ∈ X 1 are behaviourally equivalent if and only if:

1. L D (f 2 1 (x)) = L D (f 2 1 (y)); 2. For all c ∈ C , f 1
1 xc and f 1 1 yc are behaviourally equivalent in turn.

Proof. Two states x and y are behaviourally equivalent if and only if there is a coalgebra (Y, g) and a morphism h : (X, f ) → (Y, g) obeying to the requirements in Figure 1. The leftmost square is turned into the usual coinductive back-andforth condition on the transition function f 1 1 (Condition 2). The middle square imposes that f 2 1 (x) and f 2 1 (y) are identified by h 2 . By the rightmost square, this is equivalent to behavioural equivalence of these two states. By Proposition 4 we know that behavioural equivalence in the second sort is language equivalence (Condition 1).

In Definition 16 below, we introduce the Ω-coalgebra that corresponds to a given DMA. The correspondence is then made precise by Theorem 1, showing that the proposed translation turns language equivalence into behavioural equivalence.

Definition 16 (Ω-coalgebra of a DMA). Let A = (X 1 , δ, M) be a DMA. For x ∈ X 1 , let (T x , γ x , F x , t 0

x ) be the DFA 1 for x from Definition 10. Let (T x , f x ) be the D-coalgebra of (T x , γ x , F x ) (from Definition 14). We define the Ω-coalgebra

C(A) = ((X 1 , X 2 ), f ) X 2 = x∈X1 T x
where the natural transformation f = (f 1 , f 2 ) is defined by

f 1 (x) = (δ(x), t 0 x ) f 2 = f x .
As we discussed, an Ω-coalgebra is a two-sorted structure. In the first sort of C(A) the structure of the DMA A is replicated. The second sort corresponds to a DFA accepting non-empty words, having initial states that accept the looping languages of the states of A. The map f 2 1 associates to each state x in the main sort precisely the initial state of the DFA for Loop(x). Thus, Proposition 1 is recovered in coalgebraic form.

Theorem 1 (Language equivalence is dependent bisimilarity). Let A be a DMA. Behavioural equivalence in the first sort of C(A) coincides with language equivalence in A. That is, for every two states x, y in X 1 we have that x y ⇐⇒ L(x) = L(y).

Proof. Consider two states x and y in X 1 . By Proposition 5, they are behaviourally equivalent if and only if the usual back-and-forth condition holds, where the "observations" x = π 2 (f 1 (x)) and y = π 2 (f 1 (y)) are not required to be equal, but rather to be bisimilar (then, coinductively, this is extended to all states reachable from x and y). By Proposition 4, x and y are bisimilar if and only if they are language equivalent. By Proposition 2, x and y accept respectively Loop(x) and Loop(y). By Proposition 1 we get the thesis. 1 Even though only the accepting states depend on x, it is convenient in Definition 16 to consider the DFA for each x as a distinguished structure. We consider all the Tx as non-intersecting sets to simplify the notation for elements of their coproduct. This can be concretely achieved by letting e.g. Tx = {x} × T .

A characterising property

Ω-coalgebras can be considered acceptors of lasso languages. We call balanced those whose states accept lasso languages corresponding to ω-regular languages (in a sense made precise in the following). In this section we show that these form a proper subclass, and provide a characterising property.

We have seen that Muller automata can be encoded as Ω-coalgebras, and the encoding turns language equivalence into behavioural equivalence. Thus, each ω-regular language can be represented as a state in the first sort of some Ω-coalgebra. Such a state represents a set of lassos, according to Definition 17 below, where we use the notation for the pairing from Remark 1.

Definition 17 (Loops and lassos in a coalgebra). Given an Ω-coalgebra (X, f ), for x ∈ X 1 , we define the language of lassos Lasso

(x) = {(s, l) | ∃x . f 1 1 xs = x ∧ l ∈ L D (f 2 1 x )}
and the regular language of non-empty words

Loop(x) = L D (f 2 1 x).
The lasso language of a state x is the set of pairs (s, l) such that one may consume s starting from x and staying in the first sort of the coalgebra, then follow l from the corresponding state in the second sort, and reach an accepting state. The overloading of notation is justified, as Lasso(x) (respectively, Loop(x)) is the same when x is considered a state of a DMA A, or of the corresponding coalgebra C(A). Consider states x and y belonging to the first sort of possibly distinguished Ω-coalgebras. Clearly, the image of states x and y along the final morphism coincides if and only if Lasso(x) = Lasso(y). In an Ω-coalgebra, for x ∈ X 1 , it is not necessary that Lasso(x) is obtained from the ultimately periodic fragment of some ω-regular language, as shown by the following example.

Example 1. Consider c ∈ C , and a DFA (T, γ, F, t 0 ) accepting the language {c}. Let (X, f ) be an Ω-coalgebra with X 1 = {x}, X 2 = T , f 1 1 xc = x for all c ∈ C , f 2 1 x = t 0 , f 2 obtained from γ and F . Then ( , c) belongs to Lasso(x), but ( , cc) does not. However, both lassos represent the ultimately periodic word c ω . There is no ω-regular language L such that Lasso(x) = Lasso(L), since c ω belongs to L if and only if both ( , c) and ( , cc) belong to Lasso(L).

We shall call balanced those Ω-coalgebras whose states correspond to ω-regular languages in the following sense.

Definition 18 (balanced coalgebra). An Ω-coalgebra (X, f ) is balanced if, for all x ∈ X 1 , there is an ω-regular language L x such that Lasso(x) = Lasso(L x ).

Clearly, for each DMA A, C(A) is a (sort-wise) finite balanced coalgebra. However, not all finite balanced coalgebras are equal to C(A) for some DMA A, as illustrated by the following example.

Example 2. Let C = {a, b}. Consider the language of infinite words

L = {uα|u ∈ C * ∧ (α = a ω ∨ α = b ω )}. L is ω-regular, as it is accepted by the two states DMA A = ({x 1 , x 2 }, δ, M) with δx 1 a = x 1 , δx 1 b = x 2 , δx 2 a = x 1 , δx 2 b = x 2 , M = {{x 1 }, {x 2 }}. Notice that UP (L) = L. Consider a D-coalgebra (Y, g) accepting {a} + ∪ {b} + from state t 0 . Define the Ω-coalgebra (X, f ) where X 1 = {x}, X 2 = Y . For c ∈ C , we let f 1 1 (x)(c) = x.
We let f 2 1 (x) = t 0 , and f 2 = g. We have that Lasso(x) = Lasso(L), but there is no DMA B such that C(B) = (X, f ): by construction, the structure defined by the set of states X 1 and transition function f 1 1 has to be the structure of B. But the only choice for an accepting condition is M = {{x}}. Obviously, such an automaton accepts the whole C ω .

The relation between DMAs and balanced Ω-coalgebras is slightly more subtle than expected. Example 2 shows that there are DMAs having language equivalent states that can not be quotiented. Thus, DMAs (set aside finiteness constraints) do not admit a universal model, or at least not one which is "minimal" in the traditional sense. Similar considerations apply to parity and Büchi automata. In contrast, each Ω-coalgebra has a quotient with respect to behavioural equivalence (its image in the final coalgebra). Moreover, as DMAs give rise to balanced coalgebras, the subobject of the final Ω-coalgebra, where all DMAs are mapped into, must be balanced. This coalgebra does not correspond to any DMA, as it has infinite states (there are infinitely many distinct ω-regular languages). However, we easily get the following statement, which paves the way to Proposition 6, explaining the relationship between DMAs and balanced coalgebras.

Lemma 3 (Quotients are balanced). If (X, f ) is a balanced Ω-coalgebra, and h : (X, f ) → (Y, g) is an epimorphism of coalgebras, then (Y, g) is balanced.

Proof. Consider y ∈ Y 1 ; since h is epic, there is x ∈ X 1 such that h(x) = y. Being unique, the final morphism from (X, f ) factors trough h. Then, by finality, x and y accept the same lasso language.

By construction, the coalgebra corresponding to a given DMA is sort-wise finite. Proposition 6 below clarifies that finiteness plays a key role in representing DMAs; however, it is not necessary that a coalgebra has a finite number of states, but rather it is sufficient that the equivalence classes induced by bisimilarity are in a finite number, that is, the image in the final coalgebra is sort-wise finite.

Proposition 6 (DMAs and balanced coalgebras). For each balanced coalgebra whose image (X, f ) in the final coalgebra is finite, there is a DMA A such that the image in the final coalgebra of C(A) coincides with (X, f ).

Proof. Since (X, f ) is balanced (Lemma 3), for each state x ∈ X 1 , there certainly is a DMA A x having a state y such that Lasso(y) = Lasso(x). In a DMA, it is obvious that only the states reachable from y concur to the construction of L(y), thus we assume w.l.o.g. that all the states of A x are reachable from y. When y is seen as a state in the first sort of C(A) = (Y x , g x ), x and y are equated by the final morphism, and the image in the final coalgebra of C(A) coincides with the subcoalgebra of (X, f ) reachable from x. The disjoint union of all the A x for x ∈ X 1 is then a witness DMA that proves the thesis. Such DMA exists by finiteness of X 1 . A lasso (s, l) can be interpreted as a finite, pointed coalgebra having finite carrier, for the functor C × (-). The formal definition is useful, since coalgebraic bisimilarity precisely corresponds to equality of the represented word sl ω .

Definition 19 (Coalgebra of a lasso). Consider a lasso (s, l) and define a coalgebra (X, f : X → C × X) where X is the finite cardinal |s| + |l|, and f is the pairing of f 1 and f 2 . We let

f 1 (i) = s i if 1 ≤ i ≤ |s|, f 1 (i) = l i-|s| if |s| < i ≤ |s| + |l|, f 2 (i) = i + 1 if 1 ≤ i < |s| + |l|, f 2 (|s| + |l|) = |s| + 1. Call the state 1 initial in (X, f ), making it a pointed coalgebra.
Remark 4. Consider the coalgebras corresponding to two lassos (s, l) and (s , l ). Their initial states are bisimilar if and only if they denote the same infinite word, that is sl ω = s (l ) ω . We will just call (s, l) and (s , l ) bisimilar.

Proposition 7 (Invariance). Consider L = Lasso(x) for x a state in a coalgebra whose image in the final coalgebra is finite. There is an ω-regular language L such that L = Lasso(L) if and only if L is invariant under bisimilarity: whenever (s, l) and (s , l ) are bisimilar, (s, l) ∈ L if and only if (s , l ) ∈ L.

Proof. The languages of states in finite subobjects of the final coalgebra are in one to one correspondence with the regular languages in C * $C + , with $ / ∈ C . A proof can be sketched as follows. For each such coalgebra (X, f ), view it as a DFA over C ∪ {$} by letting f 2 1 be the derivative with respect to $. Conversely, define a coalgebra from a DFA by letting the first sort coincide with the structure of the DFA, excluding the $-labelled transitions; the second sort is defined by the derivatives w.r.t. $ of the languages of states in the DFA. This established, observe that there certainly is a state z in the final coalgebra whose language is L. Its reachable part is also finite, hence it is a regular language in C * $C + . The thesis is obtained by direct application of the following result from [START_REF] Calbrix | Ultimately periodic words of rational ωlanguages[END_REF]: a regular language in C * $C + is {s$l|sl ω ∈ L} for some ω-regular L if and only if it is bisimulation invariant.

An obvious question at this point is to find a "structural" characterisation of bisimulation invariance for Ω-coalgebras. An answer is provided by Theorem 2.

Theorem 2 (Circular and coherent). An Ω-coalgebra (X, f ) is bisimulation invariant if and only if it is:

Circular: ∀x ∈ X 1 .∀k > 0.∀u ∈ C + .u ∈ Loop(x) ⇐⇒ u k ∈ Loop(x) Coherent: ∀x ∈ X 1 .Loop(x) = {cu | uc ∈ Loop(f 1 1 (x)(c))}
Proof. First, assume bisimulation invariance. To prove circularity, notice that for all u and k, u ω = (u k ) ω ; then use bisimulation invariance. To prove coherence, suppose cu ∈ Loop(x). Then ( , cu) ∈ Lasso(x); by bisimulation invariance, since (cu) ω = c(uc) ω , we have (c, uc) ∈ Lasso(x). Then uc ∈ Loop(f 1 1 xc). For the other direction, assume circularity and coherence. Suppose (s, l) is bisimilar to (s , l ). We can define a lasso bisimilar to both of them, and having "longer spoke and loop". Formally, there are a lasso (t, v), integers k, h, k , h , and finite words l 1 , l 2 , l 1 , l 2 , such that: sl ω = tv ω = s (l ) ω ; l = l 1 l 2 ; l = l 1 l 2 ; t = sl k l 1 = s (l ) k l 1 ; v = (l 2 l 1 ) h = (l 2 l 1 ) h . We now prove (t, v) ∈ Lasso(x) ⇐⇒ (s, l) ∈ Lasso(x). A similar argument can be used to prove (t, v) ∈ Lasso(x) ⇐⇒ (s , l ) ∈ Lasso(x), obtaining the thesis.

We have (t, v) ∈ Lasso(x) ⇐⇒ (sl

k l 1 , (l 2 l 1 ) h ) ∈ Lasso(x) ⇐⇒ (l 2 l 1 ) h ∈ Loop( f 1 1 (sl k l 1 )) ⇐⇒ {by circularity} l 2 l 1 ∈ Loop( f 1 1 (sl k l 1 )) ⇐⇒ l 2 l 1 ∈ Loop( f 1 1 (s(l 1 l 2 ) k l 1 )) ⇐⇒ {by coherence} l 1 l 2 ∈ Loop( f 1 1 (s(l 1 l 2 ) k l 1 l 2 )) ⇐⇒ l ∈ Loop( f 1 1 (sl k+1 )) ⇐⇒ {by coherence} l ∈ Loop( f 1 1 (s)) ⇐⇒ (s, l) ∈ Lasso(x).
Corollary 3. Consider an Ω-coalgebra C whose image in the final coalgebra is finite. C is balanced if and only if it is circular and coherent. Remark 5. The definition of a balanced coalgebra has been formulated in terms of the lasso languages it accepts (taking each of its respective states as initial), and the conditions of circularity and coherence are also phrased in terms of languages (here, languages of finite words). One may wonder whether these notions can be defined more directly, in terms of the structure of the coalgebra and its associated DFAs. We leave this as a question for further research.

Decision procedures

Two-sorted coalgebras provide a natural model for lasso languages. In this section, we spell out decision procedures for computing language equivalence (Section 5.1) and boolean operations (Section 5.2), on finite Ω-coalgebras. By Fact 1, when acting on balanced coalgebras, these procedures actually compute with (presentations of) ω-regular languages. By Proposition 6, the results we present yield an alternate proof of closure of DMAs under boolean operations.

Equivalence checking

Using Ω-coalgebras, language equivalence is reduced to behavioural equivalence. In coalgebras, whenever a final coalgebra exists, this relation can be computed by a generalised form of partition refinement that exploits the final sequence and finiteness. Therefore, the coalgebraic formulation by itself, and the fact that the states in C(A) for a DMA A are finite, already prove decidability of language equivalence in DMAs.

Deciding behavioural equivalence in an Ω-coalgebra corresponds to computing the kernel of the final morphism. This is done by a fixed point iteration, roughly described as follows. Consider a coalgebra (X, f ). Consider a morphism h : X → Y for some object Y in Set 2 ; notice that h is not necessarily a homomorphism of coalgebras, but assume that it satisfies x i y ⇒ h i (x) = h i (y), for i ∈ 2; that is, the kernel of h includes behavioural equivalence. If, in addition, h happens to be a coalgebra homomorphism for some coalgebra over Y , then the reverse inclusion holds, since h i (x) = h i (y) ⇒ x i y by definition of , making the kernel of h coincide with behavioural equivalence. Coalgebraic partition refinement uses this fact and finiteness of X to approximate the kernel of the final morphism "from above", starting from an arrow h whose kernel includes behavioural equivalence. In subsequent steps, h is refined, maintaining the property, until a coalgebra morphism is obtained. In the reminder of this section, we give a formal specification of this procedure for finite Ω-coalgebras.

Briefly, the definition is based on the idea of "refining" an approximation of the unique morphism in the final coalgebra until one reaches a fixed point. The starting approximation is the unique morphism from the object of states into the final object of the base category. This morphism equates all the states, thus its kernel includes bisimilarity. Each refinement preserves this property; the termination condition of the algorithm implies that the computed morphism is a coalgebra homomorphism, making it the desired bisimilarity quotient.

Definition 20 (Kernel). The kernel ker h of a morphism h :

X → Y is the pullback object of the diagram X h → Y h ← X,
thus it is a subobject of the product X × X. In Set 2 , limits are computed point-wise, and ker h is the pair of relations (ker h 1 , ker h 2 ), where each component is just the set theoretical notion:

ker h i = {(x, y) ∈ X i × X i |h i (x) = h i (y)}.
Definition 21 (Refinement). Given an Ω-coalgebra (X, f ) and an arrow h : X → Y in Set 2 , call (Ωh) • f the refinement of h with respect to f . Proposition 8 (Partition refinement). Given an Ω-coalgebra (X, f ), define the sequence of morphisms, indexed by ω, where h 0 : X → 1 is the unique morphism into the final object, and h i+1 is the refinement of h i with respect to f . Then define the sequence K i = ker h i . If both X 1 and X 2 are finite, then K i converges at some finite step j. In that case, let X denote the target of h j . There is a coalgebra structure f : X → Ω X such that h j is a coalgebra homomorphism from (X, f ) to ( X, f ), and K j is behavioural equivalence in (X, f ). More precisely, ( X, f ) is (up-to isomorphism) the image of (X, f ) in the final coalgebra.

The algorithm starts from the unique morphism from X into the final object of Set 2 (which is not required to be a homomorphism of coalgebras). Recall that in Set 2 colimits are computed point-wise. Thus the final morphism from X is the pair of final morphisms from X 1 and X 2 in Set. Its kernel is the two sorted relation (X 1 × X 1 , X 2 × X 2 ) making all the states equivalent. The kernel of this morphism necessarily includes behavioural equivalence; the two are equal only if all states are (sort-wise) equivalent; thus it is an approximation of the unique morphism into the final coalgebra. The approximation is refined in subsequent steps, obtaining at most the identity function (up-to isomorphism). This limit case is reached (in a finite number of steps), only if no states are equivalent. Correctness and convergence of the algorithm comes from convergence of the terminal sequence (see [START_REF] James | Terminal sequences for accessible endofunctors[END_REF]). Convergence in a finite number of steps is just a consequence of finiteness of the state space.

Boolean operations

Boolean operations on Ω-coalgebras are particularly simple and reminiscent of the corresponding operations on classical DFAs. First recall that the set 2 has the structure of a boolean algebra, with the obvious definition of the boolean operations ¬, ∧, ∨ denoting complementation, conjunction and disjunction, respectively. In order to be coherent with Definition 10, we assume 1 to denote the truth value true and 2 to denote false. In the following, let (X, f ) and (Y, g) be Ω-coalgebras.

Definition 22 (Complement). Define the complement coalgebra (X, f )

where f1 = f 1 f2 xc = (π 1 (f 2 xc), ¬π 2 (f 2 xc)).
Definition 23 (Union). Define the union coalgebra

(X × Y, f ∪ g)
where

(f ∪ g) 1 1 (x, y)(c) = (f 1 1 xc, g 1 1 yc) (f ∪ g) 2 1 (x, y) = (f 2 1 x, f 2 1 y) (f ∪ g) 2 (x, y)c = ((π 1 (f 2 xc), π 1 (g 2 yc)), π 2 (f 2 xc) ∨ π 2 (g 2 yc)).
Definition 24 (Intersection). Define the intersection coalgebra

(X × Y, f ∩ g)
where

(f ∩ g) 1 1 (x, y)(c) = (f 1 1 xc, g 1 1 yc) (f ∩ g) 2 1 (x, y) = (f 2 1 x, f 2 1 y) (f ∩ g) 2 (x, y)c = ((π 1 (f 2 xc), π 1 (g 2 yc)), π 2 (f 2 xc) ∧ π 2 (g 2 yc)).
The operations we define actually implement boolean operations on lasso languages, as shown in Proposition 9 below. Furthermore, boolean operations on balanced coalgebras yield balanced coalgebras. This fact is proved in Proposition 10, and is a direct application of Theorem 2. Thus, by Proposition 6, we get a simple proof that ω-regular languages are closed under boolean operations. We state this fact in Corollary 4, concluding the section.

Proposition 9 (Boolean algebra). For x ∈ X 1 and y ∈ Y 1 , let L x = Lasso(x) and L y = Lasso(y) in the coalgebras (X, f ) and (Y, g), respectively; let L x = Lasso(x) in (X, f ); let L x∪y = Lasso(x, y) in (X×Y, f ∪g); let L x∩y = Lasso(x, y) in (X×Y, f ∩g). We have L x = C * ×C + \L x , L x∪y = L x ∪L y and L x∩y = L x ∩L y .

Proof. Recall that for x ∈ X 1 and y ∈ Y 1 , f 2 1 (x) and g 2 1 (y) are initial states of DFAs. For complementation, observe that (s, l) ∈ Lasso(x) ⇐⇒ l ∈ L D (f 2 1 ( f 1 1 (x). For all x ∈ X 1 , the construction complements the DFA of nonempty words rooted at f 2 1 (x). Binary operations are also simple. Notice that the structure of (X × Y, f ∪ g) is that of their parallel composition, thus it also includes the parallel composition of the DFAs rooted at f 2 1 (x) and g 2 1 (y) for all (x, y) ∈ (X 2 × Y 2 ). The obtained DFA is rooted at (f ∪ g) 2 1 (x, y), and it accepts Loop(x) ∪ Loop(y) by construction. A similar argument holds for (X × Y, f ∩ g).

Proposition 10 (Boolean operations are balanced). If (X, f ) is balanced and image-finite in the final coalgebra, then so is (X, f ). If, additionally, (Y, g) is in the same conditions, then also (X × Y, f ∪ g) and (X × Y, f ∩ g) are balanced and image-finite along the final morphism.

Proof. By construction, boolean operations preserve finiteness, thus also imagefiniteness along the final morphism. We prove that circularity and coherence are preserved in turn. Suppose (X, f ) is circular, and consider x ∈ X 1 , k > 0, u ∈ C + . Call Loop(x) the language Loop(x) in the complement coalgebra. We have u ∈ Loop(x) ⇐⇒ u / ∈ Loop(x) ⇐⇒ u k / ∈ Loop(x) ⇐⇒ u k ∈ Loop(x), thus the complement coalgebra is circular. For the union, we have u ∈ Loop(x, y) ⇐⇒ u ∈ Loop(x) ∪ Loop(y) ⇐⇒ u ∈ Loop(x) ∨ u ∈ Loop(y) ⇐⇒ u k ∈ Loop(x)∨u k ∈ Loop(y) ⇐⇒ u k ∈ Loop(x, y). Similarly for the intersection (or just by de Morgan laws). Coherence is dealt with in the same way. As a final remark, we notice that the combination of boolean operations and equivalence checking allows one to derive many set-theoretical operations on lasso languages; as a fundamental example, it yields a proof of decidability of language inclusion.

Future work

In [START_REF] Calbrix | Ultimately periodic words of rational ωlanguages[END_REF], the authors hoped "that a number of constructions which are presently outwardly performed on Büchi automata can be performed on simple DFAs". Their goal is somewhat obfuscated by the fact that DFAs do not precisely characterise lasso languages; thus, for example, bisimulation invariant lasso languages are not closed under complementation of DFAs. This hints at the possibility of more precise structures, that characterise ω-regular languages better. Ω-coalgebras are perfectly fitted: in Section 5 we see that typical operations on automata become fairly standard using them; still, they maintain the definitional simplicity of DFAs, and their accepting condition is local to states. Lasso languages provide a finite syntax for ω-regular languages. We expect that a deeper study of balanced coalgebras may help understanding the issues of finite memory in the realm of (languages of) streams, which are infinite structures by their own nature. In this respect, the study of pumping lemmas for lasso and ω-regular languages seems an interesting research direction to take.

The importance of circularity and coherence should not be underestimated: it allows the proof of Proposition 10 to be carried out directly, without assuming closure under boolean operations of ω-regular languages. In combination with Proposition 6, this yields a "lasso-language-theoretical" alternate proof of closure of ω-regular languages under boolean operations. The definition of the two properties also suggests that circular and coherent coalgebras may be treated as a covariety. The impact of such a statement has to be framed in the more general question of what can the theory of coalgebras add to the theory of stream automata.

Future work in this sense may be directed in at least three ways. First, the theory of Ω-coalgebras has just been introduced. Many results in coalgebras have not been explored yet in conjunction with them (covarieties, coalgebraic modal logics, and trace semantics come to mind). Second, as it is typical in coalgebras, one could seek for generalisation of lasso languages and ω-regular languages, as it has been done for the case of DFAs. An interesting case study is that of automata over infinite alphabets. Similarly to [START_REF] Ciancia | A novel class of automata for languages on infinite alphabets[END_REF][START_REF] Bojanczyk | Automata with group actions[END_REF], one could use coalgebras in the category of nominal sets, which are then finitely represented using a categorical equivalence. Third, lassos can in turn be seen as coalgebras, of which Ω-coalgebras are classifying structures. Coalgebra automata [START_REF] Venema | Automata and fixed point logic: A coalgebraic perspective[END_REF] enhance streams by making them elements of the final coalgebra for a certain functor which can be varied, providing a general notion of modal fixpoint logics for infinite structures. The relationship between stream languages and their ultimately periodic fragments should be investigated in this more general setting.

Fig. 1 .

 1 Fig. 1. Commutativity requirements of dependent behavioural equivalence.

Corollary 4 .

 4 Deterministic Muller automata, thus also ω-regular languages, are closed under boolean operations.Proof. By Proposition 10, Proposition 6, and the fact that the coalgebra of a DMA is finite and balanced.

Acknowledgements

The authors wish to thank Jean-Eric Pin for pointing them to the work [4].

Work supported by the second author's VICI grant 639.073.501 of the Netherlands Organization for Scientific Research (NWO).