Categorical Buechi and Parity Conditions via Alternating Fixed Points of Functors

Categorical studies of recursive data structures and their associated reasoning principles have mostly focused on two extremes: initial algebras and induction, and final coalgebras and coinduction. In this paper we study their in-betweens. We formalize notions of alternating fixed points of functors using constructions that are similar to that of free monads. We find their use in categorical modeling of accepting run trees under the Buechi and parity acceptance condition. This modeling abstracts away from states of an automaton; it can thus be thought of as the"behaviors"of systems with the Buechi or parity conditions, in a way that follows the tradition of coalgebraic modeling of system behaviors.


Introduction
Büchi Automata The Büchi condition is a common acceptance condition for automata for infinite words.Let x i ∈ X be a state of an automaton A and a i ∈ A be a character, for each i ∈ ω.An infinite run x 0 a0 − → x 1 a1 − → • • • satisfies the Büchi condition if x i is an accepting state (usually denoted by 10)( $%&' È É ) for infinitely many i.An example of a Büchi automaton is shown on the right.The word (ba) ω is accepted, while ba ω is not.A function that assigns each x ∈ X the set of accepted words from x is called the trace semantics of the Büchi automaton.
The main goal of this paper is to give a categorical characterization of such runs under the Büchi condition.This is in the line of the established field of categorical studies of finite and infinite datatypes: it is well-known that finite trees form an initial algebra, and infinite trees form a final coalgebra; and finite/infinite words constitute a special case.These categorical characterizations offer powerful reasoning principles of (co)induction for both definition and proof.While the principles are categorically simple ones corresponding to universality of initial/final objects, they have proved powerful and useful in many different branches of computer science, such as functional programming and process theory.See the diagram on the right above illustrating coinduction: given a functor F , its final coalgebra ζ : Z ∼ = → F Z has a unique homomorphism to it from an arbitrary F -coalgebra d : Y → F Y .
In many examples, a final coalgebra is described as a set of "infinite F -trees." Extension of such (co)algebraic characterizations of data structures to the Büchi condition is not straightforward, however.A major reason is the non-local character of the Büchi condition: its satisfaction cannot be reduced to a local, one-step property of the run.For example, one possible attempt of capturing the Büchi condition is as a suitable subobject of the set Run(X) = (A × X) ω of all runs (including nonaccepting ones).The latter set admits clean categorical characterization as a final coalgebra Run(X) ∼ = → F Run(X) for the functor F = (A × X) × .Specifying its subset according to the Büchi condition seems hard if we insist on the coalgebraic language which is centered around the local notion of transition represented by a coalgebra structure morphism c : X → F X.
There have been some research efforts in this direction, namely the categorical characterization of the Büchi condition.In [6] the authors insisted on finality and characterize languages of Muller automata (a generalization of Büchi automata) by a final coalgebra in Sets 2 .Their characterization however relies on the lasso characterization of the Büchi condition that works only in the setting of finite state spaces.In [22] we presented an alternative characterization that covers infinite state spaces and automata with probabilistic branching.The key idea was the departure from coinduction, that is, reasoning that relies on the universal property of greatest fixed points.Note that a final coalgebra ζ : Z ∼ = → F Z is a "categorical greatest fixed point" for a functor F .
Our framework in [22] was built on top of the so-called Kleisli approach to trace semantics of coalgebras [17,13,11,12].There a system is a coalgebra in a Kleisli category Kℓ(T ), where T represents the kind of branching the system exhibits (nondeterminism, probability, etc.).A crucial fact in this approach is that homsets of the category Kℓ(T ) come with a natural order structure.Specifically, in [22], we characterized trace semantics under the Büchi condition as in the diagrams (1) below 3 , where i) X 1 (resp.X 2 ) is the set of nonaccepting (resp.accepting) states of the Büchi automaton (i.e.X = X 1 + X 2 ), and ii) the two diagrams form a hierarchical equation system (HES), that is roughly a planar representation of nested and alternating fixed points.In the HES, we first calculate the least fixed point for the left diagram, and then calculate the greatest fixed point for the right diagram with u 1 replaced by the obtained least fixed point.Note that the order of calculating fixed points matters.

