COALGEBRAIC TRACE SEMANTICS VIA FORGETFUL LOGICS

. We use modal logic as a framework for coalgebraic trace semantics, and show the ﬂexibility of the approach with concrete examples such as the language semantics of weighted, alternating and tree automata, and the trace semantics of generative probabilistic systems. We provide a suﬃcient condition under which a logical semantics coincides with the trace semantics obtained via a given determinization construction. Finally, we consider a condition that guarantees the existence of a canonical determinization procedure that is correct with respect to a given logical semantics. That procedure is closely related to Brzozowski’s minimization algorithm.


Introduction
The theory of coalgebras [31,14] is a framework of choice to model and study state-based systems at a high level of generality.Coalgebraic methods have been rather successful in modeling branching time behaviour of various kinds of transition systems, with a general notion of bisimulation and final semantics as the main contributions.But in a wide range of settings, from automata theory to verification and model checking, one is interested in the linear time behaviour of systems, such as trace semantics of transition systems or language semantics of automata.Indeed, coalgebraic modeling of linear time behaviour has also attracted significant attention.
However, the emerging picture is considerably more complex: several approaches have been developed whose scopes and connections are not yet fully understood.Here we suggest a new approach which, contrary to previously considered coalgebraic ideas, crucially and explicitly defines trace semantics not by coinduction but by induction, based on techniques from modal logic.This provides a transparent framework that covers new examples such as weighted tree automata, allows us to naturally relate trace semantics to determinization functor S − that allows arbitrary assignments of weights to words and states.This distinction is an instance of a general distinction between a covariant functor (or a monad) T and a contravariant functor G, which will be a recurring theme in this paper.
Applying the term logic to our framework is admittedly a bit of an exaggeration.We do not consider syntactic aspects usually connected with logical systems, such as deduction relations.We merely study ways to interpret certain terms (formulas) on models (coalgebras) in an inductive fashion.One might call it a testing framework, as in [29], but similar systems are often called logics in coalgebraic literature, and we reluctantly stick to this custom.
The idea of using modal logics for coalgebraic trace semantics is not new; it is visible already in [29].In [12] it is related to behavioural equivalence, and applied to nondeterministic systems.A generalized notion of relation lifting is used in [6] to obtain infinite trace semantics, and applied in [7] to get canonical linear time logics.In [19], coalgebraic modal logic is combined with the idea of lifting behaviours to Eilenberg-Moore categories, with trace semantics in mind.In [16], a connection to modal logics is sketched from the perspective of coalgebraic determinization procedures.In a sense, this paper describes the same connection from the perspective of logic.In [8], the framework of [6,7] is rephrased in terms of coalgebraic modal logic.The result is rather similar to the one we considered, with forgetful modalities to resolve branching.Unlike our approach, [8] relies on T being a monad, and under some more assumptions it studies canonical forgetful modalities that give rise to particularly well-behaved logics.In [23,28], monads feature even more prominently, with the entire behaviour functor embedded in a so-called graded monad.In [11], it is embedded in a more complex functor with a so-called observer.
Our main new contribution is the notion of forgetful logic and its ramifications.Basic definitions are provided in Section 3 and some illustrative examples in Section 4. We introduce a systematic way of relating trace semantics to determinization, by giving sufficient conditions for a given determinization procedure, understood in a slightly more general way than in [16], to be correct with respect to a given forgetful logic (Section 6).For instance, this allows showing in a coalgebraic setting that the determinization of alternating automata into non-deterministic automata preserves language semantics.
A correct determinization procedure may not exist in general.In Section 7 we study a situation where a canonical correct determinization procedure exists.It turns out that even in the simple case of non-deterministic automata that procedure is not the classical powerset construction; instead, it relies on a double application of contravariant powerset construction.Interestingly, this is what also happens in Brzozowski's algorithm for automata minimization [4], so as a by-product, we get a new perspective on that algorithm which has recently attracted much attention in the coalgebraic community [1,2,3].
Although we do not assume the branching functor T to be a monad, a forgetful logic for T is equivalent to a transformation from T to a certain monad which, in the case of sets, is the double contravariant powerset monad (a special case of the continuation monad).One might say that the continuation monad is rich enough to handle all types of branching that can be "forgotten" within our framework.
This paper is an extended version of [21], adding full proofs and a treatment of the trace semantics of probabilistic systems as a non-trivial instance of the framework.pointed out Lemma 5.2 and whose many insightful comments let us significantly improve the paper.

Preliminaries
We assume familiarity with basic notions of category theory (see, e.g., [24]).A coalgebra for a functor B : C → C consists of an object X and a map f : X → BX.A homomorphism from f : X → BX to g : Y → BY is a map h : X → Y such that g •h = Bh•f .The category of B-coalgebras is denoted by Coalg(B).Algebras for a functor L are defined dually; the category of L-algebras and homomorphisms is denoted by Alg(L).
We list a few examples where C = Set, the category of sets and functions.Consider the functor P ω (A × −), where P ω is the finite powerset functor and A is a fixed set.A coalgebra f : X → P ω (A × X) is a finitely branching labelled transition system: it maps every state to a finite set of next states.Coalgebras for the functor (P ω −) A are image-finite labelled transition systems, i.e., the set of next states for every label is finite.When A is finite the two notions coincide.A coalgebra f : X → P ω (A × X + 1), where 1 = { * } is a singleton, is a non-deterministic automaton; a state x is accepting whenever * ∈ f (x).
Consider the functor BX = 2×X A , where 2 is a two-element set of truth values.A coalgebra o, f : X → BX is a deterministic automaton; a state x is accepting if o(x) = tt, and f (x) is the transition function.The composition BP ω yields non-deterministic automata, presented in a different way than above.We shall also consider BP ω P ω -coalgebras, which represent a general version of alternating automata.
Let S be a semiring.Define MX = {ϕ ∈ S X | supp(ϕ) is finite} where supp(ϕ) = {x | ϕ(x) = 0}, and M(f : X → Y )(ϕ)(y) = x∈f −1 (y) ϕ(x).A weighted automaton is a coalgebra for the functor M(A × − + 1).Let Σ be a polynomial functor corresponding to an algebraic signature.A top-down weighted tree automaton is a coalgebra for the functor MΣ.For S the Boolean semiring these are non-deterministic tree automata.Similar to non-deterministic automata above, one can present weighted automata as coalgebras for S × (M−) A .
We note that P ω is a monad, by taking the unit η X (x) = {x} and the multiplication µ to be set union.More generally, the functor M extends to a monad, by taking µ X (ϕ)(x) = ψ∈S X ϕ(ψ) • ψ(x).The case of P ω is obtained by taking the Boolean semiring.Notice that the finite support condition is required for µ to be well-defined.To avoid cluttering the presentation with too much of the (−) op notation, we opt to treat F and G as contravariant functors, i.e., ones that reverse the direction of all arrows (maps), between C and D. The adjunction then becomes a contravariant adjunction "on the right", meaning that there is a natural bijection Slightly abusing the notation, we shall denote both sides of this bijection by (−) ♭ .Applying the bijection to a map is referred to as transposing the map.
In such an adjunction, GF is a monad on C, whose unit we denote by ι : Id ⇒ GF , and F G is a monad on D, with unit the denoted by ǫ : Id ⇒ F G. As usual, multiplication of the monad GF is GǫF : GF GF ⇒ GF , and multiplication of F G is F ιG : F GF G ⇒ F G. The counit-unit equations for adjunctions amount to: Both F and G map colimits to limits, by standard preservation results for adjoint functors.
In what follows, the reader need only remember that F and G are contravariant, i.e., they reverse maps and natural transformations.All other functors, except a few that lift F and G to other categories, are standard covariant functors.

