Keywords

1 Introduction

In recent years we have witnessed a rapid development of the theory of coalgebras as a unifying theory for state-based systems [11, 14, 19, 31]. Coalgebras to some extent are one-step entities in their nature. They can be thought of and understood as a representation of a single step of visible computation of a given process. Yet, for many state-based systems it is useful to consider a part of computation branch that is allowed to take several steps and in some sense remains neutral (invisible) to the structure of the process. For instance, the so-called \(\tau \)-transitions also called invisible transitions for labelled transition systems [25, 26] or \(\varepsilon \)-transitions for non-deterministic automata [15]. As will be witnessed here, these special branches of computation are the same in their nature, yet they are used in order to develop different notions of equivalence of processes, e.g. weak bisimulation for LTS [25] or trace semantics for non-deterministic automata with \(\varepsilon \)-moves, we call \(\varepsilon \)-NA in short [15]. These are not the only state-based systems considered in the literature with a special invisible computational branch. Fully probabilistic systems [3] or Segala systems [33, 34] are among those, to name a few. All these systems are instances of a general notion of a coalgebra. If so, then how should we consider the invisible part of computation coalgebraically? As we will see further on, the invisible part of the computation can be and should be, in our opinion, considered as part of the unit of a monad. Before we state basic results let us summarize known literature on the topic of invisible transitions from perspective of weak bisimulation, trace semantics and coalgebra.

Weak Bisimulation. The notion of a strong bisimulation for different transition systems plays an important role in theoretical computer science. A weak bisimulation is a relaxation of this notion by allowing silent, unobservable transitions. Here, we focus on the weak bisimulation and weak bisimilarity proposed by R. Milner [25, 26] (see also [32]). Analogues of Milner’s weak bisimulation are established for different deterministic and probabilistic transition systems (e.g. [3, 3234]). It is well known that one can introduce Milner’s weak bisimulation for LTS in several different but equivalent ways.

The notion of a strong bisimulation, unlike the weak bisimulation, has been well captured coalgebraically (see e.g. [11, 31, 39]). Different approaches to defining weak bisimulations for coalgebras have been presented in the literature. The earliest paper is [30], where the author studies weak bisimulations for while programs. In [28] the author introduces a definition of weak bisimulation for coalgebras by translating a coalgebraic structure into an LTS. This construction works for coalgebras over a large class of functors but does not cover the distribution functor, hence it is not applicable to different types of probabilistic systems. In [29] weak bisimulations are introduced via weak homomorphisms. As noted in [38] this construction does not lead to intuitive results for probabilistic systems. In [38] the authors present a definition of weak bisimulation for classes of coalgebras over functors obtained from bifunctors. Here, weak bisimulation of a system is defined as a strong bisimulation of a transformed system. In [5] we proposed a new approach to defining weak bisimulation in two different ways. Two definitions of weak bisimulation described by us in [5] were proposed in the setting of coalgebras over ordered functors. The key ingredient of the definitions is the notion of a saturator. As noted in [5] the saturator is sometimes too general to model only weak bisimulation and may be used to define other known equivalences, e.g. delay bisimulation [32]. Moreover, the saturators from [5] do not arise in any natural way. To deal with this problem we have presented a canonical way to consider weak bisimulation saturation in our previous paper [6]. Part of the results from [6] are recalled in this paper.

We should also mention [10, 24] which appeared almost at the same time as our previous paper [6]. The former is a talk on the on-going research by S. Goncharov and D. Pattinson related to weak bisimulation for coalgebras. Their approach is similar to ours as it uses fixed points. It is worth noting that the authors cover some examples that do not fit our framework (e.g. fully probabilistic systems). However, they do not hide the invisible steps inside a monadic structure. The latter is a paper in which the authors study weak bisimulation for labelled transition systems weighted over semirings. They propose a coalgebraic approach towards defining weak bisimulation which relies on \(\varepsilon \)-elimination procedure presented in [35].

Weak Trace Semantics. Trace semantics is a standard behavioural equivalence for many state-based systems. Generic trace semantics for coalgebras has been proposed in [14, 19]. If \(T\) is a monad on a category \(\mathsf {C}\) and \(F:\mathsf {C}\rightarrow \mathsf {C}\) is an endofunctor then the trace semantics of \(TF\)-coalgebras is final semantics for coalgebras considered in a different category, namely the Kleisli category for the monad \(T\) [14, 17]. It is worth noting that trace semantics can also be defined for \(GT\)-coalgebras for an endofunctor \(G:\mathsf {C}\rightarrow \mathsf {C}\) [19, 36] via the so-called \(\mathcal {EM}\)-extension semantics. In our paper however, we focus only on \(TF\)-coalgebras and do not consider \(GT\)-coalgebras. Trace semantics can also be defined for different state-based systems with internal, invisible moves. In order to distinguish trace semantics for systems with and without silent steps we will sometimes call the former “weak trace semantics”. One coalgebraic approach towards defining trace semantics for systems with \(\varepsilon \)-moves (invisible moves) is based on a very simple idea, has been presented in [13, 35] and can be summarized as follows. In the first step we consider invisible moves as visible. Then we find the trace semantics for an “all-visible-steps” coalgebra and finally, we remove all occurrences of the invisible label and get the desired weak trace semantics. We discuss this approach in our paper and call it the “top-down” approach. The term “top-down” refers to the fact that we somewhat artificially treat the invisible moves as if they were visible and then we remove their occurrences from the trace. Such an approach does not use any structural properties of silent moves. A dual approach, a “bottom-up” method, should make use of their structural properties. Here, we present a “bottom-up” method for coalgebras with internal steps that treats silent moves as part of the unit of a certain monad.

Content and Organization of the Paper. The paper is organized as follows. Section 2 recalls basic notions in category theory, algebra and coalgebra. Section 3 describes two very general methods for dealing with silent steps via a monadic structure that have been proposed in our previous work [6]. We will see that these two methods appear in classical definitions of a weak bisimulation for LTS’s. In Sect. 4 we recall the definition of an order saturation monad that comes from [6] and claim that this object is suitable for defining weak bisimulations for coalgebras. An order saturation monad is an order enriched monad equipped with an extra operator, a saturator \((-)^{*}\), that assigns to any coalgebra \(\alpha :X\rightarrow TX\) a coalgebra \(\alpha ^{*}~:~X\rightarrow TX\) and can be thought of as a reflexive, transitive closure operator. It turns out that in the classical literature on labelled transition systems and weak bisimulation one can find two different saturators yelding the same notion of equivalence. These two saturators are natural consequences of the two stategies towards handling invisible steps via monadic structure. What is new in this section is the following:

  • Weak bisimulation is defined as a kernel bisimulation [39] on a saturated structure and not via lax- and oplax-homomorphisms in Aczel-Mendler style as it was done in [6].

  • We present both saturators in a general setting and ask when they yield the same notion of weak bisimulation. We give sufficient conditions functors should satisfy so that weak bisimulation coincides for both approaches.

In Sect. 5 we discuss a novel approach towards defining trace semantics for coalgebras with internal moves. Here, weak trace semantics morphism is obtained axiomatically by the so-called coalgebraic trace operator, i.e. a uniform fixed point operator. For \(\mathbf{Cppo }\)-enriched monads, a coalgebraic trace operator is given by the least fixed point operator \(\mu x.(x\cdot \alpha )\). Moreover, we show that the coalgebraic trace operator for \(\varepsilon \)-NA’s arises from properties of the so-called free LTS monad. To be more precise, Kleisli category for the free LTS monad is traced monoidal category in the sense of Joyal et al. [16]. In Sect. 6, in a fairly general setting, we formulate how strong bisimulation, weak bisimulation and weak trace semantics are related. Hence, according to our knowledge we present the first paper that considers a comparison of three different behaviour equivalences in van Glabbeek’s spectrum for systems with internal moves [8] from coalgebraic perspective.

2 Basic Notions and Properties