Contributions: Decorated Trace Semantics by Categorical Datatypes
In this paper we introduce an alternative categorical characterization to the one in [22] for the Büchi conditions, where we do not need alternating fixed points in homsets.This is made possible by suitably refining the value domain, from a final coalgebra to a novel categorical datatypes F +⊕ 0 and F + (F +⊕ 0) that have the Büchi condition built in them.Diagrammatically the characterization looks as in (2) below.Note that we ask for the greatest fixed point in both squares.
The functors F + and F +⊕ used in the datatypes are obtained by applying two operations ( ) + and ( ) ⊕ to a functor F .For an endofunctor G on a category C with enough initial algebras, G + X is given by the carrier object of a (choice of) an initial G( + X)-algebra for each X ∈ C. The universality of initial algebras allows one to define G + f : G + X → G + Y for each f : X → Y and extend G + to a functor G + : C → C.This definition is much similar to that of a free monad G * , where G * X is the carrier object of an initial G( ) + Xalgebra for X ∈ C. The operation ( ) ⊕ is defined similarly: for G : C → C and X ∈ C, G ⊕ X is given by the carrier object of a final G( + X)-coalgebra.This construction resembles to that of free completely iterative algebras [15].
The constructions of F + (F +⊕ 0) and F +⊕ 0 has a clear intuitive meaning.For the specific example of A-labeled nondeterministic Büchi automata, T = P, F = A × ( ), F + (F +⊕ 0) ∼ = F +⊕ 0 ∼ = (A + ) ω .Hence an element in F + (F +⊕ 0) or F +⊕ 0 is identified with an infinite sequence of finite words.We understand it as an infinite word "decorated" with information about how accepting states are visited, by considering that an accepting state is visited at each splitting between finite words.For example, we regard (a 0 a 1 )(a 2 a 3 a 4 )(a 5 a 6 )(a 7 ) . . .∈ (A + ) ω ∼ = F +⊕ 0 as an infinite word decorated as follows.
An element in F + (F +⊕ 0) is similarly understood, except that the initial state is regarded as a nonaccepting state.We note that by its definition, the resulting "decorated" word always satisfies the Büchi condition.Thus the arrows v 1 : X 1 → F + (F +⊕ 0) and v 2 : X 2 → F +⊕ 0 in (2) are regarded as a kind of trace semantics that assigns each state x ∈ X the set of infinite words accepted from x "decorated" with information about the corresponding accepting run.Hence we shall call v 1 and v 2 a decorated trace semantics for the coalgebra c.The generality of the category theory allows us to define decorated trace semantics for systems with other transition or branching types, e.g.Büchi tree automata or probabilistic Büchi automata.
In this paper, we also show the relationship between decorated trace semantics and (ordinary) trace semantics for Büchi automata.For the concrete case of Büchi automata sketched above, there exists a canonical function (A + ) ω → A ω that flattens a sequence and hence removes the "decorations".It is easy to see that if we thus remove decorations of a decorated trace semantics then we obtain an ordinary trace semantics.We shall prove its categorical counterpart.
In fact, the framework in [22] also covered the parity condition, which generalizes the Büchi condition.A parity automaton is equipped with a function Ω : X → [1, 2n] that assigns a natural number called a priority to each state x ∈ X.Our new framework developed in the current paper also covers parity automata.In order to obtain the value domain for parity automata, we repeatedly apply ( ) + and ( ) ⊕ to F like F +⊕•••+⊕ 0.
Compared to the existing characterization shown in (1), one of the characteristics of our new characterization as shown in (2) is that information about accepting states is more explicitly captured in decorated trace semantics, as in (3).This characteristics would be useful in categorically characterizing notions about Büchi or parity automata.For example, we could use it for categorically characterizing (bi)simulation notions for Büchi automata, e.g.delayed simulation [9], a simulation notion which is known to be appropriate for state space reduction.
To summarize, our contributions in this paper are as follows: -We introduce a new categorical data type F +⊕ 0, an alternating fixed point of a functor, for characterizing the Büchi acceptance condition.-Using the data type, we introduce a categorical decorated trace semantics, simply as a greatest fixed point.-We show the categorical relationship with ordinary trace semantics in [22].
-We instantiate the framework to several types of concrete systems.
-We extend the framework to the parity condition (in the appendix).
Related Work As we have mentioned, a categorical characterization of Büchi and parity conditions is also found in [6], but adaptation to infinite-state or probabilistic systems seems to be difficult in their framework.There also exist notions which are fairly captured by their characterization but seem difficult to capture in the frameworks in [22] and this paper, such as bisimilarity.
The notion of alternating fixed point of functors is also used in [10,2].In [10] the authors characterize the set of continuous functions from A ω to B ω as an alternating fixed point νX.µY.(B × X) + Y A of a functor.Although the data type and the one used in the current paper are different and incomparable, the intuition behind them is very similar, because the former comes with a Büchilike flavor: if f (a 0 a 1 . ..) = b 0 b 1 . . .then each b i should be determined by a finite prefix of a 0 a 1 . .., and therefore f is regarded as an infinite sequence of such assignments.In [2, §7] a sufficient condition for the existence of such an alternating fixed point is discussed.
Organization §2 gives preliminaries.In §3 we introduce a categorical data type for decorated trace semantics as an alternating fixed point of functors.In §4 we define a categorical decorated trace semantics, and show a relationship with ordinary categorical trace semantics in [22].In §5 we apply the framework to nondeterministic Büchi tree automata.In §6, we briefly discuss systems with other branching types.In §7, we conclude and give future work.
All the discussions in this paper also apply to the parity condition.However, for the sake of simplicity and limited space, we mainly focus on the Büchi condition throughout the paper, and defer discussions about the parity condition to the appendix.We omit a proof if an analogous statement is proved for the parity condition in the appendix.Some other proofs and discussions are also deferred to the appendix.

Notations
For m, n ∈ N, [m, n] denotes the set {i ∈ N | m ≤ i ≤ n}.We write π i : i X i → X i and κ i : X i → i X i for the canonical projection and injection respectively.For a set A, A * (resp.A ω ) denotes the set of finite (resp.infinite) sequences over A, A ∞ denotes A * ∪ A ω , and A + denotes A * \ { }.We write for the empty sequence.For a monotone function f : (X, ⊑) → (X, ⊑), µf (resp.νf ) denotes its least (resp.greatest) fixed point (if it exists).We write Sets for the category of sets and functions, and Meas for the category of measurable sets and measurable functions.For f :