Coalgebraic modal logic.
We recall an approach to coalgebraic modal logic based on contravariant adjunctions, see, e.g., [20,17].Consider categories C, D and functors F , G as in Section 2.1.Given an endofunctor B : C → C, a coalgebraic logic to be interpreted on B-coalgebras is built of syntax, i.e., an endofunctor L : D → D, and semantics, a natural transformation ρ : LF ⇒ F B. We will usually refer to ρ simply as a logic.If an initial L-algebra a : LΦ → Φ exists then, for any B-coalgebra h : X → BX, the logical semantics of ρ on h is a map s ♭ : X → GΦ obtained by transposing the map defined by initiality of a.
The mapping of a B-coalgebra h : X → BX to an L-algebra F h • ρ X : LF X → F X determines a contravariant functor F that lifts F , i.e., acts as F on carriers.

Coalg(B)
The functor F has no (contravariant) adjoint in general; later in Section 7 we shall study well-behaved situations when it does.Notice that F maps coalgebra homomorphisms to algebra homomorphisms, and indeed the logical semantics factors through coalgebra homomorphisms, i.e., behavioural equivalence implies logical equivalence.The converse holds if ρ is expressive, meaning that the logical semantics decomposes as a coalgebra homomorphism followed by a mono.
The initial algebra of L is the set A * of words over A. We define a logic ρ : LF ⇒ F B as follows: the logical semantics is a map s ♭ : X → 2 A * , yielding the usual language semantics of the automaton: s ♭ (x)(ε) = o(x) for the empty word ε, and s ♭ (x)(aw) = s ♭ (f (x)(a))(w) for any a ∈ A, w ∈ A * .Note that logical equivalences, understood as kernel relations of logical semantics, are conceptually different from behavioural equivalences typically considered in coalgebra theory, in that they do not arise from finality of coalgebras, but rather from initiality of algebras (albeit in a different category).Fundamentally, logical semantics for coalgebras is defined by induction rather than coinduction.In some particularly well-behaved cases the inductive and coinductive views coincide; we shall study such situations in Section 7.
A logic ρ : LF ⇒ F B gives rise to its mate ρ ♭ : BG ⇒ GL, defined by where ι and ǫ are as in Section 2.1.A routine calculation shows that ρ in turn is the mate of ρ ♭ (with the roles of F , G, ι and ǫ swapped), giving a bijective correspondence between logics and their mates.Some important properties of logics are conveniently stated in terms of their mates; e.g., under mild additional assumptions (see [20]), if the mate is pointwise monic then the logic is expressive.Two simple but useful diagrams show how logics relate to their mates along the basic adjunction: Lemma 2.2.For any logic ρ : LF ⇒ F B, the following diagrams commute: Proof.For the first diagram, chase:

GLF
where everything commutes, clockwise starting from top-left: by naturality of ι, by naturality of ρ, by (2.1) above, and by definition of ρ ♭ .
The other diagram is similar.
There is a direct characterization of logical semantic maps in terms of mates, first formulated in [29].Indeed, by transposing (2.2) it is easy to check that the logical semantics s ♭ : X → GΦ on a coalgebra h : X → BX is a unique map that makes the following "twisted coalgebra morphism" diagram commute. (2.6) Natural transformations τ and κ as above induce functors defined by composition.
Lemma 2.3.Suppose (τ, κ) is morphism from θ : M F ⇒ F K to ρ : LF ⇒ F B. Then the following diagram commutes: where Fρ and Fθ are the liftings of F induced by ρ and θ respectively, as in (2.3).
Proof.Let f : X → BX be a coalgebra, and consider: The upper path is Fθ (κ X • f ), and the lower path is ( Fρ (f )) • τ X .The diagram commutes since (τ, κ) is a morphism of logics.
Morphisms of logics apppear in [5], where the category of logics and morphisms between them is studied.The examples in [5] involve a translation of syntax determined by τ .Our main interest in morphisms of logics is cases where τ = id.Then, it is a direct consequence of Lemma 2.3 that the logical semantics of ρ on a coalgebra f : X → BX coincides with the logical semantics of θ on κ X • f .In the sequel, in a situation where τ = id we simply say that κ is a morphism of logics.

Forgetful logics
In most abstract approaches to coalgebraic trace semantics, the behaviour functor under consideration is a composition T B or BT , where T is the branching aspect and B is the type of observations of interest.Our approach is to capture trace semantics as the logical semantics of a suitable logic for T B or BT .The logics that we consider are defined as the composition of a logic for B and a special kind of logic for T which has trivial syntax.This special logic for T specifies how the branching behaviour should be "forgotten" in the resulting logical theory.
Logics for composite functors can often be obtained from logics of their components.Consider functors B, T : C → C and logics for them ρ : LF ⇒ F B and α : N F ⇒ F T , for some functors L, N : D → D. One can then define logics for the functors T B and BT : It is easy to see that taking the mate of a logic respects this composition operator, i.e., that (α ⊚ ρ) ♭ = α ♭ ⊚ ρ ♭ .Such compositions of logics appear in [14] and were studied in a slightly more concrete setting in [9,32].In [5,Lemma 3.12], it is shown how to (horizontally) compose morphisms of logics, turning ⊚ into a bifunctor.We shall be interested in the case where the logic for T has a trivial syntax; in other words, where N = Id.Intuitively speaking, we require a logic for T that consists of a single unary operator, which could therefore be elided in a syntactic presentation of logical formulas.The semantics of such an operator is defined by a natural transformation α : F ⇒ F T or equivalently by its mate α ♭ : T G ⇒ G. Intuitively, the composite logics α ⊚ ρ and ρ ⊚ α, when interpreted on T B-and BT -coalgebras respectively disregard, or forget, the aspect of their behaviour related to the functor T , in a manner prescribed by α.We call logics obtained in this fashion forgetful logics.
Transformations α : F ⇒ F T (and their mates α ♭ ) are also in bijective correspondence with natural transformations α † : T ⇒ GF .Indeed, define and recover what is easily seen to be mutually inverse operations.This means that, intuitively, a forgetful logic for T is equivalent to an encoding of T into the monad GF .In all examples considered in the next section α † is (pointwise) monic, which justifies the name "encoding", but we do not use the monicity for anything and we do not have an understanding of its significance.
As long as we do not assume T to be a monad, it makes no sense to ask e.g.whether α † is a monad morphism.However, composing forgetful logics for multiple behaviour functors does agree with the multiplication structure of GF .Specifically, for α : F ⇒ F T and β : F ⇒ F S, one may consider the composite α ⊚ β : F ⇒ F T S. The corresponding encoding (α ⊚ β) † : T S ⇒ GF is then equal to: Encodings α † will be technically useful in Section 7.2.