Algebras and Coalgebras. Let \(\mathsf {C}\) be a category and let \(F :\mathsf {C}\rightarrow \mathsf {C}\) be a functor. An \(F\)-algebra is a morphism \(a:FA\rightarrow A\) in \(\mathsf {C}\). A homomorphism between algebras \(a:FA\rightarrow A\) and \(b:FB\rightarrow B\) is a morphism \(f:A\rightarrow B\) in \(\mathsf {C}\) such that \(b\circ F(f) = f\circ a\). Dually, an \(F\)-coalgebra is a morphism \(\alpha :X\rightarrow FX\) in \(\mathsf {C}\). The domain \(X\) of \(\alpha \) is called carrier and the morphism \(\alpha \) is sometimes also called structure. A homomorphism from an \(F\)-coalgebra \(\alpha :X\rightarrow FX\) to an \(F\)-coalgebra \(\beta :Y\rightarrow FY\) is a morphism \(f :X\rightarrow Y\) in \(\mathsf {C}\) such that \( F(f)\circ \alpha = \beta \circ f\). The category of all \(F\)-coalgebras (\(F\)-algebras) and homomorphisms between them is denoted by \(\mathsf {C}_F\) (resp. \(\mathsf {C}^F\)). Many transition systems can be captured by the notion of coalgebra. In this paper we mainly focus on labelled transition systems with a silent label and non-deterministic automata with \(\varepsilon \)-moves. These two structures have been defined and thoroughly studied in the computer science literature (see e.g. [15, 25, 26, 32]). Let \(\varSigma \) be a fixed set of alphabet letters. A labelled transition system over the alphabet \(\varSigma _\tau = \varSigma + \{\tau \}\) (or an LTS in short) is a triple \(\langle X,\varSigma _{\tau },\rightarrow \rangle \), where \(X\) is called a set of states and \(\rightarrow \subseteq X\times \varSigma _\tau \times X\) is a transition. The label \(\tau \) is considered a special label sometimes called silent or invisible label. For an LTS \(\langle X,\varSigma _\tau ,\rightarrow \rangle \) instead of writing \((x,\sigma ,x')\in \rightarrow \) we write \(x\mathop {\rightarrow }\limits ^{\sigma }x'\). Labelled transition systems can be viewed as coalgebras over the type \(\mathcal {P}(\varSigma _\tau \times \mathcal {I}d)\) [31]. From coalgebraic perspective, a non-deterministic automaton with \(\varepsilon \)- \(transitions\), or \(\varepsilon \)-\(NA\) in short, over alphabet \(\varSigma \) is a coalgebra of the type \(\mathcal {P}(\varSigma _\varepsilon \times \mathcal {I}d + 1)\), where \(1=\{\checkmark \}\) is fixed one element set and \(\varSigma _\varepsilon = \varSigma + \{\varepsilon \}\). Note that LTS’s differ from \(\varepsilon \)-NA’s in the presence of \(1\) in the type. It is responsible for specifying which states are final and which are not. To be more precise for \(\varepsilon \)-NA \(\alpha :X\rightarrow \mathcal {P}(\varSigma _\varepsilon \times X + 1)\) we call a state \(x\in X\) final if \(\checkmark \in \alpha (x)\). For more information on automata the reader is referred to e.g. [15].

Strong Bisimulation for Coalgebras. Notions of strong bisimulation have been well captured coalgebraically [2, 11, 31, 39]. Let \(F\) be a \(\mathsf {Set}\)-endofunctor and consider an \(F\)-coalgebra \(\alpha :X\rightarrow FX\). In Aczel-Mendler style [2, 39], a (strong) bisimulation is a relation \(R\subseteq X\times X\) for which there is a structure \(\gamma :R\rightarrow TR\) making \(\pi _1:R\rightarrow X\) and \(\pi _2:R\rightarrow X\) homomorphisms between \(\gamma \) and \(\alpha \). In this paper however we consider defining bisimulation as the so-called kernel bisimulation [39]. Let \(F:\mathsf {C}\rightarrow \mathsf {C}\) be an endofunctor on an arbitrary category. Let \(\alpha :X\rightarrow FX\) and \(\beta :Y\rightarrow FY\) be \(F\)-coalgebras. A relation \(R\) on \(X\) and \(Y\) (i.e. a jointly-monic span \(X\mathop {\leftarrow }\limits ^{\pi _1} R \mathop {\rightarrow }\limits ^{\pi _2} Y\) in \(\mathsf {C}\)) is kernel bisimulation or bisimulation in short if there is a coalgebra \(\gamma :Z\rightarrow FZ\) and homomorphisms \(f\) from \(\alpha \) to \(\gamma \) and \(g\) from \(\beta \) to \(\gamma \) such that \(R\) with \(\pi _1\), \(\pi _2\) is the pullback of \(X\mathop {\rightarrow }\limits ^{f} Z \mathop {\leftarrow }\limits ^{g} Y\). For a thorough study of the relation between Aczel-Mendler style of defining bisimulation and kernel bisimulation the reader is referred to [39] for details.

Monads. A monad on \(\mathsf {C}\) is a triple \((T,\mu ,\eta )\), where \(T:\mathsf {C}\rightarrow \mathsf {C}\) is an endofunctor and \(\mu :T^2\implies T\), \(\eta :\mathcal {I}d\implies T\) are two natural transformations for which the following two diagrams commute: The transformation \(\mu \) is called multiplication and \(\eta \) unit. Each monad gives rise to a canonical category - Kleisli category for \(T\). If \((T,\mu ,\eta )\) is a monad on category \(\mathsf {C}\) then Klesli category \(\mathcal {K}l(T)\) for \(T\) has the class of objects equal to the class of objects of \(\mathsf {C}\) and for two objects \(X,Y\) in \(\mathcal {K}l(T)\) we have \(Hom_{\mathcal {K}l(T)}(X,Y) = Hom_{\mathsf {C}}(X,TY)\) with the composition \(\cdot \) in \(\mathcal {K}l(T)\) defined between two morphisms \(f:X\rightarrow TY\) and \(g:Y\rightarrow TZ\) by \(g\cdot f := \mu _Z \circ T(g) \circ f\) (here, \(\circ \) denotes the composition in \(\mathsf {C}\)).

figure a

Example 1

The powerset endofunctor \(\mathcal {P}:\mathsf {Set}\rightarrow \mathsf {Set}\) is a monad with the multiplication \(\mu :\mathcal {P}^2\implies \mathcal {P}\) and the unit \(\eta :\mathcal {I}d\implies \mathcal {P}\) given on their \(X\)-components by \(\mu _X:\mathcal {P}\mathcal {P}X\rightarrow \mathcal {P}X; S \mapsto \bigcup S\) and \(\eta _X:X\rightarrow \mathcal {P}X; x\mapsto \{x\}\). For any category \(\mathsf {C}\) with binary coproducts and an object \(A\in \mathsf {C}\) define \(\mathcal {M}_A:\mathsf {C}\rightarrow \mathsf {C}\) as \(\mathcal {M}_A =\mathcal {I}d + A\). The functor carries a monadic structure \((\mathcal {M}_A,\mu ,\eta )\), where the \(X\)-components of the multiplication and the unit are the following: \(\mu _X:(X+A)+A\rightarrow X+A; \mu _X = [id_{X+A},\iota ^2]\) and \(\eta _X:X\rightarrow X+A; \eta _X=\iota ^1\). Here, \(\iota ^1\) and \(\iota ^2\) denote the coprojections into the first and the second component of \(X+A\) respectively. The monad \(\mathcal {M}_A\) is sometimes called exception monad.

Since in many cases we will work with two categories at once: \(\mathsf {C}\) and \(\mathcal {K}l(T)\), morphisms in \(\mathsf {C}\) will be denoted using standard arrow \(\rightarrow \), whereas for morphisms in \(\mathcal {K}l(T)\) we will use the symbol \(\multimap \). For any object \(X\) in \(\mathsf {C}\) (or equivalently in \(\mathcal {K}l(T)\)) the identity map from \(X\) to itself in \(\mathsf {C}\) will be denoted by \(id_X\) and in \(\mathcal {K}l(T)\) by \(1_X\) or simply \(1\) if the domain can be deduced from the context.

The category \(\mathsf {C}\) is a subcategory of \(\mathcal {K}l(T)\) where the inclusion functor \(^{\sharp }\) sends each object \(X\in \mathsf {C}\) to itself and each morphism \(f:X\rightarrow Y\) in \(\mathsf {C}\) to the morphism \(f^{\sharp }:X\multimap Y\) given by \( f^{\sharp }:X\rightarrow TY; f^{\sharp } = \eta _Y\circ f\). Each monad \((T,\mu ,\eta )\) on a category \(\mathsf {C}\) arises as the composition of left and right adjoint:

figure b

Here, \(U_T:\mathcal {K}l(T)\rightarrow \mathsf {C}\) is a functor defined as follows. For any object \(X\in \mathcal {K}l(T)\) (i.e. \(X\in \mathsf {C}\)) the object \(U_T X\) is given by \(U_T X := TX\) and for any morphism \(f:X\multimap Y\) in \(\mathcal {K}l(T)\) (i.e. \(f:X\rightarrow TY\) in \(\mathsf {C}\)) the morphism \(U_T f:TX\rightarrow TY\) is given by \(U_T f = \mu _Y\circ Tf\).

We say that a functor \(F:\mathsf {C}\rightarrow \mathsf {C}\) lifts to an endofunctor \(\overline{F}:\mathcal {K}l(T)\rightarrow \mathcal {K}l(T)\) provided that the following diagram commutes [14, 19]:

There is a one-to-one correspondence between liftings \(\overline{F}\) and distributive laws \(\lambda : FT\implies TF\) [19, 23]. Given a distributive law \(\lambda :FT\implies TF\) a lifting \(\overline{F}:\mathcal {K}l(T)\rightarrow \mathcal {K}l(T)\) is defined by:

$$\begin{aligned}&\overline{F}X := FX \text { for any object } X\in \mathcal {K}l(T),\\&\overline{F}f:FX\rightarrow TFY; \overline{F}f = \lambda _Y \circ Ff \text { for any morphism } f:X\rightarrow TY. \end{aligned}$$

Conversely, a lifting \(\overline{F}:\mathcal {K}l(T)\rightarrow \mathcal {K}l(T)\) of \(F\) gives rise to a distributive law \(\lambda :FT\implies TF\) defined by \(\lambda _X:FTX\rightarrow TFX; \lambda _X = \overline{F}(id_{TX})\). A monad \(T\) on a cartesian closed category \(\mathsf {C}\) is called strong if there is a transformation \(\text {st}_{X,Y}:X\times TY\rightarrow T(X\times Y)\) called tensorial strength satisfying the strength laws listed in e.g. [20]. Existence of strength guarantees that for any object \(\varSigma \) the functor \(\varSigma \times \mathcal {I}d:\mathsf {C}\rightarrow \mathsf {C}\) admits a lifting \(\overline{\varSigma }:\mathcal {K}l(T)\rightarrow \mathcal {K}l(T)\). To be more precise we define a functor \(\overline{\varSigma }:\mathcal {K}l(T)\rightarrow \mathcal {K}l(T)\) as follows. For any object \(X\in \mathcal {K}l(T)\) (i.e. \(X\in \mathsf {C}\)) we put \( \overline{\varSigma }X := \varSigma \times X, \) and for any morphism \(f:X\multimap Y\) (i.e. \(f:X\rightarrow TY\) in \(\mathsf {C}\)) we define \(\overline{\varSigma }f:\varSigma \times X\rightarrow T(\varSigma \times Y)\) by \(\overline{\varSigma }f:= \text {st}_{\varSigma ,Y}\circ ( id_{\varSigma }\times f)\). Existence of the transformation \(\text {st}_{X,Y}\) is not a strong assumption. For instance all monads on \(\mathsf {Set}\) are strong.

A category is order enriched if each hom-set is a poset with order preserved by composition. An endofunctor on an order enriched category is locally monotonic if it preserves order. A category \(\mathsf {C}\) is Cppo-\(enriched\) if for any objects \(X,Y\):

  • the hom-set \(Hom_{\mathsf {C}}(X,Y)\) is a poset with a least element \(\perp \),

  • for any ascending \(\omega \)-chain \(f_0\leqslant f_1\leqslant \ldots \) in \(Hom_{\mathsf {C}}(X,Y)\) the supremum \(\bigvee _{i\in \mathbb {N}} f_i\) exists,

  • \(g\circ \bigvee _{i\in \mathbb {N}} f_i = \bigvee _{i\in \mathbb {N}} g\circ f_i\) and \((\bigvee _{i\in \mathbb {N}} f_i)\circ h = \bigvee _{i\in \mathbb {N}} f_i\circ h\) for any ascending \(\omega \)-chain \(f_0\leqslant f_1\leqslant \ldots \) and \(g,h\) with suitable domain and codomain.

Note that it is not necessarily the case that \(f\circ \perp =\perp \) or \(\perp \circ f=\perp \) for any morphism \(f\). An endofunctor on a \(\mathbf{Cppo }\)-enriched category is called locally continuous if it preserves suprema of ascending \(\omega \)-chains. For more details on \(\mathbf {Cppo}\)-enriched categories the reader is referred to e.g. [1, 14].

Example 2

The Kleisli category for the powerset monad \(\mathcal {P}\) is \(\mathbf{Cppo }\)-enriched [14]. The order on the hom-sets is imposed by the natural point-wise order. The strength map for \(\mathcal {P}\) is given by

$$\text {st}_{X,Y}:X\times \mathcal {P}Y\rightarrow \mathcal {P}(X\times Y); (x,S) \mapsto \{(x,y)\mid y\in S\}.$$

The lifting \(\overline{\varSigma }:\mathcal {K}l(\mathcal {P})\rightarrow \mathcal {K}l(\mathcal {P})\) of \(\varSigma \times \mathcal {I}d:\mathsf {Set}\rightarrow \mathsf {Set}\) is a locally continuous functor [14]. The Kleisli category for the monad \(\mathcal {M}_1\) on \(\mathsf {Set}\) is also \(\mathbf{Cppo }\)-enriched [14]. Order on hom-sets is imposed by the point-wise order and for any \(X\) the set \(\mathcal {M}_1 X=X + 1=X + \{\perp \}\) is a poset whose partial order \(\leqslant \) is given by \(x\leqslant y\) iff \(x=\perp \) or \(x=y\).

Monads on Kleisli Categories. In this paper we will often work with monads on Kleisli categories. Here we list basic properties of such monads. Everything presented below with the exception of the last theorem follows easily by classical results in category theory (see e.g. [21]). Assume that \((T,\mu ,\eta )\) is a monad on \(\mathsf {C}\) and \(S:\mathsf {C}\rightarrow \mathsf {C}\) is a functor that lifts to \(\overline{S}:\mathcal {K}l(T)\rightarrow \mathcal {K}l(T)\) with the associated distributive law \(\lambda :ST\implies TS\). Moreover, let \((\overline{S},m,e)\) be a monad on \(\mathcal {K}l(T)\). We have the following two adjoint situations whose composition is an adjoint situation [21].

This yields a monadic structure on the functor \(TS:{\mathsf {C}}\rightarrow {\mathsf {C}}\). The \(X\)-components of the multiplication \(\mathfrak {m}\) and the unit \(\mathfrak {e}\) of the monad \(TS\) are given by:

$$ \mathfrak {m}_X = \mu _{SX}\circ T\mu _{SX} \circ TT m_X \circ T\lambda _{SX} \quad \text {and}\quad \mathfrak {e}_X = e_X. $$

The composition \(\cdot \) in \(\mathcal {K}l(TS) = \mathcal {K}l(\overline{S})\) is given in terms of the composition in \(\mathsf {C}\) as follows. For \(f:X\rightarrow TSY\) and \(g:Y\rightarrow TSZ\) we have:

The following result can be proved by straightforward verification.

Theorem 1

Assume that \(\mathcal {K}l(T)\) is \(\mathbf{Cppo }\)-enriched and \(\overline{S}\) is locally continuous. Then \(\mathcal {K}l(TS)=\mathcal {K}l(\overline{S})\) is \(\mathbf{Cppo }\)-enriched.

3 Hiding Internal Moves Inside a Monadic Structure

Throughout this paper we assume that \((T,\mu ,\eta )\) is a monad on a category \(\mathsf {C}\) with binary coproducts. Let \( + \) denote the binary coproduct operator in \(\mathsf {C}\). Assume that \(F:\mathsf {C}\rightarrow \mathsf {C}\) is a functor and let \(F_\tau =F + \mathcal {I}d\). In this paper we deal with functors of the form \(TF_\tau = T(F + \mathcal {I}d)\). Labelled transition system and \(\varepsilon \)-NA functor are of this form since

$$\begin{aligned}&\mathcal {P}(\varSigma _\tau \times \mathcal {I}d)\cong \mathcal {P}(\varSigma \times \mathcal {I}d + \mathcal {I}d)=\mathcal {P}(F + \mathcal {I}d) \text { for } F=\varSigma \times \mathcal {I}d \text { and }\\&\mathcal {P}(\varSigma _\varepsilon \times \mathcal {I}d + 1)\cong \mathcal {P}(\varSigma \times \mathcal {I}d + 1 + \mathcal {I}d) = \mathcal {P}(F + \mathcal {I}d) \text { for }F=\varSigma \times \mathcal {I}d + 1. \end{aligned}$$

The functor \(F\) represents the visible part of the structure, whereas the functor \(\mathcal {I}d\) represents silent moves. Functors of this type were used to consider \(\varepsilon \)-elimination from coalgebraic perspective in [13, 35]. In [6] we noticed that given some mild assumptions on the monad \(T\), the functor \(TF_\tau \) can itself be turned into a monad or embedded into one. The aim of this section is to recall these results here. Before we do it, we will list basic definitions and properties concerning categories and monads used in the construction.

Basic Definitions and Properties. For a family of objects \(\{X_k\}_{k\in I}\) if the coproduct \(\coprod _i X_i\) exists then by \(\iota ^k:X_k \rightarrow \coprod _k X_k\) we denote the coprojection into \(k\)-th component of \(\coprod _k X_k\).

We say that a category is a category with zero morphisms if for any two objects \(X,Y\) there is a morphism \(0_{X,Y}\) which is an annihilator w.r.t. composition. To be more precise \(f\circ 0 = 0=0\circ g\) for any morphisms \(f,g\) with suitable domain and codomain.

Example 3

For the monad \(T\in \{\mathcal {P},\mathcal {M}_1\}\) on \(\mathsf {Set}\) the category \(\mathcal {K}l(T)\) is a category with zero morphisms given by \(\perp :X\rightarrow \mathcal {P}Y; x\mapsto \varnothing \) for \(\mathcal {P}\) and \(\perp :X\rightarrow \mathcal {M}_1 Y; x\mapsto \perp \) for the monad \(\mathcal {M}_1\).

Given two monads \((S,\mu ^S,\eta ^S)\) and \((S',\mu ^{S'},\eta ^{S'})\) a monad morphism \(h\) is a natural transformation \(h:S\implies S'\) which preserves unit and multiplication of monads, i.e. \(h\circ \eta ^{S} =\eta ^{S'}\) and \(h\circ \mu ^{S} = \mu ^{S'}\circ hh\). A free monad over a functor \(F:\mathsf {C}\rightarrow \mathsf {C}\) [7, 22] is a monad \((F^{*},m,e)\) together with a natural transformation \(\nu :F\implies F^{*}\) such that for any monad \((S,m^S,e^S)\) on \(\mathsf {C}\) and a natural transformation \(s:F\implies S\) there is a unique monad morphism \(h:(F^{*},m,e)\rightarrow (S,m^S,e^S)\) such that the following diagram commutes:

Theorem 2

[7] Assume that for an endofunctor \(F:\mathsf {C}\rightarrow \mathsf {C}\) and any object \(X\) the free \(F\)-algebra over \(X\) (=initial \(F(-) + X\)-algebra) \(i_X\) exists in \(\mathsf {C}^F\). For an object \(X\) and a morphism \(f:X\rightarrow Y\) in \(\mathsf {C}\) let \(F^{*}X\) denote the carrier of \(i_X\) and \(F^{*}f:F^{*}X\rightarrow F^{*}Y\) denote the unique morphism for which the following diagram commutes:

The assignment \(F^{*}\) is functorial and can be naturally equipped with a monadic structure \((F^{*},m,e)\) which is a consequence of the universal properties of \(i_X\). Moreover, this monad is the free monad over \(F\).

In the sequel we assume the following:

  • The functor \(F:\mathsf {C}\rightarrow \mathsf {C}\) lifts to \(\overline{F}:\mathcal {K}l(T)\rightarrow \mathcal {K}l(T)\). As a direct consequence we get that \(F_\tau = F + \mathcal {I}d\) lifts to a functor \(\overline{F_\tau }=\overline{F} + \mathcal {I}d\) on \(\mathcal {K}l(T)\). This follows by the fact that coproducts in \(\mathcal {K}l(T)\) come from coproducts in the base category (see also e.g. [14] for a discussion on liftings of coproducts of functors).

  • The functor \(F\) admits the free \(F\)-algebra \(i_X\) in \(\mathsf {C}^F\) for any object \(X\). By theorem above this yields the free monad \((F^{*},m,e)\) over \(F\) in \(\mathsf {C}\).

Monadic Structure on \({\varvec{TF}}_{\varvec{\tau }}\mathbf{.}\) The aim of this subsection is to present the first strategy towards handling the invisible part of computation by a monadic structure. Note that in the following result all morphisms, in particular all coprojections and mediating morphisms, live in \({\mathcal {K}}l(T)\).

Theorem 3

[6] If \(\mathcal {K}l(T)\) is a category with zero morphisms then the triple \((\overline{F_\tau },m',e')\), where \(e':\mathcal {I}d\multimap \overline{F} + \mathcal {I}d; e_X' = \iota ^2\) and

$$\begin{aligned}&m':\overline{F}(\overline{F} + \mathcal {I}d) + (\overline{F} + \mathcal {I}d)\mathop {\multimap }\limits ^{\overline{F}([0,id]) + id} \overline{F} + (\overline{F} + \mathcal {I}d) \mathop {\multimap }\limits ^{[\iota ^1,id]} \overline{F} + \mathcal {I}d \end{aligned}$$

is a monad on \(\mathcal {K}l(T)\). Two adjoint situations \(\mathsf {C}\rightleftarrows \mathcal {K}l(T) \rightleftarrows \mathcal {K}l(\overline{F_\tau })\) yield a monadic structure on \(TF_\tau \).

The composition \(\cdot \) in \(\mathcal {K}l(TF_\tau )=\mathcal {K}l(\overline{F_\tau })\) is given as follows. Let \(\lambda :F_\tau T\implies TF_\tau \) denote the distributive law associated with the lifting \(\overline{F_\tau }\) of \(F_\tau \). For any \(f:X\rightarrow TF_\tau Y\), \(g:Y\rightarrow TF_\tau Z\) we have:

$$ g\cdot f = \mu _{F_\tau Z}\circ T\mu _{F_\tau Z} \circ TTm'_Z \circ T \lambda _{F_\tau Z} \circ TF_\tau g \circ f. $$

We illustrate the above construction in the following example, where \(T=\mathcal {P}\) and \(F_\tau = \varSigma _\tau \times \mathcal {I}d\).

Example 4

As mentioned before, the monad \(\mathcal {P}\) (as any other monad on \(\mathsf {Set}\)) comes with strength \(\text {st}\) which lifts the functor \(\varSigma _\tau \times \mathcal {I}d:\mathsf {Set}\rightarrow \mathsf {Set}\) to the functor \(\overline{\varSigma _\tau }:\mathcal {K}l(\mathcal {P})\rightarrow \mathcal {K}l(\mathcal {P})\). For the functor \(\overline{\varSigma _\tau }\cong \overline{\varSigma }+\mathcal {I}d\) we define the multiplication \(m'\) and the unit \(e'\) as in Theorem 3. For any set \(X\in \mathcal {K}l(\mathcal {P})\) we put \(m_X':\overline{\varSigma _\tau }\overline{\varSigma _\tau } X\multimap \overline{\varSigma _\tau } X\) and \(e_X':X\multimap \overline{\varSigma _\tau }X\) to be:

$$ m_X'(\sigma _1,\sigma _2,x) = \left\{ \begin{array}{cc} \{(\sigma _1,x)\} &{} \text {if } \sigma _2 = \tau , \\ \{(\sigma _2,x)\} &{} \text {if } \sigma _1 = \tau , \\ \varnothing &{} \text {otherwise}\end{array}\right. \qquad e_X'(x) = \{(\tau ,x)\}. $$

By Theorem 3 the triple \((\overline{\varSigma _\tau },m',e')\) is a monad on \(\mathcal {K}l(\mathcal {P})\). By composing the two adjoint situations we get a monadic structure on the LTS functor. The composition in \(\mathcal {K}l(\mathcal {P}(\varSigma _\tau \times ~\mathcal {I}d))\) is given as follows. For \(f:X\rightarrow \mathcal {P}(\varSigma _\tau \times Y)\) and \(g:Y\rightarrow \mathcal {P}(\varSigma _\tau \times Z)\) we have \(g\cdot f:X\rightarrow \mathcal {P}(\varSigma _\tau \times Z)\):

$$ g\cdot f (x) = \{(\sigma ,z)\mid x\mathop {\rightarrow }\limits ^{\sigma }_f y \mathop {\rightarrow }\limits ^{\tau }_g z \text { or }x\mathop {\rightarrow }\limits ^{\tau }_f y \mathop {\rightarrow }\limits ^{\sigma }_g z \text { for some }y\in Y\}. $$

The construction provided by Theorem 3 can be applied only when \(\mathcal {K}l(T)\) is a category with zero morphisms. Some monads fail to have this property. For example, if instead of considering the monad \(\mathcal {P}\) we consider the non-empty powerset monad \(\mathcal {P}_{\ne \varnothing }\). In what follows we focus on the second strategy for handling internal transitions by a monadic structure on the functor which does not require from \(\mathcal {K}l(T)\) to be a category with zero morphisms.

Monadic Structure on \({\varvec{TF}}^{\varvec{*}}{\varvec{.}}\) Here, we present an approach towards dealing with silent moves which uses free monads. At the beginning of this section we stated clearly that the coalgebras we are dealing with are of the type \(TF_\tau \). Any \(TF_\tau \)-coalgebra \(\alpha :X\rightarrow TF_\tau X\) can be turned into a \(TF^{*}\)-coalgebra \(\underline{\alpha }:X\rightarrow TF^{*}X\) by putting

$$\underline{\alpha } = T([\nu _X,e_X])\circ \alpha ,$$

where the mono-transformation \([\nu ,e]:F_\tau \implies F^{*}\) comes from the definition of a free monad.

Example 5

Consider the LTS functor \(\mathcal {P}(\varSigma _\tau \times \mathcal {I}d) \cong \mathcal {P}(\varSigma \times \mathcal {I}d + \mathcal {I}d)\) and let \(F=\varSigma \times \mathcal {I}d\). The free monad over \(F\) in \(\mathsf {Set}\) is given by \((\varSigma ^{*}\times \mathcal {I}d,m,e)\), where \(\varSigma ^{*}\) is the set of finite words over \(\varSigma \) together with the empty string \(\varepsilon \in \varSigma ^{*}\) and \(m\) and \(e\) are given for any set \(X\) as follows:

$$\begin{aligned}&m_X:\varSigma ^{*}\times \varSigma ^{*}\times X\rightarrow \varSigma ^{*}\times X; (s,s',x) \mapsto (ss',x) \text { and }\\&e_X: X\rightarrow \varSigma ^{*}\times X; x\mapsto (\varepsilon ,x). \end{aligned}$$

For any \(\alpha :X\rightarrow \mathcal {P}(\varSigma _\tau \times X)\) we define \(\underline{\alpha }:X\rightarrow \mathcal {P}(\varSigma ^{*}\times X)\) by

$$\underline{\alpha }(x) = \{(a,y) \mid (a,y)\in \alpha (x) \text { and } a\in \varSigma \}\cup \{(\varepsilon ,y) \mid (\tau ,y)\in \alpha (x)\}.$$

Example 6

The \(\varepsilon \)-NA’s are coalgebras of the type \(TF_\tau \) for the monad \(T=\mathcal {P}\) and \(F=\varSigma \times \mathcal {I}d + 1\). The functor \(F=\varSigma \times \mathcal {I}d + 1\) lifts to \(\mathcal {K}l(\mathcal {P})\) [14] and admits all free \(F\)-algebras. Let \(F^{*}\) denote the free monad over \(F\). The functor \(F^{*}:\mathsf {Set}\rightarrow \mathsf {Set}\) is defined on objects and morphisms by

$$\begin{aligned}&F^{*}X= \varSigma ^{*}\times X + \varSigma ^{*},\\&F^{*}f: \varSigma ^{*}\times X + \varSigma ^{*}\rightarrow \varSigma ^{*}\times Y + \varSigma ^{*}; F^{*}f = (id_{\varSigma ^{*}} \times f) + id_{\varSigma ^{*}} \text { for }f:X\rightarrow Y. \end{aligned}$$

The monadic structure \((F^{*},m,e)\) is given by:

$$\begin{aligned}&m_X:\varSigma ^{*}\times (\varSigma ^{*}\times X + \varSigma ^{*})+ \varSigma ^{*}\rightarrow \varSigma ^{*}\times X+ \varSigma ^{*}; \\&m_X(s_1,s_2,x)=(s_1s_2,x) \quad m_X(s_1,s_2) = s_1s_2 \quad m_X(s_1)=s_1,\\&e_X:X\rightarrow \varSigma ^{*}\times X+ \varSigma ^{*}; x\mapsto (\varepsilon ,x). \end{aligned}$$

For any \(\varepsilon \)-NA coalgebra \(\alpha :X\rightarrow \mathcal {P}(\varSigma _\varepsilon \times X+1)\) we define

$$\underline{\alpha }:X\rightarrow \mathcal {P}(\varSigma ^{*} \times X+\varSigma ^{*}); x\mapsto \{(a,y)\in \varSigma ^{*}\times X\mid (a,y)\in \alpha (x)\}\cup A_x, $$

where \(A_x= \mathbf{if }~\checkmark \in \alpha (x)~\mathbf{ then }~\{\varepsilon \}~ \mathbf{ else }~\varnothing \).

In order to proceed with the construction we need one additional lemma.

Lemma 1

[6] The algebra \(i_X^\sharp = \eta _{F^{*}X}\circ i_X:FF^{*}X+X\rightarrow TF^{*}X\) is the free \(\overline{F}\)-algebra over \(X\) in \(\mathcal {K}l(T)^{\overline{F}}\).

Let \(\overline{F}^{*}:\mathcal {K}l(T)\rightarrow \mathcal {K}l(T)\) be the functor obtained by following the guidelines of Theorem 2 using the family \(\{i^\sharp _X\}_{X\in \mathcal {K}l(T)}\) of free algebras in \(\mathcal {K}l(T)^{\overline{F}}\).

Theorem 4

[6] We have the following:

  1. 1.

    \(F^{*}:\mathsf {C}\rightarrow \mathsf {C}\) lifts to \(\overline{F}^{*}:\mathcal {K}l(T)\rightarrow \mathcal {K}l(T)\),

  2. 2.

    \((\overline{F}^{*},m^\sharp ,e^\sharp )\) is the free monad over \(\overline{F}\) in \(\mathcal {K}l(T)\).

Two adjoint situations \(\mathsf {C}\rightleftarrows \mathcal {K}l(T)\rightleftarrows \mathcal {K}l(\overline{F}^{*})\) yield a monadic structure on \(TF^{*}\).

The composition \(\cdot \) in \(\mathcal {K}l(TF^{*})=\mathcal {K}l(\overline{F}^{*})\) is given as follows. Let \(\lambda :F^{*}T\implies TF^{*}\) denote the distributive law associated with the lifting \(\overline{F}^{*}\) of \(F^{*}\). The composition of \(f:X\rightarrow TF^{*}Y\), \(g:Y\rightarrow TF^{*}Z\) in \(\mathcal {K}l(TF^{*})\) is given by:

$$\begin{aligned}&g\cdot f = \mu _{F^{*}Z} \circ T\mu _{F^{*}Z}\circ TTm_Z^\sharp \circ T \lambda _{F^{*}Z} \circ TF^{*} g \circ f=\\&\mu _{F^{*}Z} \circ T\mu _{F^{*}Z}\circ TT(\eta _Z\circ m_Z) \circ T \lambda _{F^{*}Z} \circ TF^{*} g \circ f = \\&\mu _{F^{*}Z} \circ TTm_Z \circ T \lambda _{F^{*}Z} \circ TF^{*} g \circ f. \end{aligned}$$

Example 7

The composition \(\cdot \) in \(\mathcal {K}l(\mathcal {P}(\varSigma ^{*}\times \mathcal {I}d))\) is given by the following formula. For \(f:X\rightarrow \mathcal {P}(\varSigma ^{*}\times Y)\) and \(g:Y\rightarrow \mathcal {P}(\varSigma ^{*}\times Z)\) we have \(g \cdot f:X\rightarrow \mathcal {P}(\varSigma ^{*}\times Z)\):

$$ g\cdot f (x) = \{(s_1s_2,z)\mid x \mathop {\rightarrow }\limits ^{s_1}{}_f~y \mathop {\rightarrow }\limits ^{s_2}{}_g~z \text { for some }y\in Y \text { and }s_1,s_2\in \varSigma ^{*}\}. $$

We call the monad \(\mathcal {P}(\varSigma ^{*}\times \mathcal {I}d)\) free LTS monad.

Example 8

The composition \(\cdot \) in \(\mathcal {K}l(\mathcal {P}(\varSigma ^{*}\times \mathcal {I}d + \varSigma ^{*}))\) is given by the following formula. For \(f:X\rightarrow \mathcal {P}(\varSigma ^{*}\times Y + \varSigma ^{*})\) and \(g:Y\rightarrow \mathcal {P}(\varSigma ^{*}\times Z + \varSigma ^{*})\) we have \(g \cdot f:X\rightarrow \mathcal {P}(\varSigma ^{*}\times Z + \varSigma ^{*})\):

$$\begin{aligned} g\cdot f (x) =&\{(s_1s_2,z)\mid x\mathop {\rightarrow }\limits ^{s_1}{}_f~y \mathop {\rightarrow }\limits ^{s_2}{}_g~z \text { for some }y\in Y \text { and }s_1,s_2\in \varSigma ^{*}\}\cup \\&\{s_1 s_2 \mid x\mathop {\rightarrow }\limits ^{s_1}{}_f~y \text { and } s_2 \in g(y)\cap \varSigma ^{*}, \text { for some }y\in Y\}\cup \\&\{s_1\in \varSigma ^{*} \mid s_1\in f(x) \}. \end{aligned}$$

We call \(\mathcal {P}(\varSigma ^{*}\times \mathcal {I}d + \varSigma ^{*})\) monad free \(\varepsilon \)-\(NA~monad\) or \(\varepsilon \)-\(NA~monad\) in short.

We see that if we deal with functors of the form \(T(F + \mathcal {I}d)\), where \(T\) is a monad, given some mild assumptions on \(T\) and \(F\) we may deal with the silent and observable part of computation inside a monadic structure on the functor \(TF_\tau \) itself or by embedding the functor \(TF_\tau \) into the monad \(TF^{*}\) by the natural transformation \({F_\tau }\implies {F}^{*}\). Therefore, from now on the term “coalgebras with internal moves” becomes synonymous to “coalgebras over a monadic type”. Weak bisimulation and, as we will also see, trace equivalence are defined for coalgebras over monadic types, without the need for specifying visible and silent part of the structure.

4 Weak Bisimulation

In this section we recall classical definition(s) of weak bisimulation for labelled transition systems and coalgebraic constructions from [6]. Weak bisimulation for labelled transition systems can be defined as a strong bisimulation on a saturated structure. Process of saturation can be described as taking the reflexive and transitive closure of a given structure w.r.t. the suitable composition and order. First of all we present a paragraph devoted to classical definitions of weak bisimulation for LTS. Then we show how Kleisli compositions from Examples 4 and 7 play role in the LTS saturation. These examples motivate the definition of an order saturation monad and weak bisimulation [6]. What is essentially new in this section is the following. First of all we present a definition of weak bisimulation in terms of a kernel bisimulation on the saturated structure and not via lax- and oplax-homomorphisms in Aczel-Mendler style as it was done in [6]. Second of all, the last paragraph compares the two generalizations of the strategies towards saturation from the point of view of weak bisimulation which was not done in [6].

Weak Bisimulation for LTS. Let \(\alpha :X\rightarrow \mathcal {P}(\varSigma _\tau \times X)\) be a labelled transition system coalgebra. For \(\sigma \in \varSigma _\tau \) and \(s\in \varSigma ^{*}\) define the relations \(\mathop {\implies }\limits ^{\sigma },\mathop {\rightarrow }\limits ^{s},\mathop {\implies }\limits ^{s}\subseteq X\times X\) by

$$\begin{aligned} \mathop {\implies }\limits ^{\sigma }&= \left\{ \begin{array}{cc} (\mathop {\rightarrow }\limits ^{\tau })^{*}&{} \text { if }\sigma = \tau \\ (\mathop {\rightarrow }\limits ^{\tau })^{*}\circ \mathop {\rightarrow }\limits ^{\sigma }\circ (\mathop {\rightarrow }\limits ^{\tau })^{*} &{} \text { otherwise,}\end{array}\right. \quad \mathop {\rightarrow }\limits ^{s} =\left\{ \begin{array}{cc} \mathop {\rightarrow }\limits ^{\tau }&{} \text { if }s=\varepsilon \\ \mathop {\rightarrow }\limits ^{\sigma _1}\circ \ldots \circ \mathop {\rightarrow }\limits ^{\sigma _n} &{} \text {for }s=\sigma _1\ldots \sigma _n, \end{array}\right. \\ \mathop {\implies }\limits ^{s}&=\left\{ \begin{array}{cc} (\mathop {\rightarrow }\limits ^{\tau })^{*}&{} \text { if }s \text { is the empty word} \\ (\mathop {\rightarrow }\limits ^{\tau })^{*}\circ \mathop {\rightarrow }\limits ^{\sigma _1}\circ (\mathop {\rightarrow }\limits ^{\tau })^{*}\circ \ldots \circ (\mathop {\rightarrow }\limits ^{\tau })^{*}\circ \mathop {\rightarrow }\limits ^{\sigma _n}\circ (\mathop {\rightarrow }\limits ^{\tau })^{*} &{} \text {for }s=\sigma _1\ldots \sigma _n\end{array}\right. \end{aligned}$$

where, given any relation \(R\subseteq X\times X\), the symbol \(R^{*}\) denotes the reflexive and transitive closure of \(R\). We now present four different but equivalent definitions of weak bisimulation for LTS’s. Due to limited space we do so in one definition block.

Definition 1

[25, 26, 32] A relation \(R\subseteq X\times X\) is called weak bisimulation on \(\alpha \) if the following condition holds. If \((x,y)\in R\) then

  1. (i)

    for any \(\sigma \in \varSigma _\tau \) the condition \(x\mathop {\rightarrow }\limits ^{\sigma }x' \text { implies } y\mathop {\implies }\limits ^{\sigma }y'\)

  2. (ii)

    for any \(\sigma \in \varSigma _\tau \) the condition \(x\mathop {\implies }\limits ^{\sigma }x' \text { implies } y\mathop {\implies }\limits ^{\sigma }y'\)

  3. (iii)

    for any \(s\in \varSigma ^{*}\) the condition \(x\mathop {\rightarrow }\limits ^{s}x' \text { implies } y\mathop {\implies }\limits ^{s}y'\)

  4. (iv)

    for any \(s\in \varSigma ^{*}\) the condition \(x\mathop {\implies }\limits ^{s}x' \text { implies } y\mathop {\implies }\limits ^{s}y'\)

and \(y'\in X\) such that \((x',y')\in R\) and a symmetric statement holds.

In this paper we will focus on Definitions 1.ii and 1.iv and their generalization. They both suggest that weak bisimulation can be defined as a strong bisimulation on a saturated model. It is worth noting that in our previous paper we focused on analogues of Definitions 1.i and 1.iii and comparison with Definitions 1.ii and 1.iv respectively (see [6] for details).

Saturation for LTS Coalgebraically. Let us assume that \(\cdot \) is a composition in \(\mathcal {K}l(\mathcal {P}(\varSigma _\tau \times \mathcal {I}d))\) as in Example 4. Given an LTS coalgebra \(\alpha :X\rightarrow \mathcal {P}(\varSigma _\tau \times X)\) the saturated LTS \(\alpha ^{*}:X\rightarrow \mathcal {P}(\varSigma _\tau \times X)\) is obtained as follows: \( \alpha ^{*} = 1_X \vee \alpha \vee \alpha \cdot \alpha \vee \ldots = \bigvee _{n=0,1,2\ldots } \alpha ^n\), where \(\bigvee \) denotes supremum in the complete lattice \((\mathcal {P}(\varSigma _\tau \times X)^X,\leqslant )\), where the relation \(\leqslant \) is given by \(\alpha \leqslant \beta \iff \alpha (x)\subseteq \beta (x) \text { for any }x\in X\). We see that for \((\sigma ,y)\in \varSigma _\tau \times X\): \( (\sigma ,y)\in \alpha ^{*}(x) \text { if and only if }x\mathop {\implies }\limits ^{\sigma }_\alpha y\). Weak bisimulation on \(\alpha \) according to Definition 1.ii is a strong bisimulation on \(\alpha ^{*}\).

If we now consider \(\cdot \) to be composition in \(\mathcal {K}l(\mathcal {P}(\varSigma ^{*}\times \mathcal {I}d))\) as in Example 7 for an LTS considered as a \(\mathcal {P}(\varSigma ^{*}\times \mathcal {I}d)\)-coalgebra \(\alpha :X\rightarrow \mathcal {P}(\varSigma ^{*}\times X)\) define \(\alpha ^{*}:X\rightarrow \mathcal {P}(\varSigma ^{*}\times X)\) to be \( \alpha ^{*} = 1_X \vee \alpha \vee \alpha \cdot \alpha \vee \ldots = \bigvee _{n=0,1,2\ldots } \alpha ^n\). Then \((s,y)\in \alpha ^{*}(x) \text { if and only if } x\mathop {\implies }\limits ^{s}_\alpha y\) for any \(s\in \varSigma ^{*}\). Weak bisimulation from Definition 1.iv is a strong bisimulation on \(\alpha ^{*}\).

Saturation for \({\varvec{T}}\) -coalgebras. A monad \(T\) whose Kleisli category is order-enriched is called ordered \(*\)-\(monad\) or ordered saturation monad [6] provided that in \(\mathcal {K}l(T)\) for any morphism \(\alpha : X \multimap X\) there is a morphism \(\alpha ^{*}:X\multimap X\) satisfying the following conditions:

  1. (a)

    \(1\leqslant \alpha ^{*}\),

  2. (b)

    \(\alpha \leqslant \alpha ^{*}\),

  3. (c)

    \(\alpha ^{*}\cdot \alpha ^{*}\leqslant \alpha ^{*}\),

  4. (d)

    if \(\beta :X\multimap X\) satisfies \(1\leqslant \beta \), \(\alpha \leqslant \beta \) and \(\beta \cdot \beta \leqslant \beta \) then \(\alpha ^{*}\leqslant \beta \),

  5. (e)

    for any \(f:X\rightarrow Y\) in \(\mathsf {C}\) and any \(\beta :Y\multimap Y\) in \(\mathcal {K}l(T)\) we have:

    $$ f^{\sharp }\cdot \alpha \mathrel {\Box } \beta \cdot f^{\sharp } \implies f^{\sharp }\cdot \alpha ^{*} \mathrel {\Box } \beta ^{*} \cdot f^{\sharp } \text { for } \mathrel {\Box } \in \{\leqslant ,\geqslant \}. $$

For the rest of the section we assume that \(T\) is an order saturation monad with the saturator operator \((-)^{*}\).

Remark 1

We could try and define \(\alpha ^{*}\) as the least fix point \(\mu x.(1 \vee x\cdot \alpha )\). Indeed, if \(T\) is e.g. complete join-semilatice enriched monad then the saturated structure is defined this way. We believe that our definition is slightly more general as it does not require for the mapping \(x\mapsto 1 \vee x\cdot \alpha \) to be well defined. Intuitively however, \(\alpha ^{*}\) should and will be associated with \(\mu x.(1 \vee x\cdot \alpha )\).

Example 9

The powerset monad \(\mathcal {P}\) and the non-empty powerset monad \(\mathcal {P}_{\ne \varnothing }\) are examples of order saturation monads [6]. The monads from Examples 4 and 7 are order saturation monads [6]. Also the \(\mathcal {CM}\) monad of convex distributions described in [17] is an order saturation monad [6]. Although we will not focus on \(\mathcal {CM}\) in this paper it is a very important monad that is used to model Segala systems, their trace semantics and probabilistic weak bisimulations [6, 17, 33, 34]. Any Kleene monad [9] is also an order saturation monad [6].

Since \(\mathcal {P}\), \(\mathcal {P}(\varSigma _\tau \times \mathcal {I}d)\) and \(\mathcal {P}(\varSigma ^{*}\times \mathcal {I}d)\) are order saturation monads, the following question arises: is the saturation operator for LTS monads related to saturation in \(\mathcal {K}l(\mathcal {P})\)? The following theorem answers that question in general and shows the relation between a saturation operator in \(\mathcal {K}l(T)\) and \(\mathcal {K}l(TS)\) for a monad \(\overline{S}\) on \(\mathcal {K}l(T)\).

Theorem 5

[6] Assume \(S:\mathsf {C}\rightarrow \mathsf {C}\) lifts to \(\overline{S}:\mathcal {K}l(T)\rightarrow \mathcal {K}l(T)\) and \((\overline{S},m,e)\) is a monad on \(\mathcal {K}l(T)\). If \(\overline{S}\) is locally monotonic and satisfies the equation

$$m_X\cdot \overline{S}[(m_X\cdot \overline{S}\alpha )^{*}\cdot e_X] = (m_X\cdot \overline{S}\alpha )^{*}$$

for any \(\alpha :X\multimap \overline{S}X\), then the monad \(TS\) is an order saturation monad with the saturation operator \((-)^{\bigstar }\) given by \(\alpha ^{\bigstar } = (m_X\cdot \overline{S}\alpha )^{*}\cdot e_X\).

If \(T=\mathcal {P}\) and \(S\) is taken either to be \(\varSigma _\tau \times \mathcal {I}d\) or \(\varSigma ^{*}\times \mathcal {I}d\), then the lifting \(\overline{S}\) exists and is equipped with a monadic structure as in Sect. 3. Moreover, \(\overline{S}\) satisfies the assumptions of Theorem 5 [6]. In other words, the LTS saturations for \(\mathcal {P}(\varSigma _\tau \times \mathcal {I}d)\) and \(\mathcal {P}(\varSigma ^{*}\times \mathcal {I}d)\) are obtained respectively by

$$ (m_X'\cdot \overline{\varSigma _\tau }\alpha )^{*}\cdot e_X' \text { and } (m_X^\sharp \cdot \overline{\varSigma }^{*}\alpha )^{*}\cdot e_X^\sharp . $$

In sections to come we will deal with generalizations of these two saturations and check under which conditions they yield the same notion of weak bisimulation.

Weak Bisimulation for \({\varvec{T}}\)-coalgebras. The following slogan should be in our opinion considered the starting point to the theory of weak bisimulation for \(T\)-coalgebras: weak bisimulation on \(\alpha :X\rightarrow TX\) = bisimulation on \(\alpha ^{*}:X\rightarrow TX\).

Definition 2

Let \(\alpha :X\rightarrow TX\) be a \(T\)-coalgebra. A relation \(X\mathop {\leftarrow }\limits ^{\pi _1} R \mathop {\rightarrow }\limits ^{\pi _2} X\) is weak bisimulation on \(\alpha \) if it is a bisimulation on \(\alpha ^{*}\).

We see that the above definition coincides with the standard definition of weak bisimulation for LTS considered as \(\mathcal {P}(\varSigma _\tau \times \mathcal {I}d)\)- and \(\mathcal {P}(\varSigma ^{*}\times \mathcal {I}d)\)-coalgebras.

Weak Bisimulation for \({\varvec{TF}}_{\varvec{\tau }}\)-and \({\varvec{TF}}^{\varvec{*}}\)-coalgebras. This subsection will be devoted to comparing both approaches towards defining weak bisimulation for \(TF_\tau \)-coalgebras that generalize Definitions 1 and 1.iv for LTS. Here, we additionally assume that \(\mathcal {K}l(T)\) is a category with zero morphisms. Then we may either define a monadic structure on \(TF_\tau \) or embed the functor into the monad \(TF^{*}\). These two approaches applied for LTS give two different saturations, yet the weak bisimulations coincide. It is natural to suspect that given some mild assumptions it will also be the case in a more general setting. We will now list all the necessary ingredients.

We assume \((\overline{F_\tau },m',e')\) and \((\overline{F}^{*},m^\sharp ,e^\sharp )\) are monads as in Sect. 3 and that both satisfy the assumptions of Theorem 5 for the monad \(\overline{S}\). For sake of simplicity and clarity of notation we will drop \(^\sharp \) and write \((\overline{F}^{*},m,e)\) instead of \((\overline{F}^{*},m^\sharp ,e^\sharp )\). The consequences of these assumptions are the following:

  • A natural transformation \(\nu :\overline{F}\implies \overline{F}^{*}\) which arises by the definition of a free monad.

  • A natural transformation \(\iota ^1:\overline{F}\implies \overline{F_\tau } = \overline{F + \mathcal {I}d}=\overline{F} + \mathcal {I}d\). This transformation is given regardless of the assumptions.

  • Unique monad morphism \(h:(\overline{F}^{*},m,e)\multimap (\overline{F_\tau },m',e')\) in \(\mathcal {K}l(T)\) making the first three diagrams commute:

    Commutativity of the first two diagrams implies commutativity of the forth. Existence and uniqueness of \(h\) follows by the fact that \(\overline{F}^{*}\) is a free monad over \(\overline{F}\) and \(\iota ^1:\overline{F}\implies \overline{F_\tau }\) is a natural transformation.

  • The monads \(TF_\tau \) and \(TF^{*}\) are order saturation monads. The saturation operators \((-)^\bigstar \) and \((-)^\divideontimes \) for \(TF_\tau \)- and \(TF^{*}\)-coalgebras resp. are given as follows. Let \(\alpha :X\multimap \overline{F_\tau }X\) (i.e. \(\alpha :X\rightarrow TF_\tau X\)) and \(\beta :Y\multimap \overline{F}^{*}Y\) (i.e. \(\beta :Y\rightarrow TF^{*}Y\)). We have:

    $$\begin{aligned} \alpha ^\bigstar = (m_X'\cdot \overline{F_\tau }\alpha )^{*}\cdot e_X' \qquad \text { and }\qquad \beta ^\divideontimes = (m_Y\cdot \overline{F}^{*}\beta )^{*}\cdot e_Y. \end{aligned}$$

Example 10

Let \(T=\mathcal {P}\) and \(F_\tau = \varSigma _\tau \times \mathcal {I}d\), \(F^{*} =\varSigma ^{*}\times \mathcal {I}d\). The morphism \(h_X:\overline{\varSigma ^{*}}X\multimap \overline{\varSigma _\tau }X\) is given by:

$$ h_X:\varSigma ^{*}\times X \rightarrow \mathcal {P}(\varSigma _\tau \times X); (s,x)\mapsto \left\{ \begin{array}{cc}\{(\tau ,x)\} &{} \text {if }~|s|=0, \\ \{(s,x)\} &{} \text {if }~|s|=1,\\ \varnothing &{} \text {otherwise.} \end{array}\right. $$

Consider any coalgebra \(\alpha :X\multimap \overline{F_\tau }X\) and let \(\underline{\alpha }:X\multimap \overline{F}^{*}X\) be given by \(\underline{\alpha } = [\nu _X,e_X] \cdot \alpha \). Note that this is the same coalgebra as in the paragraph on monadic structure on \(TF^{*}\) in Sect. 3. Here, however, it is defined in terms of the composition in \(\mathcal {K}l(T)\) and not \(\mathsf {C}\), and all superscripts \(^\sharp \) are dropped to simplify the notation. By commutativity of the last diagram above we have:

$$h_X\cdot \underline{\alpha } = h_X\cdot [\nu _X,e_X] \cdot \alpha = \alpha .$$

We will now try to compare bisimulations for \(\alpha ^{\bigstar }\) and \(\underline{\alpha }^\divideontimes \). In case of labelled transition systems a relation is a bisimulation on \(\alpha ^{\bigstar }\) if and only if it is a bisimulation on \(\underline{\alpha }^\divideontimes \). Below we verify how general is this statement and what conditions are required to be satisfied for it to remain true.

Lemma 2

Assume that for any \(\phi :\overline{F}^{*}X\multimap \overline{F}^{*}X\) and \(\psi :\overline{F_\tau }X\multimap \overline{F_\tau }X\) if \(\psi \cdot h_{X} = h_{X}\cdot \phi \) then \(\psi ^{*} \cdot h_{X} = h_{X}\cdot \phi ^{*}\). In this case we have \(h_X\cdot \underline{\alpha }^\divideontimes = \alpha ^{\bigstar }\).

Remark 2

Note that the assumption in Lemma 2 about the natural transformation \(h\) is crucial even though \(T\) is assumed to be an order saturation monad. Assumption (e) in the definition of order saturatiom monad does not guarantee that \(h\) satisfies the desired property since it is not in general of the form \(h'^{\sharp }\) for some \(h':F^{*}X\rightarrow F_\tau X\) in \(\mathsf {C}\). However, if \(T\) is a Kleene monad [6, 9] then this assumption is always satisfied. The powerset monad \(\mathcal {P}\) is an example of a Kleene monad.

The following theorem follows directly from the above lemma.

Theorem 6

Assume that for any \(\phi :\overline{F}^{*}X\multimap \overline{F}^{*}X\) and \(\psi :\overline{F_\tau }X\multimap \overline{F_\tau }X\) if \(\psi \cdot h_{X} = h_{X}\cdot \phi \) then \(\psi ^{*} \cdot h_{X} = h_{X}\cdot \phi ^{*}\). Any bisimulation on \(\underline{\alpha }^\divideontimes \) is a bisimulation on \(\alpha ^{\bigstar }\).

Our aim now will be to prove the converse.

Lemma 3

We have \( \underline{\alpha }^\divideontimes \leqslant (\underline{\alpha ^\bigstar })^{\divideontimes }\).

Remark 3

Before we state the next result we have to make one essential remark. Note that the technical condition concerning the transformation \([\nu ,e]\) in the lemma below would follow from \([\nu ,e]\) being a monad morphism. However, \([\nu ,e]:\overline{F_\tau }\implies \overline{F}^{*}\) is not a monad morphism. It does not satisfy the 2nd axiom of a monad morphism. To see this consider \(T=\mathcal {P}\), \((\overline{\varSigma _\tau },m',e')\), \((\overline{\varSigma }^{*},m,e)\) as in Examples 4 and 7 and a visible label \(a\in \varSigma \). We have

$$\begin{aligned}&[\nu _X,e_X]\cdot m'_X(a,a,x) = \varnothing \text { and } \\&m_X\cdot [\nu _{\overline{\varSigma ^{*}}X},e_{\overline{\varSigma ^{*}}X}]\cdot \overline{\varSigma _\tau } [\nu _X,e_X] (a,a,x) =\{(aa,x)\}. \end{aligned}$$

Lemma 4

Assume \([\nu _X,e_X]\cdot m_X'\cdot \overline{F_\tau } \alpha \leqslant m_X\cdot \overline{F}^{*} \underline{\alpha } \cdot [\nu _X,e_X]\). Then \(\underline{\alpha ^\bigstar } \leqslant \underline{\alpha }^\divideontimes \).

Theorem 7

Let \(\alpha \) satisfy the inequality from the assumptions of the previous statement. Any bisimulation on \({\alpha ^\bigstar }\) is a bisimulation on \(\underline{\alpha }^\divideontimes \).

Proof

We have \(\alpha \leqslant \alpha ^\bigstar \) and hence \(\underline{\alpha }\leqslant \underline{\alpha ^\bigstar }\). This, together with Lemma 4, implies that \(\underline{\alpha }^{\divideontimes } \leqslant (\underline{\alpha ^\bigstar })^\divideontimes \leqslant (\underline{\alpha }^\divideontimes )^\divideontimes \mathop {=}\limits ^{\diamond }\underline{\alpha }^\divideontimes \) (see [6] for a proof of the equality marked with (\(\diamond \))). Assume \(X\mathop {\leftarrow }\limits ^{\pi _1} R\mathop {\rightarrow }\limits ^{\pi _2} X\) is a bisimulation on \(\alpha ^\bigstar \). It is also a bisimulation on \(\underline{\alpha ^\bigstar }\). Finally, since \(\underline{\alpha }^\divideontimes = (\underline{\alpha ^\bigstar })^\divideontimes \) the relation \(R\) is a bisimulation on \(\underline{\alpha }^\divideontimes \).

Theorem 8

Assume that cotupling \([-,-]\) in \(\mathcal {K}l(T)\) is monotonic w.r.t. both arguments and the zero morphisms \(0_{X,Y}:X\multimap Y\) are the least elements of the posets \(Hom_{\mathcal {K}l(T)}(X,Y)\). Then any bisimulation on \({\alpha }^\bigstar \) is a bisimulation on \(\underline{\alpha }^\divideontimes \).

Remark 4

The powerset monad \(\mathcal {P}\) satisfies assumptions of the above theorem. It is worth mentioning that the \(\mathcal {CM}\) monad used to model Segala systems does not satisfy them as the zero morphisms in \(\mathcal {K}l(\mathcal {CM})\) are not least elements of the partially ordered hom-sets [17]. The monad \(\mathcal {CM}\) deserves a separate treatment and we leave this for future research.

5 Trace Semantics for Coalgebras with Internal Moves

The aim of this section is to present some ideas on how to approach the notion of trace semantics for structures with invisible moves. As mentioned before in order to distinguish the trace semantics for coalgebras with and without silent steps we will often use the term weak trace semantics or trace semantics for structures with internal moves to refer to the former.

Before we go into details we start this section by recalling a basic example of trace semantics for \(\varepsilon \)-NA’s [15].

Definition 3

Given a non-deterministic automaton with \(\varepsilon \)-transitions \(\alpha :X\rightarrow \mathcal {P}(\varSigma _\varepsilon \times X + 1)\) its trace semantics is a morphism \(\text {tr}_\alpha :X\rightarrow \mathcal {P}(\varSigma ^{*})\) which maps any state \(x\in X\) to the set of words over \(\varSigma \) it accepts. To be more precise, for a word \(w\in \varSigma ^{*}\) we have \(w\in \text {tr}_\alpha (x)\) provided that either \(w=\varepsilon \) and \(\checkmark \in \alpha (x)\) or \(w=a_1\ldots a_n\) for \(a_i\in \varSigma \) and there is \(x'\in X\) such that

$$x(\mathop {\rightarrow }\limits ^{\varepsilon })^{*}\circ \mathop {\rightarrow }\limits ^{a_1}\circ (\mathop {\rightarrow }\limits ^{\varepsilon })^{*}\ldots (\mathop {\rightarrow }\limits ^{\varepsilon })^{*}\circ \mathop {\rightarrow }\limits ^{a_n}\circ (\mathop {\rightarrow }\limits ^{\varepsilon })^{*}x'$$

with \(\checkmark \in \alpha (x')\).

The above definition is an instance of what we call a “bottom-up” approach towards trace semantics for non-deterministic automata with internal moves. This approach considers \(\varepsilon \) steps as invisible steps that can wander around a structure freely. In other words, from our perspective \(\varepsilon \)-steps that are used in this definition are what they should be, i.e. are part of the unit of the \(\varepsilon \)-NA monad. There is a second obvious approach towards defining trace semantics for \(\varepsilon \)-NA’s. We call this approach “top-down”, since at first we treat \(\varepsilon \) steps artificially as if they were standard visible steps. Given an \(\varepsilon \)-NA \(\alpha :X\rightarrow \mathcal {P}(\varSigma _\varepsilon \times X + 1)\) we find its trace \(\text {tr}'_\alpha :X\rightarrow \mathcal {P}((\varSigma \cup \{\varepsilon \})^{*})\) and then map all words from \((\varSigma \cup \{\varepsilon \})^{*}\) to words in \(\varSigma ^{*}\) by removing all occurrences of the \(\varepsilon \) label. As a result we obtain the same trace as in Definition 3. Since in many cases we know how to find finite trace semantics for coalgebras with only visible steps [14] it is easy to generalize the “top-down” approach to coalgebras with internal activities. This is exactly how authors of [13, 35] do it in their papers. We, however, will present a bottom-up approach towards weak trace semantics that works for a large family of coalgebras whose type is a monad.

Coalgebraic View on Weak Trace Semantics for \({\varvec{\varepsilon }}\)-NA. In this subsection we focus on coalgebras for the monad \(\mathcal {P}(\varSigma ^{*}\times X + \varSigma ^{*})\). Recall that by Example 6 any \(\varepsilon \)-NA coalgebra \(\alpha :X\rightarrow \mathcal {P}(\varSigma _\varepsilon \times X + 1)\) can be considered a \(\mathcal {P}(\varSigma ^{*}\times X + \varSigma ^{*})\)-coalgebra. For simplicity and clarity of notation put \(F=\varSigma \times \mathcal {I}d + 1\) and \(F^{*} = \varSigma ^{*}\times \mathcal {I}d + \varSigma ^{*}\). Let us list two basic facts concerning \(\varepsilon \)-NA monad:

  • The lifting \(\overline{F}^{*}:\mathcal {K}l(\mathcal {P})\rightarrow \mathcal {K}l(\mathcal {P})\) is locally continuous [14].

  • The \(\varepsilon \)-NA monad \(\mathcal {P}F^{*}\) is \(\mathbf{Cppo }\)-enriched. This follows by Theorem 1.

For any \(\alpha :X\multimap X\) in \(\mathcal {K}l(\mathcal {P}F^{*})\) (i.e. \(\alpha :X\rightarrow \mathcal {P}F^{*}X\)) define the following mapping \(\text {tr}_\alpha :X\multimap \varnothing \) (i.e. \(\text {tr}_\alpha :X\rightarrow \mathcal {P}(\varSigma ^{*})\)):

$$\text {tr}_\alpha = \bigvee _{n\in \mathbb {N}} \perp \cdot \alpha ^n,$$

where \(\perp :X\multimap \varnothing \) is given by \(\perp :X\rightarrow \mathcal {P}(\varSigma ^{*});x\mapsto \varnothing \) and \(\cdot \) denotes the composition in \(\mathcal {K}l(\mathcal {P}F^{*})\) as in Example 8. It is simple to see that \(\text {tr}_\alpha \) is the least morphism in \(Hom_{\mathcal {K}l(\mathcal {P}F^{*})}(X,\varnothing )=Hom_{\mathsf {Set}}(X,\mathcal {P}(\varSigma ^{*}))\) satisfying \(\text {tr}_\alpha = \text {tr}_\alpha \cdot \alpha \). In other words,

$$\text {tr}_\alpha = \mu x. x\cdot \alpha .$$

Recursively, if we put \(\text {tr}_0 = \perp \) and \(\text {tr}_n = \text {tr}_{n-1} \cdot \alpha \) then \(\text {tr}_\alpha = \bigvee _n \text {tr}_n\).

Example 11

Let \(\varSigma = \{a,b\}\) and let \(\alpha :X\rightarrow \mathcal {P}(\varSigma _\varepsilon \times X + 1)\) be given by the following diagram (\(\varepsilon \)-labels are omitted). We have \(\text {tr}_0:X\rightarrow \mathcal {P}(\varSigma ^{*}),x\mapsto \varnothing \) and

figure c

The following result can be shown by straightforward verification.

Theorem 9

For any \(\varepsilon \)-NA coalgebra considered as \(\mathcal {P}(\varSigma ^{*}\times \mathcal {I}d + \varSigma ^{*})\)-coalgebra the trace semantics morphism from Definition 3 and the morphism \(\text {tr}_\alpha \) above coincide.

Weak Coalgebraic Trace Semantics via Fixed Point Operator. We see that for \(\varepsilon \)-NA’s their weak trace semantics is obtained as the least fixed point of the assignment \(x\mapsto x\cdot \alpha \) in \(\mathcal {K}l(\mathcal {P}(\varSigma ^{*}\times \mathcal {I}d+\varSigma ^{*}))\). Interestingly, such a fixed point is not unique.

Example 12

Let \(\varSigma =\{a\}, X=\{x\}\) and let \(\varepsilon \)-NA \(\alpha :X\rightarrow \mathcal {P}(\varSigma _\varepsilon \times X+1)\) be defined by the following diagram: . It is easy to check that the morphism \(g:X\rightarrow \mathcal {P}(\varSigma ^{*});x\mapsto \{a\}\) satisfies \(g = g\cdot \alpha \) and it is not the least fixed point since the least fixed point is given by \(\text {tr}_\alpha (x) = \varnothing \).

Here we generalize the ideas presented in the previous subsection to \(T\)-coalgebras. It should be noted at the very beginning that this section should serve as merely a starting point for future research.

Let us first focus on a known approach for defining trace semantics via coinduction in Kleisli category [14] and translating these results to our setting. In [14] the authors present trace semantics definition via coinduction for \(TF\)-coalgebras, where \(T\) is a monad and \(F\) satisfies some reasonable assumptions. In our setting however, we do not consider a special functor \(F\) or in other words \(F=\mathcal {I}d\) and our coalgebras are \(T\)-coalgebras. Consider the category \(\mathcal {K}l(T)_{\mathcal {I}d}\) of \(\mathcal {I}d\)-coalgebras in \(\mathcal {K}l(T)\). Note that any \(T\)-coalgebra \(\alpha :X\rightarrow TX\) is \(\alpha :X\multimap X\) and is a member of \(\mathcal {K}l(T)_{\mathcal {I}d}\). Based on the approach from [14] trace semantics of \(\alpha \) should be obtained via coinduction in \(\mathcal {K}l(T)_{\overline{F}}\). In our setting however, i.e. when \(F=\mathcal {I}d\), the category \(\mathcal {K}l(T)_{\mathcal {I}d}\) rarely admits the terminal object. For instance if we consider our \(\varepsilon \)-NA monad \(\mathcal {P}(\varSigma ^{*}\times \mathcal {I}d + \varSigma ^{*})\), the category of \(\mathcal {I}d\)-coalgebras \(\mathcal {K}l(\mathcal {P}(\varSigma ^{*}\times \mathcal {I}d + \varSigma ^{*}))_{\mathcal {I}d}\) has no terminal object. However, it still makes sense to talk about trace for coalgebras for the monad \(\mathcal {P}(\varSigma ^{*}\times \mathcal {I}d + \varSigma ^{*})\). We did it via the least fixed point of the assignment \(x\mapsto x\cdot \alpha \). In the general case we do it via uniform fixed point operator [37].

Assume that \(\mathsf {C}\) is a category with the initial object \(0\) (this object is also initial in \(\mathcal {K}l(T)\)). A fixed point operator \(\text {f}\) on \(\mathcal {K}l(T)\) is a family of morphisms:

$$ \text {f}:Hom_{\mathcal {K}l(T)}(X,X)\rightarrow Hom_{\mathcal {K}l(T)}(X,0) $$

satisfying \(\text {f}(\alpha ) \cdot \alpha = \text {f}(\alpha )\) for any \(\alpha :X\multimap X\). A fixed point operator \(\text {f}\) on \(\mathcal {K}l(T)\) is uniform w.r.t. \((-)^\sharp :\mathsf {C}\rightarrow \mathcal {K}l(T)\) [37] if

$$h^\sharp \cdot \alpha = \beta \cdot h^\sharp \implies \text {f}(\beta ) \cdot h^\sharp = \text {f}(\alpha )$$

for any \(\alpha :X\multimap X\), \(\beta :Y\multimap Y\) in \(\mathcal {K}l(T)\) and \(h:X\rightarrow Y\) in \(\mathsf {C}\). Coalgebraically speaking, the premise of the above implication says that the morphism \(h\) is a homomorphism between coalgebras \(\alpha :X\rightarrow TX\) and \(\beta :Y\rightarrow TY\) in \(\mathsf {C}_T\). We call a uniform fixed point operator on \(\mathcal {K}l(T)\) a coalgebraic trace operator and we denote it by \(\text {tr}_{(-)}\).

Theorem 10

Assume that \(\mathcal {K}l(T)\) is a \(\mathbf{Cppo }\)-enriched category and assume that for any \(f:X\rightarrow Y\) in \(\mathsf {C}\) we have \(\perp \cdot f^\sharp = \perp \). For \(\alpha :X\multimap X\) define \(\text {tr}_\alpha :X\multimap 0\) by \(\text {tr}_\alpha = \mu x.(x\cdot \alpha ) = \bigvee _{n\in \mathbb {N}}\perp \cdot \alpha ^n\). Then \(\text {tr}_{(-)}\) is a coalgebraic trace operator on \(\mathcal {K}l(T)\).

It may not be instantly clear for the reader why we choose uniformity as a property of a coalgebraic trace operator. Uniformity is a powerful notion which, in some forms, determines the least fixed point to be the unique uniform fixed point operator [37]. For the \(\varepsilon \)-NA monad \(\mathcal {P}(\varSigma ^{*}\times \mathcal {I}d+\varSigma ^{*})\) the least fixed point operator is a uniform fixed point operator w.r.t.

$$^\sharp :\mathsf {Set}\rightarrow \mathcal {K}l(\mathcal {P}(\varSigma ^{*}\times \mathcal {I}d+\varSigma ^{*})).$$

However, as we will see further on (Theorem 11 and Example 13), it is uniform also with respect to a richer category than \(\mathsf {Set}\), namely, it is uniform w.r.t.:

$$^\sharp :\mathcal {K}l(\mathcal {P}(\varSigma ^{*}\times \mathcal {I}d))\rightarrow \mathcal {K}l(\mathcal {M}_1)\cong \mathcal {K}l(\mathcal {P}(\varSigma ^{*}\times \mathcal {I}d+\varSigma ^{*})).$$

Uniqueness of a uniform fixed point operator on \(\mathcal {K}l(T)\) can be imposed by inital algebra = final coalgebra coincidence in the base category \(\mathsf {C}\) [37]. This coincidence is the core of generic coalgebraic trace semantics theory [14]. This is why we believe that the uniform fixed point operators can and will serve as an extension of the generic coalgebraic trace semantics to weak trace semantics.

We end this section with a result that links weak trace semantics for \(\varepsilon \)-NA’s to uniform traced monoidal categories in the sense of Joyal et al. [16]. However, instead of a uniform categorical trace operator on a monoidal category with binary coproducts and initial object we will equivalently work with a uniform Conway operator [12, 16]. The following theorem (modulo the uniformity) can be found in [4].

Theorem 11

Assume \(\mathsf {C}\) is equipped with a uniform Conway operator

$$(-)_{X,A}^{\dagger }:Hom(X,X + A)\rightarrow Hom(X,A).$$

Let \(A\) be an object in \(\mathsf {C}\) and \(\mathcal {M}_A = \mathcal {I}d + A\) the exception monad on \(\mathsf {C}\). Then the operator \(\text {tr}_{(-)}:Hom_{\mathcal {K}l(\mathcal {M}_A)}(X,X)\rightarrow Hom_{\mathcal {K}l(\mathcal {M}_A)}(X,0)\) defined by \(\text {tr}_\alpha = \alpha ^\dagger \) for \(\alpha :X\rightarrow X + A\) in \(\mathsf {C}\) (or equivalently \(\alpha :X\multimap X\) in \(\mathcal {K}l(\mathcal {M}_A)\)) is a coalgebraic trace operator on the category \(\mathcal {K}l(\mathcal {M}_A)\) which is uniform w.r.t. \(^\sharp :\mathsf {C}\rightarrow \mathcal {K}l(\mathcal {M}_A)\).

Example 13

The \(\varepsilon \)-NA’s and their trace semantics fits into the above setting since the \(\varepsilon \)-NA monad satisfies:

$$\mathcal {P}(\varSigma ^{*}\times \mathcal {I}d + \varSigma ^{*}) \cong \mathcal {P}(\varSigma ^{*}\times (\mathcal {I}d + 1)).$$

Hence, if we put \(T=\mathcal {P}(\varSigma ^{*}\times \mathcal {I}d)\) to be the free LTS monad then the \(\varepsilon \)-NA monad is given by \(T(\mathcal {I}d + 1)=T\mathcal {M}_1\). Since the free LTS monad \(\mathcal {P}(\varSigma ^{*}\times \mathcal {I}d) \cong \mathcal {P}(\varSigma ^{*})^{\mathcal {I}d}\) is an example of a quantale monad [18] on \(\mathsf {Set}\) its Kleisli category \(\mathcal {K}l( \mathcal {P}(\varSigma ^{*}\times \mathcal {I}d) )\) with binary coproducts and initial object is equipped with a uniform Conway operator (or equivalently a uniform categorical trace operator) [12, 18]. Therefore, if we put \(\mathsf {C}=\mathcal {K}l(\mathcal {P}(\varSigma ^{*}\times \mathcal {I}d))\) then the Kleisli category for the exception monad \(\mathcal {M}_1 = \mathcal {I}d + 1\) defined on \(\mathsf {C}\) is isomorphic to the Kleisli category for \(\varepsilon \)-NA monad, i.e. \(\mathcal {K}l(\mathcal {M}_1) \cong \mathcal {K}l(\mathcal {P}(\varSigma ^{*}\times \mathcal {I}d + \varSigma ^{*}))\). The analysis of the Conway operator for the Kleisli category for the monad \(\mathcal {P}(\varSigma ^{*}\times \mathcal {I}d)\) [18] leads to a conclusion that \(\text {tr}_\alpha \) obtained for \(\varepsilon \)-NA’s via Theorem 11 is exactly the least fixed point operator we introduced in the previous subsection.

To conclude, when allowing invisible steps into our setting, i.e. considering coalgebras over monadic types, weak trace semantics becomes a categorical fixed point operator. Moreover, as the above example states, there is a strong connection between coalgebraic trace operator for \(\varepsilon \)-NA coalgebras and traced monoidal categories. Although traced categories have been studied from coalgebraic perspective in [18] they were considered a special instance of the generic coalgebraic trace theory. With Example 13 at hand we believe that it should be the other way around in many cases, i.e. coalgebraic trace semantics for coalgebras with internal moves is a direct consequence of the fact that certain Kleisli categories are traced monoidal categories.

6 Weak Bisimulation and Weak Trace Semantics

We have shown that two behavioural relations, namely, weak bisimulation and weak trace equivalence can be defined using fixed points of certain maps. In case of trace equivalence this map is given by \(x\mapsto x\cdot \alpha \), in case of weak bisimulation it is \(x\mapsto 1\vee x\cdot \alpha \). We see that both equivalences should be considered individually, as they require different assumptions. Yet, in a restrictive enough setting we should be able to compare these notions at once. Indeed, in the setting of monads whose Kleisli category has hom-sets being complete join semilattices and whose composition preserves all non-empty joins, it is possible for us to talk about three behavioural equivalences at once, namely, weak trace semantics, weak bisimilarity and bisimilarity. In this case we can prove the following.

Theorem 12

Let \(T\) be a monad as above and let \(\perp = \perp \cdot f^\sharp \text { for any } f:X\rightarrow Y\) in \(\mathsf {C}\). A strong bisimulation on \(\alpha :X\rightarrow TX\) is also a weak bisimulation on \(\alpha \). Moreover, if we define the trace map to be \(\text {tr}_\alpha = \mu x. x\cdot \alpha \) then \(\text {tr}_\alpha = \text {tr}_{\alpha ^{*}}\). In other words, weak bisimilarity implies weak trace equivalence.

7 Summary and Future Work

This paper shows that coalgebras with internal moves can be understood as coalgebras over a type which is a monad. We believe that such a treatment makes formulation of many different properties and behavioural equivalences simpler. It is natural to suspect that many other types of different behavioural equivalences can be translated into the coalgebraic setting this way. One of these is dynamic bisimulation [27] which should be obtained as a strong bisimulation on \(\mu x. (\alpha \vee x\cdot \alpha )\) (i.e. a transitive closure of \(\alpha \)). We believe that this paper may serve as a starting point for a larger project to translate some of the equivalences from van Glabbeek’s spectrum of different equivalences for state-based systems with silent labels [8, 32] into the setting of coalgebras with internal activities.

Finally, as mentioned in Sect. 5 we should aim at extending the coalgebraic trace semantics theory for systems without internal transitions [14] to systems with silent moves. Uniform fixed point operator could serve as such an extension. Moreover, we should build a more traced monoidal category oriented theory of coalgebraic traces and refer it to known results for generic coalgebraic trace.