Fixed Point and Hierarchical Equation System
In this section we review the notion of hierarchical equation system (HES) [7,3].It is a kind of a representation of an alternating fixed point.Definition 2.1 (HES) A hierarchical equation system (HES for short) is a system of equations of the following form.
as follows (no need to distinguish the base case from the step case): If such a least or greatest fixed point does not exist, then it is undefined.We call (l

Categorical Finite and Infinitary Trace Semantics
We review [17,12,13,20] and see how finite and infinitary traces of transition systems are characterized categorically.We assume that the readers are familiar with basic theories of categories and coalgebras.See e.g.[5,14] for details.We model a system as a (T, F )-system, a coalgebra c : X → T F X where T is a monad representing the branching type and F is an endofunctor representing the transition type of the system.Here are some examples of T and F : x ′ and 0 otherwise, and A carrier of an initial F -algebra models a domain of finite traces [12] while that of a final F -coalgebra models a domain of infinitary traces [13].For example, as we have seen in §1, for F = { } + A × ( ) on Sets, the carrier set of the final F -coalgebra is A ∞ while that of the initial F -algebra is A * .The situation is similar for a polynomial functor F = ({ }, P{ }) + (A, PA) × ( ) on Meas.The carrier of an initial algebra is (A * , PA * ), and that of a final coalgebra is (A ∞ , F A ∞ ) where F A ω is the standard σ-algebra generated by the cylinder set.
In general, for a certain class of functors, an initial algebra and a final coalgebra are obtained by the following well-known construction.
We next quickly review notions about the Kleisli category Kℓ(T ).
It is well-known that there is a bijective correspondence between a lifting F and a distributive law, a natural transformation λ : F T ⇒ T F satisfying some axioms [16].See §D for the details.
In the rest of this section, let F be an endofunctor and T be a monad on a category C, and assume that a lifting F : Kℓ(T ) → Kℓ(T ) is given.
In [12], a finite trace semantics of a transition system was characterized as the unique homomorphism to the final F -coalgebra in Kℓ(T ), which is obtained by reversing and lifting the initial F -algebra in C.

Definition 2.8 (tr(c))
We say F and T constitute a finite trace situation wrt.F if the following conditions are satisfied: For c : X → F X, the unique homomorphism from c to J(ι F ) −1 is called the (coalgebraic) finite trace semantics of c and denoted by tr(c) : X → A.
In [12], a sufficient condition for constituting a finite trace situation is given.Theorem 2.9 ( [12]) Assume each homset of Kℓ(T ) carries a partial order ⊑.If the following conditions are satisfied, F and T constitute a finite trace situation.
-The functor F preserves ω-colimits in C.
-Kleisli composition ⊙ is monotone, and the lifting F is locally monotone, i.e. f ⊑ g implies F f ⊑ F g. -Kleisli composition ⊙ preserves ω-suprema and the bottom element ⊥.
Here by Thm.2.5, the first condition above implies existence of an initial algebra.
In [12] it was shown that T ∈ {P, D, L} and a polynomial functor F satisfy the conditions in Thm.2.9 wrt.some appropriate orderings and liftings, and hence constitute finite trace situations.We can see the result for T = D implies T = G and a standard Borel polynomial functor F also satisfy the conditions.
An infinitary trace semantics was characterized in [13] as the greatest homomorphism to a weakly final coalgebra obtained by lifting a final coalgebra.Definition 2.10 (infinitary trace situation) We further assume that each homset of Kℓ(T ) carries a partial order ⊑.We say that F and T constitute an infinitary trace situation wrt.F and ⊑ if the following conditions are satisfied: -Jζ F : Z → F Z is a weakly final F -coalgebra that admits the greatest homomorphism, i.e. for an F -coalgebra c : X → F X, there exists the greatest homomorphism from c to Jζ F wrt. ⊑.
The greatest homomorphism from c to Jζ F is called the (coalgebraic) infinitary trace semantics of c and denoted by tr ∞ (c) : X → Z.
It is known that T ∈ {P, D, L, G} and a polynomial functor F constitute infinitary trace situations wrt.some orderings and liftings [20].Differently from finite trace situation, sufficient conditions for infinitary trace situation are not unified.In [20], two families of sufficient conditions are given.One is applicable for T = P, and the other is for T ∈ {L, G}.No condition is known for T = D.
Example 2.11 Let T = P and F = { } + A × ( ).Then a T F -coalgebra c : X → P({ } + A × X) is identified with an A-labeled nondeterministic automaton whose accepting states are given by {x | ∈ c(x)}.The arrow tr(c) has a type X → A * and assigns the set of accepted finite words to each state [12]: In contrast, tr ∞ (c) : X → A ∞ is given as follows [13]:

Büchi (T, F )-systems and its Coalgebraic Trace Semantics
The results in §2.3 was extended for systems with the parity acceptance condition in [22].We hereby review the results for the Büchi acceptance condition.
Definition 2.12 (Büchi (T, F )-system) Let n ∈ N. A Büchi (T, F )-system is a pair (c, (X 1 , X 2 )) of a F -coalgebra c : X → F X in Kℓ(T ) and a partition (X 1 , X 2 ) of X (i.e.X ∼ = X 1 +X 2 ).For i ∈ {1, 2}, we write c i for c•κ i : Their coalgebraic trace semantics is given by a solution of an HES.
Definition 2.13 (tr B i (c)) Assume that each homset of Kℓ(T ) carries a partial order ⊑.We say that F and T constitute a Büchi trace situation wrt.F and ⊑ if they satisfy the following conditions: -For an arbitrary Büchi (T, F )-system X = (c, (X 1 , X 2 )), the following HES has a solution.
The solution u sol 1 : X 1 → Z, u sol 2 : X 2 → Z of E c is called the (coalgebraic) Büchi trace semantics of X .We write tr B i (c) for u sol i for each i (see also Eq. ( 1)).
Example 2.14 Let T = P and F = A × ( ).Then a Büchi (T, F )-system (c : ) is identified with an A-labeled Büchi automaton.Following Def.2.2 we shall sketch how the solution of the HES E c in Def.2.13 is calculated.Note that Z ∼ = A ω .
-We first calculate an intermediate solution l (1) Then for each i, the solution i ( * ) is given as follows [22]: x i ∈ X 2 for infinitely many i .
3 Alternating Fixed Points of Functors

Categorical Datatypes for Büchi Systems
We first introduce the categorical datatypes F + X and F ⊕ X, which are understood as least and greatest fixed points of a functor F .Definition 3.1 (F + , F ⊕ ) For F : C → C, we define functors F + , F ⊕ : C → C as follows.Given X ∈ C, the object F + X is the carrier of (a choice of) an initial algebra ι F X : The construction F + resembles the free monad F * over F .The latter is defined as follows: given X ∈ C, the object F * X is the carrier of an initial algebra F (F * X) + X ∼ = → F * X for the functor F ( ) + X.The notations generalize the usual distinction between * and +.Indeed, for C = Sets and F = Σ 0 × (where Σ 0 is an alphabet), we have F + 1 = Σ + 0 (the set of finite words of length ≥ 1) and F * 1 = Σ * 0 (the set of all finite words).Similarly, F ⊕ resembles the free completely iterative monad [15].
Example 3.3 For F = A× ( ), by the construction in Thm.2.5, We identify (a 00 a 01 . . .a 0n0 )(a 10 a 11 . . .a 1n1 ) . . .∈ F +⊕ 0 ∼ = (A + ) ω with the following "decorated" sequence: The second component of each element (i.e.decoration) represents a break of a word: it is 2 iff it's the beginning of a word in A + .It is remarkable that in the sequence above, 10)( $%&' È É always appears infinitely many times.Hence w ∈ (A + ) ω is understood as an infinite word decorated so that the Büchi condition is satisfied.
We next define Kleisli arrows β 1 X and β 2 X that are used to define decorated trace semantics (see the diagrams in (2)).

Natural Transformations Regarding to F + and F ⊕
We introduce two natural transformations for later use.As mentioned in Rem.3.2, F + resembles the free monad F * while F ⊕ is similar to the free completely iterative monad.The first natural transformation we introduce is analogous to the multiplication of those free monads.
1 X has a type (A and is given by the concatenating function that preserves each finite word.
The second natural transformation is for "removing" decorations.

Definition 3.8 (p
Example 3.9 Let F = A × ( ).According to the characterizations in Ex. 3.3 and Rem.3.5, p 1 X has a type A + X → A + X + A ω and is given by the natural inclusion.In contrast, p 1 0 and p (2) 2 0 have types A + (A + ) ω → A ω and (A + ) ω → A ω respectively, and they are given by the flattening functions.See also Prop.5.10.

Liftings F + and F ⊕ over Kℓ(T )
Let F : Kℓ(T ) → Kℓ(T ) be a lifting of of a functor F .We show that under certain conditions, it induces liftings using the coproduct in Kℓ(T ).Definition 3.10 1. Assume T and F constitute a finite trace situation.For X ∈ C, we let In the rest of this section, we check under which conditions F + and F ⊕ are functors and form liftings of F + and F ⊕ .Functoriality of The former always holds by the finality.In contrast, the latter doesn't necessarily hold: a counterexample is T = D and F = {o} × ( ) 2 (see Ex. C.1 for details).Hence we need an extra assumption to make F ⊕ a functor.We hereby assume a stronger condition than is needed for the sake of discussions in §4.
12 Assume that T and F constitute an infinitary trace situation.Let ζ F : Z → F Z be a final F -coalgebra.We say that T and F satisfy the gfp-preserving condition wrt.an F -algebra σ : We next check if F + and F ⊕ are liftings of F + and F ⊕ .It is immediate by definition that The former is easily proved by the finality of J(ι F Y ) −1 , while the latter requires an assumption again.Definition 3.13 Assume T and F constitute an infinitary trace situation.Let ζ F : Z → F Z be a final F -coalgebra.We say that T and F satisfy the deterministicgreatest condition if for c : X → F X in C, if u : X → Z is the unique homomorphism from c to ζ F then Ju is the greatest homomorphism from Jc to Jζ F .
Concluding the discussions so far, we obtain the following proposition.Proposition 3.14 1.If T and F ( + A) constitute a finite trace situation for each A ∈ C, the operation F + is a functor and is a lifting of F + .2. If T and F ( +A) constitute an infinitary trace situation and satisfy the gfppreserving condition wrt.an arbitrary algebra and the deterministic-greatest condition for each A ∈ C, then F ⊕ is a functor and is a lifting of F ⊕ .⊓ ⊔ Hence under appropriate conditions, a lifting F : Kℓ(T ) → Kℓ(T ) of F gives rise to liftings of F + and F ⊕ .By repeating this, we can define for each i and j.See §D for the distributive laws corresponding to the liftings defined above.
Example 3.15 Let F = A × ( ) and T = P.As we have seen in Ex. 3.3, Let F be a lifting that is given as in Ex. 2.7.We can construct a lifting F +⊕ using Prop.3.14, and for f : where w ′ ∈ (A + ) + and x ∈ X, and {w} if w ∈ (A + ) ω .
4 Decorated Trace Semantics of Büchi (T, F )-systems 4.1 Definition Assumption 4.1 Throughout this section, let T be a monad and F be an endofunctor on C, and assume that each homset of Kℓ(T ) carries a partial order ⊑.We further assume the following conditions for each A ∈ C.
Existence of a solution will be proved in the next section.

Trace Semantics vs. Decorated Trace Semantics
This section is devoted to sketching the proof of the following theorem, which relates decorated trace semantics dtr i (c) and Büchi trace semantics tr B i (c) in [22] via the natural transformation in Def.3.8.
To prove this, we introduce Kleisli arrows c ‡ 2 , l 1 and l 2 (see Def. 2.2) for the HES defining tr B i (c) (see Def. 2.13), and bridge the gap between dtr i (c) and tr B i (c).
We explain an intuition why Kleisli arrows defined above bridge the gap between tr B i (c) and dtr i (c).One of the main differences between them is that tr B 1 (c) is calculated from l (1) 1 (u 2 ) which is the least fixed point of a certain function, while dtr 1 (c) is defined as the greatest homomorphism.The arrow l(1) 1 fills the gap because it is defined as the unique fixed point, which is obviously both the least and the greatest fixed point.
We shall prove Thm. 4.3 following the intuition above.The lemma below, which is easily proved by the finality of a, shows that not only l(1) 1 is characterized as the unique homomorphism.
Lemma 4.5 The Kleisli arrow l(2) Together with the definition of l(2) 2 , we have the following proposition.
This proposition implies the existence of a solution of the HES in Def.4.2.It remains to show the relationship between the l(i) j and tr p i (c).By using that l(1) 1 is the unique fixed point (and hence the least fixed point), we can prove the following equality for an arbitrary u 2 : The following equalities are similarly proved using the equality above.
By the definition of tr B i (c), these equalities imply the following proposition.

Decorated Trace Semantics for Nondeterministic Büchi Tree Automata
We apply the framework developed in §3-4 to nondeterministic Büchi tree automata (NBTA), systems that nondeterministically accept trees wrt. the Büchi condition (see e.g.[19]).We show what datatypes F + (F +⊕ 0) and F +⊕ 0, and dtr i (c) characterize for an NBTA.We first review some basic notions.For a set X, we regard Σ + X as a ranked alphabet by letting |x| = 0. We also regard Σ × X as a ranked alphabet by letting |(a, x)| = |a|.

Preliminaries on Büchi Tree Automaton
Definition 5.2 (Σ-labeled tree, [8]) it is prefix-closed), and iii) for w ∈ D and i, j ∈ N, wi ∈ D and j ≤ i imply wj ∈ D (i.e. it is downwardclosed).A Σ-labeled (infinitary) tree is a pair t = (D, l) of a tree domain D and a labeling function l : We write Tree ∞ (Σ) (resp.Tree fin (Σ)) for the set of Σ-labeled infinitary (resp.finite) trees.For w ∈ D, the w-th subtree t w of t is defined by t w = (D w , l w ) where Remark 5.3 For the sake of notational simplicity, we identify a Σ-labeled tree with a Σ-term in a natural manner.For example, a {a, b}-term (a, (b, b)) denotes an {a, b}-labeled finite tree t = ({ , 0, 1}, [ → a, 0 → b, 1 → b]).Moreover, for {a, b, c}-labeled trees t 0 = (D 0 , l 0 ) and t 1 = (D 1 , l 1 ), we write (c, t 0 , t 1 ) for a tree Definition 5.4 (NBTA) A nondeterministic Büchi tree automaton (NBTA) is a tuple A = (X, Σ, δ, Acc) of a state space X, a ranked alphabet Σ, a transition function δ : X → P( n∈N Σ n × X n ) and a set Acc ⊆ X of accepting states.

Decorated Trace Semantics of NPTA
A ranked alphabet Σ induces a functor F Σ = n∈N Σ n × ( ) n : Sets → Sets.
In [22], an NBTA A was modeled as a Büchi (P, F Σ )-system, and it was shown that L B A is characterized by a coalgebraic Büchi trace semantics tr B i (c).
where i ∈ {1, 2} and We now show what dtr i (c) characterizes for an NBTA wrt. the characterization in Prop.5.7.Firstly, the assumptions in the previous section are satisfied.
and is given by Using this, we can show the following characterization of dtr i (c).

Systems with Other Branching Types
In this section we briefly discuss other monads than T = P.As we have discussed in §3.3, the framework does not apply to T = D.
)) is understood as a Σ-labeled deterministic Büchi tree automaton with an exception.In a similar manner to T = P we can prove that they satisfy Asm.4.1.The resulting decorated trace semantics has a type dtr i (c) : X i → {⊥}+AccTree i (Σ).Note that once x ∈ X is fixed, either of the following occurs: a decorated tree is determined according to c; or ⊥ is reached at some point.The function dtr i (c) assigns ⊥ to x ∈ X i iff ⊥ is encountered from x or the resulting decorated tree does not satisfy the Büchi condition: otherwise, the generated tree is assigned to x. See §E.1 for detailed discussions, which includes the case of parity automata.
We next let T = G.A Büchi (G, F Σ )-system is understood as a probabilistic Büchi tree automaton.In fact, it is open if T = G and F = F Σ satisfy Asm.4.1.The challenging part is the gfp-preserving condition (Asm.4.1.4).However, by carefully checking the proofs of the lemmas and the propositions where the gfppreserving condition is used (i.e.Prop.3.14, Lem.4.5 and Prop.4.7), we can show that Asm.4.1.4can be relaxed to the following weaker but more complicated conditions: 4'-1.T and F + ( +A) satisfy the gfp-preserving condition wrt.an algebra F + (F +⊕ B+ A) T and F + ( +A) satisfy the gfp-preserving condition wrt.an algebra 4'-3.T and F ( +A) satisfy the gfp-preserving condition wrt.an algebra F (F ⊕ A+ In fact, only the first condition is sufficient to prove Prop.3.14 and Lem.4.5. We can show that T = G and F = F Σ on Meas satisfy the above weakened gfp-preserving condition, and hence we can consider a decorated trace semantics dtr i (c) for a Büchi (G, F Σ )-system (c : X → F Σ X, (X 1 , X 2 )) and use Thm.4.3.
Assume X is a countable set equipped with a discrete σ-algebra for simplicity.Then the resulting decorated trace semantics dtr i (c) has a type X i → G(AccTree i (Σ), F AccTreei(Σ) ) where F AccTreei(Σ) is the standard σ-algebra generated by cylinders.The probability measure assigned to x ∈ X i by dtr i (c) is defined in a similar manner to the probability measure over the set of run trees generated by a probabilistic Büchi tree automaton (see e.g.[20]).
The situation is similar for parity (G, F Σ )-systems.See §E.2 for the details.

Conclusions and Future Work
We have introduced a categorical data type for capturing behavior of systems with Büchi acceptance conditions.The data type was defined as an alternating fixed point of a functor, which is understood as the set of traces decorated with priorities.We then defined a notion of coalgebraic decorated trace semantics, and compared it with the coalgebraic trace semantics in [22].We have applied our framework for nondeterministic Büchi tree automata, and showed that decorated trace semantics is concretized to a function that assigns a set of trees decorated with priorities so that the Büchi condition is satisfied in every branch.We have focused on the Büchi acceptance condition for simplicity, but all the results can be extended to the parity acceptance condition (see §A).
Future Work There are some directions for future work.In this paper we focused on systems with a simple branching type like nondeterministic or probabilistic.Extending this so that we can deal with systems with more complicated branching type like two-player games (systems with two kinds of nondeterministic branching) or Markov decision processes (systems with both nondeterministic and probabilistic branching) is a possible direction of future work.Another direction would be to use the framework developed here to categorically generalize a verification method.For example, using the framework of coalgebraic trace semantics in [22], a simulation notion for Büchi automata is generalized in [21].Searching for an existing verification method that we can successfully generalize in our framework would be interesting.The parity condition is a generalization of the Büchi condition.A parity automaton is equipped with a priority function Ω : X → [1, 2n] that assigns a natural number called a priority to each state x ∈ X.An infinite run x 0 ) is even.For example, the parity automaton on the right above accepts an infinite word iff it contains infinitely many b but only finitely many c.