Examples
We instantiate the setting of Section 3 and use forgetful logics to obtain trace semantics for several concrete types of coalgebras: non-deterministic automata, transition systems, alternating automata, weighted tree automata and probabilistic systems.
In the first few examples we let C = D = Set and F = G = 2 − , and consider T B or BT -coalgebras, where T = P ω is the finite powerset functor.Our examples involve the logic α : 2 − ⇒ 2 Pω defined by: This choice of F and G has been studied thoroughly in the field of coalgebraic logic, and our α is an example of the standard notion of predicate lifting [14,22] corresponding to the so-called diamond modality.Its mate α ♭ : P ω 2 − ⇒ 2 − and the corresponding encoding α † : P ω ⇒ 2 2 − are as follows: Here and in all examples below, P ω could be replaced by the full powerset P without any problems.
Example 4.1.We define a forgetful logic α ⊚ ρ for the functor P ω (A × − + 1) whose coalgebras are non-deterministic automata, so that the logical semantics is the usual language semantics.To this end, we let: • α be as in (4.1), and • ρ be defined by its mate ρ ♭ : A × 2 − + 1 → 2 A×−+1 as follows: The choice of L is motivated by the fact that the initial algebra of A× − + 1 is A * , hence the logical semantics will be a map from states to languages (elements of 2 A * ).Now the logical semantics of the logic α ⊚ ρ on an automaton f : X → P ω BX is the map s ♭ from (2.5), i.e., the unique map that makes the following diagram commute: It is easy to calculate (see Appendix A) that for any x ∈ X: for ε the empty word, and for all a ∈ A and w ∈ A * .
Note that the logic ρ in the above example is expressive.One may expect that given a different expressive logic θ involving the same functors, the forgetful logics α ⊚ ρ and α ⊚ θ yield the same logical equivalences, but this is not the case.For instance, define This logic is expressive as well (since θ ♭ is componentwise monic) but in the semantics of the forgetful logic α ⊚ θ, information on final states is discarded.
Example 4.2 (Length of words).The initial algebra of the functor L defined by LX = X +1 is Φ = N, the set of natural numbers.Define a logic for BX = A × X + 1 by its mate Note that this logic is not expressive.With the above α (Equation 4.1), we have a logic α ⊚ ρ, and given any f : X → P ω (A × X + 1), this yields the following map s ♭ : X → 2 Φ : Thus, s ♭ (x) is the binary sequence which is tt at position n iff the automaton f accepts a word of length n, starting in state x.
Example 4.3 (Labelled transition systems).In this example we consider the finite traces of labelled transition systems of the form f : X → (P ω X) A , i.e., BT -coalgebras where BX = X A and T X = P ω X.To this end, let be the mate of the logic ρ given in Example 2.1; explicitly, it is the obvious isomorphism given by manipulating exponents: A is the usual language semantics, i.e., for any x ∈ X we have: Non-determinism can be resolved differently: in contrast to (4.1), consider β : P ω ⇒ P ω 2 − , and the corresponding β ♭ : P ω 2 − ⇒ P ω and β † : P ω ⇒ 2 2 − , given by Similarly to (4.1), β is a predicate lifting that corresponds to the so-called box modality.The semantics s ♭ induced by the forgetful logic ρ ⊚ β accepts a word if all paths end in an accepting state: . We call this the conjunctive semantics.In automata-theoretic terms, this is the language semantics for (BP ω -coalgebras understood as) co-nondeterministic automata, i.e., alternating automata with only universal states.

Some non-examples.
It is not clear how to use forgetful logics to give a conjunctive semantics to coalgebras for P ω (A × X + −); simply using β together with ρ from Example 4.1 does not yield the expected logical semantics.Also, transition systems as P ω (A × −)-coalgebras do not work well; with α as in (4.1) the logical semantics of a state with no successors is always empty, while it should contain the empty trace.
Example 4.5 (Alternating automata).Consider BP ω P ω -coalgebras with B = 2 × − A .We give a forgetful logic by combining ρ, α, and β from the previous example (more precisely, the logic is (ρ ⊚ α) ⊚ β); recall that α and β resolve the non-determinism by disjunction and conjunction respectively.The logical semantics on a coalgebra o, f : X → BP ω P ω X then is the map s ♭ in the following diagram (see (2.5)): Spelling out the details for a coalgebra o, f : X → 2 × (P ω P ω X) A yields, for any x ∈ X: s ♭ (x)(ε) = o(x) and for any a ∈ A and w ∈ A * : s ♭ (x)(aw) = tt iff there is S ∈ f (x)(a) such that s ♭ (y)(w) = tt for all y ∈ S (see Appendix A).
Example 4.6 (Weighted tree automata).In this example we let C = D = Set and F = G = S − for a semiring S. We consider coalgebras for MΣ (Section 2), where Σ is a polynomial functor corresponding to a signature.The initial algebra of Σ is carried by the set of finite Σ-trees, denoted by Σ * ∅.Define ρ : ΣF ⇒ F Σ by cases on the operators σ in the signature: where n is the arity of σ.Define α : S − ⇒ S M by its mate: Notice that α and ρ generalize the logics of Example 4.1.
The logical semantics of α ⊚ ρ on a weighted tree automaton f : X → MΣX is the unique map s ♭ : X → S Σ * ∅ making the following diagram commute: This means that for any tree σ(t 1 , . . ., t n ) and any x ∈ X we have (see Appendix A): As a special case, we obtain for any weighted automaton f : X → M(A × X + 1) a unique map s ♭ : X → S A * so that for any x ∈ X, a ∈ A and w ∈ A * : For S the Boolean semiring we get the usual semantics of tree automata: s ♭ (x)(σ(t 1 , . . ., t n )) = tt iff there are x 1 , . . ., x n such that σ(x 1 , . . ., x n ) ∈ f (x) and for all i ≤ n : 3)) is a deterministic bottom-up tree automaton.It corresponds to the top-down automaton f , in the sense that the semantics s ♭ of f is the transpose of the unique homomorphism s : Σ * ∅ → S X arising by initiality; the latter is the usual semantics of bottom-up tree automata.
Example 4.7 (Probabilistic systems).Consider generative probabilistic transition systems [34] with explicit termination, modeled as coalgebras f : X → ∆(A × X + 1), where ∆ is the finitely supported probability distribution functor on Set.One would like to interpret sequences of labels from A as completed traces for such coalgebras, i.e., ones ending with a transition to the unique element of 1, and assign probabilities to them.
Although probability distributions on a set X can be seen as functions from X to the interval [0, 1], techniques of Example 4.6 are not directly applicable, since [0, 1] is not a semiring in the expected sense: addition is not a total operation.One could replace [0, 1] with the semiring of nonnegative real numbers and proceed as in Example 4.6, but the resulting trace semantics would obscure an important property of probabilistic traces: every trace has probability at most 1.Actually, in the example considered here, an even stronger property holds: for every process, probabilities of all complete traces generated from it form a subprobability distribution.We wish to design a forgetful logic framework that would make this property apparent.
To this end, put C = Set and D = PCM, the category of partial commutative monoids (see [15] for details).A partial commutative monoid is a set X together with a unit 0 ∈ X and a partial binary addition function on X that is commutative and associative whenever defined.A morphism of such monoids is a function that preserves units and addition, whenever defined.A paradigmatic example of a partial commutative monoid is the interval [0, 1] with 0 as unit and addition defined whenever the result is at most 1.
The obvious forgetful functor U : PCM → Set has a left adjoint (−) ⊥ : Set → PCM that assigns to every set X the partial monoid X + ⊥ with ⊥ as the unit, and addition defined by ⊥ x = x ⊥ = x and undefined otherwise.
The category PCM is symmetric monoidal closed [15] with the internal hom-functor Φ ⊸ Ψ = hom PCM (Φ, Ψ) with the constant function 0(φ) = 0 Ψ as the unit, and addition defined by (f g)(φ) = f (φ) g(φ) if the addition on the right is defined for every φ ∈ Φ, and f g undefined otherwise.
The symmetric monoidal closed structure implies that the functor − ⊸ Ψ is contravariant self-adjoint for any partial commutative monoid Ψ.
Define contravariant functors They form a contravariant adjunction: a composition of the adjunction (−) ⊥ ⊣ U with the contravariant self-adjunction of − ⊸ [0, 1].In other words, there is a bijection This takes values in [0, 1], since PCM has products, defined as expected as cartesian products on carriers.Define a functor L on PCM by LΦ = Φ A ω × {⊤} ⊥ where Φ A ω , for the set A of transition labels, is the A-fold product of Φ restricted to those tuples that have the unit 0 Φ on all but finitely many components.If A is finite then this is simply the A-fold product of Φ.
Elements of LΦ are A-indexed families of elements of Φ that are 0 Φ almost everywhere, with an additional component that is either ⊤ or ⊥, with addition defined componentwise (note that ⊤ ⊤ is undefined).
Consider the set Λ = P ω (A * ) of all finite sets of A-traces, considered as a partial commutative monoid with ∅ as the unit, and set union as addition, but defined only for disjoint sets.This partial monoid carries an L-algebra structure h : LΛ → Λ defined by: for any T a , T b , . . .⊆ A * .It is easy check that h is a bijection and a morphism in PCM.In particular, h takes values in finite sets thanks to the restriction of Φ A ω to tuples that are ∅ almost everywhere.
Moreover, h is an initial L-algebra.To see this, consider any algebra k : LΦ → Φ.The unique algebra map f : Λ → Φ from h to k is defined by induction on the length of the longest trace in elements of Λ: where T a = {w ∈ A * | aw ∈ T }, for T ⊆ A * and a ∈ A * .This is a well-formed inductive definition since each T a only contains traces strictly shorter than the longest trace in T .It is also a partial monoid morphism, since if T and T ′ are disjoint sets of traces then T a and T ′ a are disjoint for each a ∈ A, and at most one of T and T ′ contains the empty word ǫ.The fact that f is an algebra morphism follows directly from its definition, and its uniqueness follows by routine induction.
A logic ρ : LF ⇒ F B, where BX = A×X +1, can be defined by its mate ρ ♭ : BG ⇒ GL: where * is the unique element of 1.Both α and ρ are easily seen to be natural, so this completes an instance of the framework of forgetful logics.As a result, for any probabilistic transition system f : X → ∆(A × X + 1) we obtain a map s ♭ : X → hom PCM (Λ, [0, 1]) that assigns, to every state x ∈ X, a map from finite sets of A-traces to the interval [0, 1] that is additive as far as disjoint sets of traces are concerned.Such a map gives (indeed, is equivalent to) a subprobability distribution δ on the set of all A-traces.Indeed, put δ(w) = s ♭ ({w}); then Note that the partial monoid homomorphism s : Λ → (X ⊥ ⊸ [0, 1]) does not map traces to any distributions of states.
In [16,Sec. 7.2], where another coalgebraic approach to generative probabilistic systems was developed, the subprobability distribution monad had to be used instead of ∆.The reason for that was that even though a state in a generative probabilistic system determines a full probability distribution on successors (including immediate termination, i.e. the empty trace, as a degenerate successor), the finite complete traces of a state do not form a probability distribution, but only a subprobability distribution, due to possibility of infinite traces.In the forgetful logic approach the branching type functor ∆ is distinguished from the functor G used to collect a structure of traces, so the distribution monad can be used.Note that although the subdistribution monad is naturally isomorphic to the functor ∆(− + 1) that is present in our behaviour functor, the +1 component here is not a part of the branching structure: it models trace termination and it is very much a part of the trace behaviour structure.In [16], the subdistribution monad is used on top of that, with an additional +1 component necessary to handle global nontermination.
The technique developed in this example does not work for reactive probabilistic transition systems modeled as coalgebras f : X → [0, 1]×(∆X) A .Technically, it is not clear how to find a functor L on PCM with a natural transformation ρ : LF ⇒ F B for BX = [0, 1] × X A , that would model trace semantics as expected.This is not surprising, as under a standard probabilistic semantics of reactive systems, traces accepted from a fixed state do not form a (sub)probability distribution.