A.1 Parity (T, F )-systems and its Coalgebraic Trace Semantics
Analogous results to those in §2.3 hold for the parity acceptance condition [22].In [22] a priority function of a parity automaton was captured by a partition X = X 1 + • • • + X 2n of a state space X so that X i collects states with priority i, and trace semantics was modeled by a solution of a hierarchical equation system that is similar to (1) but consists of 2n diagrams.
Their coalgebraic trace semantics is given by a solution of an HES.

Definition A.2 (tr p
i (c)) Assume that each homset of Kℓ(T ) carries a partial order ⊑.We say that F and T constitute a parity trace situation wrt.F and ⊑ if they satisfy the following conditions: -For an arbitrary parity (T, F )-system X = (c, (X 1 , . . ., X 2n )), the following HES has a solution.
The solution (u sol i : X i → Z) 1≤i≤2n of E c is called the (coalgebraic) parity trace semantics of X .We write tr p i (c) for u sol i for each i ∈ [1, 2n] (see also Eq. ( 1)).Note that the notions of Büchi (T, F )-system and Büchi trace semantics are special cases of those of parity (T, F )-system and parity trace semantics respectively.
Example A.3 Let T = P and F = A × ( ).Then a parity (T, F )-system (c : X → F X, (X 1 , . . ., X 2n )) is identified with an A-labeled parity automaton.Each tr p i (c) has a type X i → A ω , and it is given as follows [22]: ) and lim sup i→∞ p i is even .

A.2 Categorical Datatypes for parity Systems
By repeatedly applying the operations ( ) + and ( ) ⊕ to F , we can obtain functors F (+⊕) i and F (+⊕) i + where (+⊕) i denotes i-repetition of +⊕.We introduce notations for them for simplicity.
Example A.5 We continue Ex. 3.3.In general, for i > 0, For Büchi (T, F )-systems, we have distinguished the following datatypes that are isomorphic to each other, and we wrote types of decorated trace semantics as dtr 2 (c) : X 2 → F +⊕ 0 and dtr 1 (c) : X 1 → F + F +⊕ 0 for the sake of simplicity (Rem.3.5): Similarly, for parity (T, F )-systems, we distinguish the following datatypes.
We hereby introduce a short notation for each of the above.
if j is even.By its definition, each α (i) j is an isomorphism.Furthermore, we define a natural transformation β

A.3 Natural Transformation p (i) j
We introduce a natural transformation p (i) j , which is a generalization of the transformations introduced in Def.3.8 and removes decorations.
we define a natural transformation p (i)

Decorated Trace Semantics for Parity (T, F )-systems
In order to deal with parity (T, F )-systems, we modify Asm.4.1 as follows.
Assumption A.8 Throughout this section, let T be a monad and F be an endofunctor on C, and assume that each homset of Kℓ(T ) carries a partial order ⊑.We further assume the following conditions for each n ∈ N and A ∈ C.