Forgetful logics for monads
In most coalgebraic attempts to trace semantics [6,11,16,19,23,30], the functor T , which models the branching aspect of system behaviour, is assumed to be a monad.The basic definition of a forgetful logic is more relaxed in that it allows an arbitrary functor T but one may notice that in all examples in Section 4, T is a monad.
In coalgebraic approaches cited above, the structure of T is resolved using monad multiplication µ : T T ⇒ T .Forgetful logics use transformations α : F ⇒ F T with their mates α ♭ : T G ⇒ G for the same purpose.If T is a monad, it will be useful to assume a few basic axioms analogous to those of monad multiplication: Monad actions on functors are to monads as monoid actions on sets are to monoids.Logics α whose mates are monad actions have a characterization in terms of their corresponding encodings α † : T ⇒ GF defined as in Section 3: Lemma 5.2.For any α : F ⇒ F T , the mate α ♭ : T G ⇒ G is a monad action if and only if α † : T ⇒ GF is a monad morphism.
Proof.This is a special case of [10, Prop.II.1.4],but see Appendix B for a self-contained proof.
This means that a forgetful logic for T whose mate is a monad action, is equivalent to an encoding of the monad structure of T (which is used for resolving branching in [30,12,16,33]) into the monad GF .We shall use this connection in Section 6 to relate forgetful logics to the determinization constructions of [16].
It is easy to check by hand that in all examples in Section 4, α ♭ is an action, but it also follows from the following considerations.
In some well-structured cases, one can search for a suitable α by looking at T -algebras in C. We mention it only briefly and not explain the details, as it will not be directly used in the following.
If C has products, then for any object V ∈ C there is a contravariant adjunction as in Section 2.1, where: D = Set, F = C(−, V ) and G = V − , where V X denotes the Xfold product of V in C. (This adjunction was studied in [25] for the purpose of combining distributive laws.)By the Yoneda Lemma, natural transformations α : F ⇒ F T are in bijective correspondence with algebras g : T V → V .Routine calculation shows that the mate α ♭ is a T -action if and only if the corresponding g is an Eilenberg-Moore algebra for T .
Alternatively, one may assume that C = D is a symmetric monoidal closed category and F = G = V − is the internal hom-functor based on an object V ∈ C. (This adjunction was studied in [20] in the context of coalgebraic modal logic.)If, additionally, the functor T is strong, then every algebra g : T V → V gives rise to α : F ⇒ F T , whose components α X : V X → V T X are given by transposing: If T is a strong monad and g is an Eilenberg-Moore algebra for T then α ♭ is a T -action.
In an enriched setting, if D is enriched over C, both these constructions are instances of a more general one based on the existence of suitable powers.
If C = D = Set then both constructions apply (and coincide).In this situation more can be said [16,14]: the resulting contravariant adjunction can be factored through the category of Eilenberg-Moore algebras for T .