F ‡
n : C → C is well-defined and a lifting F ‡ n : Kℓ(T ) → Kℓ(T ) of F ‡ n is given.2. If n is even, T and F ‡ n ( + A) satisfy the conditions in Thm.2.9. 3.If n is odd, T and F ‡ n ( + A) constitute an infinitary trace situation wrt.F ‡ n and ⊑. 4. If n is odd, T and F ‡ n ( + A) satisfy the gfp-preserving condition wrt.an arbitrary σ. 5.If n is odd, T and F ‡ n ( + A) satisfy the deterministic-greatest condition.6.The lifting F ‡ n+1 is obtained from F ‡ n using the procedure in Def.3.10.7.For n ∈ N and A ∈ C, F ‡ n ( + A) is locally monotone.8. T and F constitute a parity trace situation wrt. the same ⊑ and F .Definition A.9 (dtr i (c)) For a parity (T, F )-system (c, (X 1 , . . ., X 2n )), the decorated parity trace semantics is a solution (dtr i (c) : X i → F (2n) i 0) 1≤i≤2n of the following HES, all of whose equal symbols are subscripted by ν.
) as follows (no need to distinguish the base case from the step case): ) is defined by: ) is defined as follows: Here the last equality is by the following lemma.Lemma A.12 For i ∈ N and j ∈ [0, i], F Proof.We prove the statement by the induction on j.
If j = i then the statement is immediate by definition.If j = 2l − 1 < i, we have: (by definition).
We can similarly prove the statement when j = 2l − 2 < i.

⊓ ⊔
The lemma below shows that if j is odd (resp.even), not only l(j) j but also l(i) j with i > j is characterized as the least (resp.greatest) homomorphism.Lemma A.13 Let i ∈ [1, 2n] and j ∈ [1, i].For simplicity, we write Proof.Item 1 is easily proved by the finality of J(ι We prove Item 2 by the induction on i. If i = j, then the statement is immediate by the definition of l(j)
By the definition of F (i−1) j , we have the following equation.
By the definition of a lifting F ‡ j , this means that . Hence by the gfp-preserving condition, l(i . As we have by the definition of l(i) k , the statement is proved.See also Fig. Proof.Assume that j is odd.By Lem.A.13.1, l(2n) j is the unique homomorphism from F ‡ j−1 ( l(i) j +id)⊙c ‡ j to J(ι This means that it is the greatest homomorphism.11), this means that l(2n) j is the greatest fixed point of the following function.
f →Jι is the greatest homomorphism Note here that the right hand side can be transformed as follows: ⊙ F ( l(j−1) Hence l(2n) j is the greatest fixed point of the following function: We can similarly prove the same statement when j is even.Hence ( l(2n) 1 , . . ., l(2n) 2n ) is the solution of the HES in Def.A.9, and this concludes the proof.

⊓ ⊔
This proposition implies the existence of a solution of the HES in Def.A.9.

Lemma A.15 For the HES in Def. A.2, we define the intermediate solution l
(i) , we have: The proof of the above lemma is very long, so we defer the proof to §B.2.
By definition, it suffices to prove that the following arrow is a homomorphism from [β We have: i 0 ] (by naturality) We extend the discussions in §5 for nondeterministic parity tree automata (NPTA).
Definition A.18 (NPTA, see e.g.[19]) A nondeterministic parity tree automaton (NPTA for short) is a quadruple A = (X, Σ, δ, Ω) of a set X of states, a ranked alphabet Σ, a transition function δ : X → P( n∈N Σ n ×X n ) and a priority function Definition A.19 (L p A ) Let A = (X, Σ, δ, Ω) be an NPTA where Ω : X → [1, 2n].A run tree over A is is defined in a similar manner to that over an NBTA (Def.5.5).A run tree is accepting if for each branch (a 0 , x 0 )(a 1 , x 1 ) . . .∈ (Σ × X) ω , lim sup k→∞ Ω(x k ) is even.We write Run A (x) (resp.AccRun A (x)) for the set of run trees (resp.accepting run trees) whose root node is labeled by x ∈ X.For A ⊆ X, Run A (A) denotes ∪ x∈A Run(x).We define AccRun A (A) similarly.If no confusion is likely, we omit the subscript A. We define DelSt : Run(X) → Tree ∞ (Σ) in a similar manner to that for NBTA.The language Proposition A.20 ([22]) We assume the situation in Prop.5.6.
The following proposition generalizes Prop.5.7.It is proved in a similar manner to Ex. A.5.
Proposition A. 21 We define a set AccTree the root node is labeled by j, and for each infinite branch, the maximum priority appearing infinitely is even .
Moreover, we define a function Then AccTree j : AccTree where α (i) j is defined as in Def. A. 6 and AccTree (i) 0 (Σ, A) is defined as follows: only the root node is labeled by 0, and for each infinite branch, the maximum priority appearing infinitely is even .

⊓ ⊔
By using the characterizations in the proposition above, we can concretely prove that the assumptions required in the previous sections are satisfied by P and F Σ .
Proof.Cond. 2 is proved in a similar manner to [12].Cond. 3 is proved in a similar manner to [20] using Prop.A.21.. We prove that Cond. 4 is satisfied.Let c : It is easy to see that m ⊙ l is a fixed point of Φ c,σ .We show that it is the greatest fixed point.Let t : X → ((F Σ ) ‡ i ) ⊕ A be a fixed point of Φ c,σ .For each k ∈ ω, we inductively define By Thm.2.5, (((F Σ ) ‡ i ) ⊕ A, (π k ) k∈ω ) is a limit over a final sequence 1 For each k ∈ ω, we inductively define , and moreover m ⊙ l ′ = t.The former implies l ′ ⊑ l.Hence we have t = m ⊙ l ′ ⊑ m ⊙ l.Therefore m ⊙ l is the greatest fixed point of Φ c,σ .Hence Cond. 4 is satisfied.
We prove that Cond. 5 is satisfied.Let c : and x ∈ X, and assume that t ∈ f (x).Then as f and Ju are homomorphism from Jc to Jζ , we can prove t = u(x) by the induction on the structure of t.Hence Ju is the greatest homomorphism.
It is proved in a similar manner to [12,20,22] that Cond.7 is satisfied using Prop.A.21.
Using Prop.A.21, Cond.8 is proved in a similar manner to [22].
Proposition A.24 We define DelSt (i) j : AccTree , and the greatest homomorphism from F (id Hence immediate by the gfp-preserving condition. Proof (Prop.3.14) A to itself, on the one hand.On the other hand, id A is also a homomorphism from ζ F A .Hence by the finality of ζ F A , we have u We define an F -coalgebra γ i : Then the unique homomorphism from γ i to ζ F 0 : F ⊕ 0 → F F ⊕ 0 is given by the following arrow: Proof.It suffices to show that it is a homomorphism.We have: This concludes the proof.⊓ ⊔ Sublemma B.4 For each j ∈ [1, i − 1], we have the following equality.
Proof.By Sublem.B.3, it suffices to show that the following arrow is a homomorphism from We have: A , . . ., p This concludes the proof.⊓ ⊔ Sublemma B. 5 The unique homomorphism from an F -coalgebra is given by the following arrow: Proof.suffices to that the arrow is a homomorphism.We have: Proof.Assume that i is even.We write Φ for Φ (by the naturality of β (by Def.A.6) .( 7) We now show that Jµ i F ⊕ 0 is a fixed point of Φ.By Eq. ( 7) above, we have: It remains to show that it is the greatest fixed point.Let f be a fixed point of Φ.For each j ∈ [1, i − 1], we have: , . . ., Jp , . . ., Jp Therefore we have to show that Jµ (see also Fig. 4).

By definition, l(i)
i is the greatest homomorphism from c ‡ i to Jζ F Xi+1+•••+X2n , and Therefore by the gfp-preserving condition (Asm.A.8.4), Jµ F ⊕ 0 ⊙Jp Eq. ( 6) is similarly proved when i is odd, except that we use the finality instead of Lem.B.1, and Sublem.B.7 instead of the gfp-preserving condition respectively.
It remains to prove Eq. (6) for j < i.We have: ⊙ F ] and f (y 1 ) = f (y 2 ) = [x → In a similar manner to Ex. 3.3, we can show that F ⊕ X is identified with the set of infinitary binary trees whose depth is greater than 1, nodes are labeled with o and leaves are labeled with x.A set F ⊕ Y is similarly characterized.Let t X ∈ F ⊕ X be an element identified with a tree o(x, o(x, o(x, . ..))).For each t Y ∈ F ⊕ Y , This implies F ⊕ f (t X )(t Y ) = 0, and therefore F ⊕ g ⊙ F ⊕ f (t X )(t X ) = 0.In contrast, id X : X → X is a homomorphism from F (id+g)⊙F (id+f )⊙Jζ F X = Jζ F X to itself, and id X (t X )(t X ) = 1 = 0. Hence F ⊕ (g⊙f )(t X )(t X ) ≥ 1, and this means that the operation F ⊕ does not satisfy the functoriality.
D Distributive Laws from T to F + and F ⊕ Definition D.1 A distributive law from T to F is a natural transformation λ : F T ⇒ T F that makes the following diagrams commute for each X.
Proposition D.2 Let λ : F T ⇒ T F be a distributive law from T to F .For A, X ∈ C, we write λA,X for λ A+X •F [T κ 1 •η A , T κ 2 ] : F (A+T X) → T F (A+X).
1. Assume T and F ( + A) constitute a finite trace situation for each A ∈ C. For X ∈ C we define λ +,X : F + T X → T F + X as the unique homomorphism from λF + T X,X ⊙ J(ι F T X ) −1 to J(ι F X ) −1 .Then λ + := (λ +,X ) X∈C is a natural transformation F + T ⇒ T F + , and is a distributive law from T to F + .2. Assume T and F ( + A) constitute an infinitary trace situation and satisfy the gfp-preserving condition and the deterministic-greatest condition for each A ∈ C. For X ∈ C, let λ ⊕,X : F ⊕ T X → T F ⊕ X be the greatest homomorphism from λF ⊕ T X,X ⊙ Jζ F T X to Jζ F X .Then λ ⊕ := (λ ⊕,X ) X∈C is a natural transformation F ⊕ T ⇒ T F ⊕ , and is a distributive law from T to F ⊕ .

Definition 2 . 4 (
polynomial functors) A polynomial functor F on Sets is defined by the following BNF notation: F ::= id | A | F × F | i∈I F where A ∈ Sets and I is countable.A (standard Borel) polynomial functor F on Meas is defined by the following BNF notation: F ::= id | A | F × F | i∈I F where A ∈ Meas, I is countable, and the σ-algebras over products and coproducts are given in the standard manner (see e.g.[20, Def.2.2]).

Definition 2 . 6 (
Kℓ(T ), J, U and F ) Let T = (T, η, µ) be a monad on C. The Kleisli category Kℓ(T ) is given by |Kℓ(T)| = |C| and Kℓ(T )(X, Y ) = C(X, T Y ) for X, Y ∈ |Kℓ(T )|.An arrow f ∈ Kℓ(T )(X, Y) is called a Kleisli arrow, and we write f : X → Y for distinction.Composition of arrows f : X → Y and g : Y → Z is defined by µ Z • T g • f , and denoted by g ⊙ f for distinction.The lifting functor J : C → Kℓ(T ) is defined by: JX := X and J(f