Determinization
The classical powerset construction turns a non-deterministic automaton into a deterministic one, with states of the former interpreted as singleton states in the latter.More generally, a determinization procedure of coalgebras involves a change of state space.We define it as follows.Definition 6.1.Let T, H : C → C be endofunctors.A (T )-determinization procedure of H-coalgebras consists of a natural transformation η : Id ⇒ T , a functor K : C → C and a lifting of T : We will mostly focus on cases where H = T B or H = BT , but in Section 7 we will consider situations where T is not directly related to H.
The classical powerset construction is correct, in the sense that the language semantics of a state x in a non-deterministic automaton coincides with the final semantics (the accepted language) of the singleton of x in the determinized automaton.At the coalgebraic level, we capture trace semantics by a forgetful logic.Then, a determinization procedure is correct if logical equivalence on the original system coincides with behavioural equivalence on the determinized system along η, formally captured as follows.Definition 6.2.A T -determinization procedure ( T , K, η) of H-coalgebras is correct wrt. a logic for H if, for any H-coalgebra (X, f ) with logical semantics s ♭ : (1) s ♭ factors through h • η X , for any K-coalgebra homomorphism h from T (X, f ).
(2) there exists a K-coalgebra homomorphism h from T (X, f ) and a mono m so that s The first condition states that behavioural equivalence on the determinized system implies logical equivalence on the original system; the second condition states the converse.It is standard to define a lifting T : Coalg(H) → Coalg(K) of T from a natural transformation λ : T H ⇒ KT , as follows: for any H-coalgebra (X, f ) and coalgebra morphism h.All of the (liftings in) determinization constructions considered in this paper arise from such natural transformations.
In [16] a more specific kind of determinization for T B-coalgebras was studied, arising from a natural transformation κ : T B ⇒ KT and a monad (T, η, µ).This construction is an instance of (6.1), by setting H = T B and λ = κ • µB : T T B ⇒ KT .We denote the lifting of T arising in this way by T κ .Spelling out the details, for any T B-coalgebra (X, f ) we have: For examples see, e.g., [16] and the end of this section.
The same type of natural transformation can be used to determinize BT -coalgebras.This is again an instance of (6.1), where H = BT and λ = Kµ • κT : T BT ⇒ KT .We denote the lifting of T arising in this way by T κ .Spelling out the details, for any BT -coalgebra (X, f ) we have: This is considered in [33,16] for the case where B = K and κ is a distributive law of monad over functor.In Theorem 6.4 below, we give a sufficient condition for the logical semantics on T B or BT -coalgebras to coincide with a logical semantics on determinized K-coalgebras, for the determinization constructions T κ and T κ .The same condition was recently studied in [8, Lemma 5.11], where it (more precisely, its mate) was proved to hold, under some additional assumptions, if α arises from the algebra µ 1 : T T 1 → T 1 as described in Section 5. First, we prove a general result, in the setting of (6.1), which relates the logical semantics of an H-coalgebra to a logical semantics for the K-coalgebra obtained by applying the lifting T .Lemma 6.3.Assume natural transformations λ : T H ⇒ KT , δ : LF ⇒ F H, θ : LF ⇒ F K and α : F ⇒ F T such that λ is a morphism of logics from θ ⊚ α to α ⊚ δ.
Let s ♭ be the logical semantics of δ on a coalgebra f : X → HX.Then α ♭ Φ • T s ♭ is the logical semantics of θ on the coalgebra (T X, λ X • T f ).
Proof.Consider the following diagram: which commutes, clockwise starting from the top left: by definition of the logical semantics s ♭ , naturality of α ♭ , the assumption that λ is a morphism of logics, and naturality of λ.Commutativity of the outside of the diagram means that α ♭ Φ • T s ♭ is indeed the logical semantics of θ on (T X, λ X • T f ).
Let s ♭ be the semantics of α ⊚ ρ on a coalgebra f : X → T BX, and let s ♭ θ be the semantics of θ on T κ (X, f ) (see (6.2)).Then s ♭ = s ♭ θ • η X .The same holds for the determinization procedure T κ (see (6.3)) for BT -coalgebras and the logic ρ ⊚ α.
Proof.We first consider T B-coalgebras.Our aim is to use Lemma 6.3, instantiated to H = T B, δ = α ⊚ ρ and λ = κ • µB.To this end, we must show that λ is a morphism of logics from θ ⊚ α to α ⊚ α ⊚ ρ, i.e., the outside of the following diagram should commute: Indeed, the diagram commutes, clockwise starting from the top left: by naturality of µ, by the assumption that α ♭ is a T -action, and by the assumption that κ is a morphism of logics from θ ⊚ α to α ⊚ ρ (in fact, since α ♭ is a T -action, µ is a morphism of logics from α to α ⊚ α, hence µB is a morphism from α ⊚ ρ to α ⊚ α ⊚ ρ, and the above diagram is obtained by composing this morphism with κ).By Lemma 6.3, for any T B-coalgebra (X, f ) we obtain where the second equality holds by naturality of η, and the third since α ♭ is a T -action.
For BT -coalgebras, we instantiate Lemma 6.3 to H = BT , δ = ρ ⊚ α and λ = Kµ • κT .We prove that λ is a morphism of logics: The diagram commutes, clockwise starting from the top left: by naturality of κ, the assumption that by κ is a morphism of logics and by the assumption that α ♭ is a T -action (again, the above diagram amounts to a composition of the logic morphisms µ and κ).By Lemma 6.3, for any BT -coalgebra (X, f ) we obtain s ♭ θ = α ♭ Φ • T s ♭ where s ♭ is the logical semantics of ρ ⊚ α on (X, f ) and s ♭ θ is the logical semantics of θ on T κ (X, f ) = (T X, Kµ X • κ T X • T f ).The conclusion of the proof is analogous to the above case of T B-coalgebras.
We apply Theorem 6.4 to obtain a sufficient condition for a determinization construction to be correct with respect to a trace semantics given by a forgetful logic.The main idea is to choose θ to be an expressive logic for K, so that logical equivalence coincides with behavioural equivalence.Corollary 6.5.Let (T, η, µ), α, ρ, θ and κ be as in Theorem 6.4, and suppose that θ is an expressive logic.Then the determinization procedure T κ of T B-coalgebras (6.2) is correct with respect to α ⊚ ρ, and the determinization procedure T κ of BT -coalgebras (6.3) is correct with respect to ρ ⊚ α.
Proof.Let T be either T κ or T κ , let (X, f ) be a T B-coalgebra or a BT -coalgebra respectively, and s ♭ the semantics of the forgetful logic on f .Under the above assumptions, by Theorem 6.4 we have s ♭ = s ♭ θ • η X , where s ♭ θ is the logical semantics of θ on T (X, f ).Since s ♭ θ is a logical semantics it factors through any coalgebra homomorphism, yielding condition (1) of correctness, and since it is expressive it decomposes as a coalgebra homomorphism followed by a mono, yielding condition (2).
To illustrate all this, we show that the determinization of weighted automata as given in [16] is correct with respect to weighted language equivalence.(There is no such result for tree automata, as they do not determinize.)Example 6.6.Fix a semiring S, let B = A × − + 1 and K = S × − A .Consider κ : MB ⇒ KM defined as follows [16]: κ X (ϕ) = (ϕ( * ), λa.λx.ϕ(a, x)).This induces a determinization procedure M κ as in (6.2), for weighted automata.Let α ⊚ ρ be the forgetful logic for weighted automata introduced in Example 4.6, and recall that the logical semantics on a weighted automaton is the usual notion of acceptance of weighted languages.We use Corollary 6.5 to prove that the determinization procedure M κ is correct with respect to α ⊚ ρ.To this end, consider the logic θ ♭ : S × (S − ) A ⇒ S A×−+1 given by the isomorphism, similar to the logic in Example 4.4.Since θ ♭ is componentwise injective, θ is expressive.Moreover, α ♭ is an action (see Section 5).The only remaining condition is commutativity of the diagram in Theorem 6.4, which is a straightforward calculation.This proves correctness of the determinization M κ with respect to the semantics of α ⊚ ρ.Example 6.7.In [33] it is shown how to determinize non-deterministic automata of the form BP ω , where BX = 2 × X A , based on κ = κ o , κ t : P ω (2 × − A ) ⇒ 2 × (P ω −) A (note that B = K in this example) where κ o X (S) = tt iff ∃t.(tt, t) ∈ S, and κ t X (a) = {x | x ∈ t(a) for some (o, t) ∈ S}.In Example 4.4 we have seen an expressive logic ρ and an α so that the logical semantics of ρ ⊚ α yields the usual language semantics.It is now straightforward to check that the determinization κ together with the logics ρ, α above satisfies the condition of Theorem 6.4,where θ = ρ.By Corollary 6.5 this shows the expected result that determinization of non-deterministic automata is correct with respect to language semantics.Moreover, recall that the logic ρ ⊚ β, where β is as defined in Example 4.4, yields a conjunctive semantics.Take the natural transformation τ = τ o , τ t of the same type as κ, where τ o (S) = tt iff o = tt for every (o, t) ∈ S, and τ t = κ t .Using Corollary 6.5 we can verify that this determinization procedure is correct.
One can also get the finite trace semantics of transition systems (Example 4.4) by turning them into non-deterministic automata (then, B and K are different).
Example 6.8.Alternating automata (see Example 4.5) can be determinized into nondeterministic automata in a process that preserves the language semantics.We shall now see how this arises as an application of Theorem 6.4 without a reference to final semantics of coalgebras.
This problem is more subtle than it may look, and our solution from a previous version of this paper [21] suffered from a serious mistake.We therefore present a corrected solution a little more elaborately.
Let BX = 2 × X A as before.We wish to determinize BP ω P ω -coalgebras where, according to Example 4.5, the outer P ω is interpreted disjunctively (as in nondeterministic automata), and the inner P ω is interpreted conjunctively (as in co-nondeterministic automata).The result should be a nondeterministic automaton, i.e., a BP ω -coalgebra with the P ω interpreted disjunctively.If the original alternating automaton had a carrier X, then the nondeterministic automaton should have a carrier P ω X, interpreted conjunctively.
To model all this, we should instantiate Theorem 6.4 so that T = P ω , the functors B and K from the theorem are both BP ω = 2 × (P ω −) A , the logic α from the theorem is instantiated to β from Example 4.5 and the logics ρ and θ from the theorem are both instantiated to ρ ⊚ α from Example 4.5.
We then need to provide an appropriate natural transformation κ : P ω BP ω ⇒ BP ω P ω that would model the intended determinization procedure.It is natural to define it as a composition of two steps: where τ : P ω B ⇒ BP ω is defined as at the end of Example 6.7.As argued there, this distributes B over P ω according to the conjunctive interpretation modeled by the logic β.
The question remains how to define χ : P ω P ω ⇒ P ω P ω so that it distributes the "conjunctive" powerset over the "disjunctive" one as intended.One may attempt (as we did in [21]): χ X (S) = { − → g (S) | g : S → X s.t.g(U ) ∈ U for each U ∈ S} (6.4) which, given a family of sets S, returns all possible sets obtained by choosing a single element from each set in S.
Unfortunately this is not a natural transformation.The following counterexample is due to Joost Winter: consider and calculate: therefore the naturality square for χ on f : X → Y does not commute for the argument {{a, c}, {b, c}} ∈ P ω P ω X.This mistake has occured in the literature before.In [27, pp.183-184], (6.4) was claimed to be a distributive law of the powerset monad over itself, and a monad structure on the double (covariant) powerset was derived from that claim in the standard way.The above counterexample applies there, and the structure defined in [27] is not, in fact, a monad.The mistake can be traced back to [26, pp. 76-79], where the same purported monad structure is defined via a Kleisli triple which, in fact, fails to satisfy one of the axioms of Kleisli triples.
To avoid these problems, we choose another definition of χ: given a finite family S of finite sets, it returns all sets that: • are contained in the union of S (and are therefore finite, and there are finitely many of them), and • intersect with every set in S. Formally: This turns out to be a natural transformation (see Appendix C).As a side remark, note that χ is not a distributive law of the monad P ω over itself; it does not even satisfy the unit axioms.Now the composition κ = Bχ • τ P ω yields a determinization procedure.To show that the diagram in Theorem 6.4 commutes, a key ingredient is the fact that χ correctly distributes conjunction over disjunction or, more formally, that the diagram commutes, where α and β are as in Example 4.5.(See Appendix C for details.)By Theorem 6.4 we conclude that for any alternating automaton: s ♭ = s ♭ ρ⊚α • η X where X is the set of states, s ♭ is the language semantics of the alternating automaton as in Example 4.5, and s ♭ ρ⊚α is the usual language semantics (as in Example 4.4) of the non-deterministic automaton obtained by determinization.
The determinization procedure formalized by our χ (and therefore κ) is slightly different from the standard procedure for transforming alternating automata into nondeterministic ones.It still returns an automaton where states are sets of states of the original alternating automaton, but the family of successors of each such state is larger than in the standard procedure (in particular, it is closed under taking set-theoretic unions).This does not change the language semantics (additional successor states, being supersets of some successor states in the standard nondeterministic automaton, do not accept any additional words), but the reachable part of the nondeterministic automaton may be larger than the one obtained by the standard procedure.As a result, although our determinization is correct, it may be less efficient than the standard one.This is the price we paid to salvage the naturality of χ.We do not know how to model precisely the standard transformation of alternating automata into nondeterministic ones in our framework.7. Logics whose mates are isomorphisms Corollary 6.5 provides a sufficient condition for a given determinization procedure to be correct with respect to a forgetful logic.However, in general there is no guarantee that a correct determinization procedure for a given logic exists.Indeed it would be quite surprising if it did: the language semantics of (weighted) tree automata (see Example 4.6) is an example of a forgetful logic, and such automata are well known not to determinize in a classical setting.
In this section we provide a sufficient condition for a correct determinization procedure to exist.Specifically, for an endofunctor B, we assume a logic ρ whose mate ρ ♭ : BG ⇒ GL is a natural isomorphism.This condition holds, for instance, for ρ in Example 4.4 and for θ in Example 6.6.It has been studied before in the context of determinization constructions [16].Its important consequence is that the logical semantics s ♭ in (2.5) from Section 3 can be seen as a B-coalgebra morphism: Moreover, as shown in [16, Lemma 6] (see also [13]), the construction mapping / / BGA defines a functor Ĝ : Alg(L) → Coalg(B), which is a contravariant adjoint to F (see (2.3) in Section 3).As a result, Ĝ maps initial objects to final ones, hence Ĝ(Φ, a) = (GΦ, (ρ ♭ Φ ) −1 • Ga) is a final B-coalgebra.Therefore, s ♭ is a final coalgebra morphism from (X, h).
7.1.Canonical determinization.The setting of a forgetful logic α, ρ where the mate of ρ is a natural isomorphism gives rise to the following diagrams: The functor F arises from the logic α ⊚ ρ, the functor F ′ arises from ρ ⊚ α, the functor F arises from ρ and its contravariant adjoint Ĝ from the fact that ρ ♭ is iso.Note that we make no assumptions on α; in particular, α ♭ need not be an action.
The composition Ĝ F is a determinization procedure, turning a coalgebra f : X → T BX into a B-coalgebra with carrier GF X. Explicitly, Ĝ F (X, f ) is Similarly, the composition Ĝ F ′ is a determinization procedure, mapping a coalgebra g : These determinization procedures are correct with respect to the logics α ⊚ ρ and ρ ⊚ α respectively, in the following sense, much stronger than required by Definition 6.2.
Theorem 7.1.For any T B-coalgebra (X, f ), the logical semantics s ♭ of α ⊚ ρ on (X, f ) coincides with the final semantics of the B-coalgebra Ĝ F (X, f ) precomposed with the unit ι : Id ⇒ GF .The same holds for BT -coalgebras and ρ ⊚ α.
Proof.Let (X, f ) be a T B-coalgebra (the case of BT -coalgebras is analogous).The logical semantics s ♭ is defined by s ♭ = Gs • ι X , where s : (L, a) → F (X, f ) is the unique algebra morphism arising by initiality.Hence, we only need to show that Gs is the final semantics of Ĝ F (X, f ).To see this, apply Ĝ to s to get a coalgebra morphism But Ĝ(L, a) is a final coalgebra, so we are done.(Note that ε ♭ is always a GF -action on G.) Given a logic ρ for B this gives rise to forgetful logics ρ ⊚ ε and ε ⊚ ρ, for GF B-coalgebras and BGF -coalgebras respectively.Note that these logics do not depend on α anymore.
Lemma 7.2.For any ρ : LF ⇒ F B and α : F ⇒ F T , the natural transformation α † B is a morphism of logics (with id as the translation of syntax) from ε ⊚ ρ to α ⊚ ρ, and Bα † is a morphism from ρ ⊚ ε to ρ ⊚ α.
Proof.It suffices to prove that α † is a morphism of logics from ε to α.This, recalling the definition of α † from Section 3, means that the outside of the following diagram should commute: which follows from naturality of α ♭ and from (2.1).
As a consequence of Lemma 2.3 and the above, we have commuting diagrams where Fε is the functor defined by ε⊚ρ as in (2.3), and F ′ ε the functor defined by ρ⊚ε.Hence, encoding T B-coalgebras as GF B-coalgebras does not change their logical semantics.More precisely, for any f : X → T BX, the map from X to GΦ defined as the logical semantics of ε ⊚ ρ on α † BX • f , coincides with semantics of α ⊚ ρ on f .A similar result holds for BT -coalgebras.
Thanks to the mate ρ ♭ : BG ⇒ GL being an isomorphism, the functor GF has a distributive law over B, denoted κ : GF B ⇒ BGF and defined by: Remark 7.3.The same construction is used in [18] to prove that a functor lifting to the category of Eilenberg-Moore algebras for a monad induces a distributive law.There, the right adjoint G is the (covariant) forgetful functor; having a lifting of B then means having a functor L with the equality BG = GL.
Using κ we can apply the determinization construction from [16] as described in Section 6, putting K = B, and taking the monad on GF arising from the adjunction.Lemma 7.4.The determinization procedure (GF ) κ defined as in (6.2) is correct with respect to ε ⊚ ρ.The determinization procedure (GF ) κ is correct with respect to ρ ⊚ ε.
Proof.We use Corollary 6.5, where we put T = GF , α = ε defined above, K = B, and θ = ρ.Obviously then θ is expressive, and it is easy to check that ε ♭ = Gǫ is an action.The only remaining condition is that κ is a morphism of logics as in Theorem 6.4, which is the outer shape of: Here, the top square commutes by Lemma 2.2 and the bottom square by naturality of (ρ ♭ ) −1 .
Altogether, the following two-step determinization procedures arise: and they are correct with respect to α ⊚ ρ and ρ ⊚ α respectively.
Correctness can also be proved without Corollary 6.5, using Theorem 7.1, since the procedures coincide with the constructions from (7.3) and (7.4): Theorem 7.5.The following diagrams commute: with F and F ′ and Ĝ defined as in (7.2).
Proof.By Lemma 7.2, α † B and Bα † are morphisms of logics, which means that the diagrams in (7.5) commute.Hence, we only need to check commutativity of: For the left triangle, notice that Fε maps any f : which coincides with (GF ) κ (X, f ).Note that GǫF is the multiplication of the monad GF .

7.3.
A connection to Brzozowski's algorithm.Call a B-coalgebra observable if the morphism into a final coalgebra (assuming it exists) is mono [3].For D = Set, the above canonical determinization procedure can be adapted to construct, for any T B-coalgebra, an observable B-coalgebra whose final semantics coincides with the logical semantics on the original one.Indeed, recall that Set has an (epi,mono)-factorization system and L (as every endofunctor on Set) preserves epimorphisms.From this it follows that every L-algebra homomorphism decomposes as a surjective homomorphism followed by an injective one.Given a coalgebra f : X → T BX, apply this to decompose the algebra homomorphism s : (Φ, a) → F (X, f ) as s = m • e, where m and e are injective and surjective respectively; call the L-algebra in the middle (R, r).Recall that Gs is a coalgebra homomorphism into the final coalgebra.In the present situation it decomposes as follows: and recall that Ĝ(Φ, a) is a final coalgebra.Because G is a right adjoint, it maps epis to monos, therefore Ge is injective and Ĝ(R, r) is observable.Moreover, thanks to Theorem 7.1 we have s ♭ = Gs • ι X = Ge • Gm • ι X , hence the final semantics Ge of Ĝ(R, r) coincides with the logical semantics on (X, f ) along the mapping Gm • ι X .
Note that the construction of Ĝ(R, r) from (X, f ) is not a determinization procedure itself according to Definition 6.1, as it does not lift any functor on C.
The above refers to T B-coalgebras, but as everything else in this section, analogous reasoning works also for BT -coalgebras.For T = Id and B = 2 × − A on C = Set, that (almost) corresponds to Brzozowski's algorithm for minimization of deterministic automata [4].Applying F to the given automaton corresponds to reversing transitions and turning final states into initial ones.Epi-mono factorization corresponds to taking the reachable part of this automaton.Then, applying Ĝ reverses transitions again, and turns initial states into final ones.Our abstract approach stops here; the original algorithm concludes by taking the reachable part again, which ensures minimality.
For a more detailed coalgebraic presentation of the full Brzozowski minimization algorithm in several concrete examples, see [3].Another approach, based on duality theory, is presented in [2].The main idea there is similar, in the sense that contravariant adjunctions are lifted to adjunctions between categories of coalgebras and algebras.However, it differs from the above development in that the adjunctions used in [2] are assumed to be dual equivalences, and the lifting of the duality is proved concretely for each example, rather than that a general condition is given.Another coalgebraic approach to minimization, based on partition refinement, is in [1].It is mentioned in the conclusion that part of Brzozowski's algorithm appears as an instance of the abstract construction introduced there, but the precise connection remains to be understood.
Notice that we only assume the mate of ρ to be iso; there are no requirements on α.The mate of ρ is iso for the logic from Example 4.4.Thus, we can instantiate α to obtain observable deterministic automata from non-deterministic automata or even alternating automata (by taking T = P ω P ω and, for α, the composition of α and β from Example 4.5).The logic θ from Example 6.6 is covered as well, so one can treat Moore automata and weighted automata.However, the abstract construction of an observable automaton does not necessarily yield a concrete algorithm, as discussed for the case of weighted automata in [3].The map s ♭ is computed by induction; this is done by turning a weighted tree automaton f into the Σ-algebra F (f ), which can be viewed as a deterministic weighted bottom-up tree automaton.We spell out the details.Given a coalgebra f : X → MΣX the computed Σ-algebra looks as follows: Σ(S X ) ρ X / / S ΣX α ΣX / / S MΣX S f / / S X We have α X (ϕ)(ψ) = Recall the definitions: First let us assume that α ♭ : T G ⇒ G is a monad action, and check the axioms of monad morphisms for α † .The unit axiom is the outer shape of: where the square commutes by naturality of η, and the triangle by a monad action axiom.The multiplication axiom is the outer shape of:

T GF GF
where everything commutes, from left to right: by naturality of µ, by a monad action axiom, by (2.1) and by naturality of α ♭ .Now assume that α † : T ⇒ GF is a monad morphism, and check the axioms of monad actions for α ♭ .The unit axiom is the outer shape of: where the left triangle is the unit axiom of a monad morphism, and the right triangle is (2.1).The multiplication axiom is the outer shape of: where the leftmost shape is the multiplication axiom of a monad morphism, and the two smaller squares commute by naturality of α † and ǫ. and thus which coincides with α ♭ A×Φ+1 •Mδ ♭ Φ as computed (in a more general setting) in Appendix A.

2. 1 .
Contravariant adjunctions.The basic framework of coalgebraic logic is formed of two categories C, D connected by functors F : C op → D and G : D op → C that form an adjunction F op ⊣ G.For example, one may take C = D = Set and F = G = 2 − , for 2 a two-element set of logical values.The intuition is that objects of C are collections of processes, or states, and objects of D are logical theories.

5 ) 2 . 3 .
Morphisms of logics.Given logics ρ : LF ⇒ F B and θ : M F ⇒ F K, a morphism from θ to ρ consists of a pair of natural transformations τ : M ⇒ L and κ : B ⇒ K such that the following diagram commutes:

7. 2 .
Determinization after preprocessing.Strictly speaking, the above constructions Ĝ F and Ĝ F ′ are not examples of determinization procedures as understood in[16]: the functors Ĝ F and Ĝ F ′ lift GF rather than T , and the liftings do not arise from a natural transformation as described in Section 6.However, they are almost examples: after an encoding of T B-coalgebras as GF B-coalgebras and of BT -coalgebras as BGF -coalgebras, they arise from a distributive law κ : GF B ⇒ BGF .Indeed, recall from Section 3 that α : F ⇒ F T uniquely determines a natural transformation α † : T ⇒ GF .Furthermore, this induces functors Coalg(BT ) Bα † •− −−−−→ Coalg(BGF ) and Coalg(T B) α † B•− −−−− → Coalg(GF B), by simple composition.Now, define a canonical logic for GF by ε = ǫF : F ⇒ F GF, or equivalently, ε ♭ = Gǫ : GF G ⇒ G.