Minimisation of Event Structures

Event structures are fundamental models in concurrency theory, providing a representation of events in computation and of their relations, notably concurrency, conflict and causality. In this paper we present a theory of minimisation for event structures. Working in a class of event structures that generalises many stable event structure models in the literature (e.g., prime, asymmetric, flow and bundle event structures), we study a notion of behaviour-preserving quotient, referred to as a folding, taking (hereditary) history preserving bisimilarity as a reference behavioural equivalence. We show that for any event structure a folding producing a uniquely determined minimal quotient always exists. We observe that each event structure can be seen as the folding of a prime event structure, and that all foldings between general event structures arise from foldings of (suitably defined) corresponding prime event structures. This gives a special relevance to foldings in the class of prime event structures, which are studied in detail. We identify folding conditions for prime and asymmetric event structures, and show that also prime event structures always admit a unique minimal quotient (while this is not the case for various other event structure models).


Introduction
When dealing with formal models of computational systems, a classical problem is that of minimisation, i.e., for a given system, define and possibly construct a compact version of the system which, very roughly speaking, exhibits the same behaviour as the original one, avoiding unnecessary duplications. The minimisation procedure depends on the notion of behaviour of interest and also on the expressive power of the formalism at hand, which determines its capability of describing succinctly some behaviour. One of the most classical examples is that of finite state automata, where one is typically interested in the accepted language. Given a deterministic finite state automaton, a uniquely determined minimal automaton accepting the same language can be constructed, e.g., as a quotient of the original automaton via a partition/refinement algorithm (see, e.g., [14]). Moving to non-deterministic finite automata, minimal automata become smaller, at the price of a computationally more expensive minimisation procedure and non-uniqueness of the minimal automaton [20]. In this paper we study the problem of minimisation for event structures, a fundamental model in concurrency theory [31,32]. Event structures are a natural semantic model when one is interested in modelling the dynamics of a system by providing an explicit representation of the events in computations (occurrence of atomic actions) and of the relations between events, like causal dependencies, choices, possibility of parallel execution, i.e., in what is referred to as a true concurrent (non-interleaving) semantics. Prime event structures [22], probably the most widely used event structure model, capture dependencies between events in terms of causality and conflict. A number of variations of prime event structures have been arXiv:1907.07042v1 [cs.LO] 16 Jul 2019 introduced in the literature. In this paper we will deal with asymmetric event structures [5], which generalise prime event structures with an asymmetric form of conflict which allows one to model concurrent readings and precedences between actions, and flow [8,7] and bundle [18] event structures, which add the possibility of directly modelling disjunctive causes. Event structures have been used for defining a concurrent semantics of several formalisms, like Petri nets [22], graph rewriting systems [4,3,25] and process calculi [30,29,9]. Recent applications are in the field of weak memory models [23, 15,11] and of process mining and differencing [12].
Behavioural equivalences, defined in a true concurrent setting, take into account not only the possibility of performing steps, but also the way in which such steps relate with each other. We will focus on hereditary history preserving (hhp-)bisimilarity [6], the finest equivalence in the true concurrent spectrum in [26], which, via the concept of open map, has been shown to arise as a canonical behavioural equivalence when considering partially ordered computations as observations [16].
The motivation for the present paper originally stems from some work on the analysis and comparison of business process models. The idea, advocated in [12,1], is to use event structures as a foundation for representing, analysing and comparing process models. The processes, in their graphical presentation, should be understandable, as much as possible, by a human user, who should be able, e.g., to interpret the differences between two processes diagnosed by a comparison tool. For this aim it is important to avoid "redundancies" in the representation and thus to reduce the number of events, but clearly without altering the behaviour. The paper [2] explores the use of asymmetric and flow event structures and, for such models, it introduces some ad-hoc reduction techniques that allow one to merge sets of events without changing the true concurrent behaviour. A general notion of behaviour preserving quotient, referred to as a folding, is introduced over an abstract class of event structures, having asymmetric and flow event structures as subclasses. However, no general theory is developed. The paper focuses on a special class of foldings, the so-called elementary foldings, which can only merge a single set of events into one event, and these are studied separately on each specific subclass of event structures (asymmetric and flow event structures), providing only sufficient conditions ensuring that a function is a folding.
A general theory of behaviour preserving quotients for event structures is thus called for, settling some natural foundational questions. Is the notion of folding adequate, i.e., are all behaviour preserving quotients expressible in terms of foldings? Is there a minimal quotient in some suitably defined general class of event structures? What happens in specific subclasses? (for asymmetric and flow event structures the answer is known to be negative, but for prime event structures the question is open). Working in the specific subclasses of event structures, can we have a characterisation of general foldings, providing not only sufficient but also necessary conditions?
In this paper we address the above questions. We work in a general class of event structures based on the idea of family of posets in [24], sufficiently expressive to generalise most stable event structures models in the literature, including prime [22], asymmetric [5], flow [8] and bundle [18] event structures.
As a first step we study, in this general setting, the notion of folding, i.e., of behaviour preserving quotient. A folding is a surjective function that identifies some events while keeping the behaviour unchanged. Formally, it establishes a hhp-bisimilarity between the source and target event structure. Foldings can be characterised as open maps in the sense of [16]. Actually, it turns out that not all behaviour preserving quotients arise as a folding, but we show that for any behaviour preserving quotient, there is a folding that induces a coarser equivalence, in a way that foldings properly capture all possible behaviour preserving quotients. Additionally, given two possible foldings of an event structure we show that it is always possible to "join" them. This allows to prove that for each event structure a maximally folded version, namely a uniquely determined minimal quotient always exists.
Relying on the order-theoretic properties of the set of configurations of event structures [24], and on the correspondence between prime event structures and domains [22], we derive that each event structure in the considered class arises as the folding of a canonical prime event structure. Moreover, all foldings between general event structures arise from foldings of the corresponding canonical prime event structures. Interestingly, this result can be derived from the characterisation of folding morphisms as open maps.
The results above give a special relevance to foldings in the class of prime event structures, which thus are studied in detail. We provide necessary and sufficient conditions characterising foldings for prime event structures. This allows establish a clear connection with the so-called abstraction morphisms, introduced in [10] for similar purposes. This characterisation of foldings can guide, at least in the case of finite structures, the construction of behaviour preserving quotients. Moreover we show that also prime event structures always admit a minimal quotient.
The fact that all event structures arise as foldings of prime event structures allows one to think of various brands of event structures in the literature, like asymmetric, flow, bundle event structures as more expressive models that allow for smaller realisations of a given behaviour, i.e., of smaller quotients. For all these classes, however, the uniqueness of the minimal quotient is lost. Despite the fact that foldings on wider classes of event structures can be studied on the corresponding canonical prime event structures, a direct approach can be theoretically interesting and it can lead more efficient minimisation procedures. In this paper, a characterisation of foldings is explicitly devised for asymmetric event structures.
Most results have a natural categorical interpretation, which is only hinted at in the paper. In order to keep the presentation simple, the categorical references are inserted in side remarks that can be safely skipped by the non-interested reader. This applies, in particular, to the possibility of viewing foldings as open maps in the sense of [16]. This correspondence, which in the present paper only surfaces, suggests the possibility of understanding and developing our results in a more abstract categorical setting. More details about this are provided in the appendices.
The rest of the paper is structured as follows. In § 2 we introduce the class of event structures we work with, hereditary history preserving bisimilarity and we discuss how various event structure models in the literature embed into the considered class. In § 3 we introduce and study the notion of folding, we prove the existence of a minimal quotient and we show the tight relation between general foldings and those on prime event structures. In § 4 we present folding criteria on prime and asymmetric event structures, and discuss the existence of minimal quotients. Finally, in § 5 we draw some conclusions, discuss connections with related literature and outline future work venues. An appendix contains all proofs and some additional technical results.

Event Structures and History Preserving Bisimilarity
In this section we define hereditary history-preserving bisimilarity, the reference behavioural equivalence in the paper. This is done for an abstract notion of event structure, introduced in [24], in a way that various stable event structure models in the literature can be seen as special subclasses. We will explicitly discuss prime [22], asymmetric [5], flow [8,7] and Notation. We first fix some basic notation on sets, relations and functions. Let r⊆ X × X be a binary relation. Given Y, Z ⊆ X, we write Y r ∀ Z (resp. Y r ∃ Z) if for all (resp. for some) y ∈ Y and z ∈ Z it holds y r z. When Y or Z are singletons, sometimes we replace them by their only element, writing, e.g., y r ∃ Z for {y} r ∃ Z. The relation r is acyclic on Y if there is no {y 0 , y 1 , . . . , y n } ⊆ Y such that y 0 r y 1 r . . . r y n r y 0 . Relation r is a partial order if it is reflexive, antisymmetric and transitive. Given a function f : Note that the same notation can represent an update of f , when x ∈ X, or an extension of its domain, otherwise. For Z ⊆ X, we denote by f |Z : Z → Y the restriction of f to Z.

Event Structures
Following [24, 27, 28, 2], we work on a class of event structures where configurations are given as a primitive notion. More precisely, we borrow the idea of family of posets from [24].

Definition 1 (family of posets).
A poset is a pair (C, ≤ C ) where C is a set and ≤ C is a partial order on C. A poset will be often denoted simply as C, leaving the partial order relation ≤ C implicit. Given two posets C 1 and C 2 we say that C 1 is a prefix of C 2 and write A family of posets F is a prefix-closed set of finite posets i.e., a set of finite posets such that if C 2 ∈ F and C 1 C 2 then C 1 ∈ F . We say that two posets C 1 , C 2 ∈ F are compatible, written C 1 C 2 , if they have an upper bound, i.e., there is C ∈ F such that C 1 , C 2 C. The family of posets F is called coherent if each subset of F whose elements are pairwise compatible has an upper bound.
Posets C will be used to represent configurations, i.e., sets of events executed in a computation of an event structure. The order ≤ C intuitively represents the order in which the events in C can occur. This motivates the prefix order that can be read as a computational extension: when C 1 C 2 we have that C 1 ⊆ C 2 , with events in C 1 ordered exactly as in C 2 , and the new events in C 2 \ C 1 cannot precede events already in C 1 . An example of family of posets can be found in Fig. 1 (left). Observe, for instance, that the configuration with set of events {c} is not a prefix of the one with set of events {a, c}, since in the latter a ≤ c.
An event structure is then defined simply as a coherent family of posets where events carry a label. Hereafter Λ denotes a fixed set of labels.
Definition 2 (event structure). A (poset) event structure is a tuple E = E, Conf (E), λ where E is a set of events, Conf (E) is a coherent family of posets such that E = Conf (E) and λ : E → Λ is a labelling function. For a configuration C ∈ Conf (E) the order ≤ C is referred to as the local order.
In [2] abstract event structures are defined as a collection of ordered configurations, without any further constraint. This is sufficient for giving some general definitions which are then studied in specific subclasses of event structures. Here, in order to develop a theory of foldings at the level of general event structures, we need to assume stronger properties, those of a family of posets from [24] (e.g, the fact that Definition 26 is well-given relies on this). This motivates the name poset event structure. Also note that, differently from what happens in other general concurrency models, like configuration structures [28], configurations are endowed explicitly with a partial order, which in turn intervenes in the definition of the prefix order between configurations. This will be essential to view asymmetric or flow event structures as subclasses. Since we only deal with poset event structures and their subclasses, we will often omit the qualification "poset" and refer to them just as event structures. Moreover, we will often identify an event structure E with the underlying set E of events and write, e.g., x ∈ E for x ∈ E.
An isomorphism of configurations f : C → C is an isomorphism of posets that respects the labelling, namely for all x, y ∈ C, we have λ(x) = λ(f (x)) and x ≤ C y iff f (x) ≤ C f (y). When configurations C, C are isomorphic we write C C .
As mentioned above, the prefix order on configurations can be interpreted as computational extension. This will be later formalised by a notion of transition system over the set of configurations (see Definition 4).
Given an event x in a configuration C it will be useful to refer to the prefix of C including only those events that necessarily precede x in C (and x itself). This motivates the following definition.

Definition 3 (history)
. Let E be an event structure, let C ∈ Conf (E) and let x ∈ C. The history of x in C is defined as the set The set of histories of a specific event x ∈ E will be denoted by Hist(x).

Hereditary History Preserving Bisimilarity
In order to define history preserving bisimilarity, it is convenient to have an explicit representation of the transitions between configurations. Definition 4 (transition system). Let E be an event structure. If C, C ∈ Conf (E) with When X is a singleton, i.e., X = {x}, we will often write C It is easy to see that in an event structure each configuration is reachable in the transition system from the empty one.
As it happens in the interleaving approach, a bisimulation between two event structures requires any event of an event structure to be simulated by an event of the other, with the same label. Additionally, the two events are required to have the same "causal history".
Observe that, in the definition above, an event must be simulated by an event with the same label. In fact, in the triple (C∪{x}, must be an isomorphism of configurations, i.e., of labelled posets, and thus it preserves labels. Hhp-bisimilarity has been shown to arise as a canonical behavioural equivalence on prime event structures, as an instance of a general notion defined in terms of the concept of open map, when considering partially ordered computations as observations [16].

Examples: Prime, Asymmetric, Flow and Bundle Event Structures
We next observe how different kinds of event structures, introduced for various purposes in the literature, can be naturally viewed as subclasses of the poset event structures in Definition 2. Verifying that the corresponding families of configurations satisfy the properties of Definition 2 is straightforward. This section is mainly intended to provide material for examples and discussions. The reader can quickly browse through it: only the correspondence with prime event structures will play a major role in the rest of the paper.
Prime event structures. Prime event structures [22] are one of the simplest and most popular event structure models, where dependencies between events are captured in terms of causality and conflict. Definition 6 (prime event structure). A prime event structure ( pes, for short) is a tuple P = E, ≤, #, λ , where E is a set of events, ≤ and # are binary relations on E called causality and conflict, respectively, and λ : E → Λ is a labelling function, such that ≤ is a partial order and x = {y ∈ E | y ≤ x} is finite for all x ∈ E; # is irreflexive, symmetric and hereditary with respect to causality, i.e., for all x, y, z ∈ E, if x#y and y ≤ z then x#z.
Configurations are sets of events without conflicts and closed with respect to causality. For later use, we also introduce a notation for the absence of conflicts, referred to as consistency.
Definition 7 (consistency, configuration). Let P = E, ≤, #, λ be a pes. We say that x, y ∈ E are consistent, written x y, when ¬(x#y). A subset X ⊆ E is called consistent, written X, when its elements are pairwise consistent. A configuration of P is a finite set of events C ⊆ E such that (i) C and (ii) for all x ∈ C, x ⊆ C.
Some examples of pess can be found in Fig. 2. Causality is represented as a solid arrow, while conflict is represented as a dotted line. For instance, in P 0 , event a 1 is a cause of b 1 and it is in conflict both with a 2 and b 3 . Only direct causalities and non-inherited conflicts are represented. For instance, in P 0 , the conflicts a 1 #b 2 , a 2 #b 1 and b 1 #b 2 are not represented since they are inherited. The labelling is implicitly represented by naming the events by their label, possibly with some index. For instance, a 1 and a 2 are events labelled by a.
Clearly pess can be seen as poset event structures. Given a pes P = E, ≤, #, λ and its set of configurations Conf (P), the local order of a configuration C ∈ Conf (P) is ≤ C =≤ ∩(C × C), i.e., the restriction of the causality relation to C. The extension order turns out to be simply subset inclusion. In fact, given . Moreover, if x 1 ∈ C 1 and x 2 ∈ C 2 , with x 2 ≤ C2 x 1 , then necessarily x 2 ∈ C 1 since configurations are causally closed. As an example, the pes P 2 of Fig. 2, viewed as a poset event structure, can be found in Fig. 3.
Asymmetric event structures. Asymmetric event structures [5] are a generalisation of pes where conflict is allowed to be non-symmetric. Definition 8 (asymmetric event structure). An asymmetric event structure ( aes, for short) is a tuple A = E, ≤, , λ , where E is a set of events, ≤ and are binary relations on E called causality and asymmetric conflict, and λ : E → Λ is a labelling function, such that ≤ is a partial order and In the graphical representation, asymmetric conflict is depicted as a dotted arrow. For instance, in the asymmetric event structure A 0 of Fig. 4 we have a 12 b 123 . Again, only non inherited asymmetric conflicts are represented.
The asymmetric conflict relation has two natural interpretations, i.e., x y can be understood as (i) the occurrence of y prevents x, or (ii) x precedes y in all computations where both appear. This allows to represent faithfully the existence of precedences between actions and concurrent read accesses to a shared resource (intuitively, while readings can occur concurrently, destructive accesses can follow, but obviously not precede a reading).
The interpretation of asymmetric conflict above should give some intuition for the conditions in Definition 8. Condition (1) naturally arises from interpretation (ii) above: when x < y clearly x precedes y when both occur and thus x y. Condition (2) is a form of hereditarity of asymmetric conflict along causality: if x y and y < z then all runs where x and z appear, necessarily also include y, and x precedes y which in turn precedes z, hence x z. Concerning (3) and (4), observe that events forming a cycle of asymmetric conflict cannot appear in the same run, since each event in the cycle should occur before itself in the run. For instance, in the aes A 1 of Fig. 4, we have a 1 a 2 a 1 , hence a 1 and a 2 cannot appear in the same computation. In this view, condition (3) corresponds to irreflexiveness of conflict in pess, while condition (4) requires that binary symmetric conflict is explicitly represented by asymmetric conflict in both directions. Indeed, prime event structures can be identified with the subclass of aess where is symmetric. Configurations are again defined as causally closed and conflict free sets of events.

Definition 9 (aes configuration). Let
Also aess can be seen as special poset event structures. Given an aes A = E, ≤, , λ and its set of configurations Conf (A), the local order of a configuration C ∈ Conf (A) is ≤ C = ( ∩(C × C)) * , i.e., the transitive closure of restriction of the asymmetric conflict to C. The prefix order on configurations is not simply set-inclusion: since a configuration C cannot be extended with an event which is prevented by some of the events already present in C.
. For instance, the configurations Conf (A 0 ) of A 0 , ordered by prefix, can be obtained from Flow event structures. In some situations, it can be quite useful to have the possibility of modelling in a direct way the presence of multiple disjunctive and mutually exclusive causes for an event, something that is not possible in pess and in aess, where for each event there is a uniquely determined minimal set of causes. For instance, in a process calculus with non deterministic choice "+" and sequential composition ";" in order to give a pes semantics to (a + b); c we are forced to use two different events to represent the execution of c, one for the execution of c after a and the other for the execution of c after b.
We briefly describe a model that overcomes this limitation, namely flow [8,7] event structures.
Causality is replaced by an irreflexive (in general non transitive) flow relation ≺, intuitively representing immediate causal dependency. Moreover, conflict is no longer hereditary.
An event can have causes which are in conflict and these have a disjunctive interpretation, i.e., the event will be enabled by a maximal conflict-free subset of its causes. This is formalised by the notion of configuration.
Some examples of fess can be found in Fig. 5. Relation ≺ is represented by a double headed solid arrow. For instance, consider the fes F 1 . The set C = {a, d 01 } is a configuration. We have b ≺ d 01 and b ∈ C, but this is fine since there is a ∈ C such that a#b and a ≺ d 01 .
Under mild assumptions that exclude the presence of non-executable events (a condition referred to as fullness in [7]), fess can be seen as poset event structures, by endowing each configuration C with a local order arising as the reflexive and transitive closure of the restriction of the flow relation to C, i.e., ≤ C = (≺ ∩(C × C)) * .
Bundle event structures. Bundle event structures [18,19] are another event structure model that has been introduced in order to enable a direct representation of disjunctive causes, thus easing the definition of the semantics of the process description language lotos.
Here a set of multiple disjunctive and mutually exclusive causes for an event is called a bundle set for the event, and comes into play as a primitive notion. The explicit representation of the bundles makes bundle event structures strictly less expressive than flow event structures. (see [19] for a wider discussion). On the other hand, bundle event structures offer the advantage of having a simpler theory. For instance, differently from what happens for flow event structures, non-executable events can be removed without affecting the behaviour of the event structure.
Configurations can be defined as conflict free sets of events that contain, for each event, a element from of each of its bundles. Formally, Endowing configurations with → * C turns a bundle event structure into an event structure in the sense of Definition 2.

Foldings of Event Structures
In this section, we study a notion of folding, which is intended to formalise the intuition of a behaviour-preserving quotient for an event structure. We prove that there always exists a minimal quotient and we show that foldings between general poset event structures always arise, in a suitable formal sense, from foldings over prime event structures.

Morphisms and Foldings
We first endow event structures with a notion of morphism. Below, given two event structures E, E , a function f : E → E and a configuration C ∈ Conf (E), we write f (C) to refer to the configuration whose underlying set is Definition 13 (morphism). Let E, E be event structures. A (strong) morphism f : E → E is a function between the underlying sets of events such that λ = λ • f and for all configurations Hereafter, the qualification "strong" will be omitted since this is the only kind of morphisms we deal with. It is motivated by the fact that normally morphisms on event structures are designed to represent simulations. If this were the purpose, then the requirement on preservation of configurations could have been weaker, i.e., we could have asked the order in the target configuration to be included in (not identical to) the image of the order of the source configuration (precisely, given a configuration C, Moreover, morphisms could have been partial. However, in our setting, for the objective of defining history-preserving quotients, the stronger notion works fine and simplifies the presentation.

Remark 14. The composition of morphisms is a morphism and the identity is a morphism.
Hence the class of event structures and event structure morphisms form a category ES.

Definition 15 (folding). Let E and E be event structures. A folding is a morphism
In words, a folding is a function that "merges" some sets of events of an event structure into single event without altering the behaviour modulo hhp-bisimilarity. In [2] the notion of folding asks for the preservation of hp-bisimilarity, a weaker behavioural equivalence which is defined as hhp-bisimilarity but omitting the requirement of downward-closure. Note that, as far as the notion of folding is concerned, this makes no difference: R f is downward-closed by definition, hence it is a hhp-bisimulation whenever it is a hp-bisimulation. Instead, taking hhp-bisimilarity as the reference equivalence appears to be the right choice for the development of the theory. E.g., it allows one to prove Lemma B.6 that plays an important role for arguing about the adequateness of the notion of folding. Interestingly, foldings can be characterised as open maps in the sense of [16], by taking conflict free prime event structures as subcategory of observations. This is explicitly worked out in the appendix (Lemma B.3).
As an example, consider the pess in Fig. 2 and the function f 02 : P 0 → P 2 that maps events as suggested by the indices, i.e., f 02 ( Then it is easy to see that f 02 is a folding. Note that, instead, f 01 : P 0 → P 1 , again mapping events according to their indices, is not a folding. In fact, It is also interesting to observe that the greater expressiveness of aess allows one to obtain smaller quotients. For instance, while the pes P 2 in Fig. 2 is minimal in the class of pess, if we view it as an aes, it can be further reduced. In fact the obvious function from P 2 to the aes A 0 in Fig. 4 can be easily seen to be a folding. Remark 16. The composition of foldings is a folding and the identity is a folding. We can consider a subcategory ES f of ES with the same objects and foldings as morphisms (see Lemma B.1 in the Appendix).
Again in the setting of aess, consider the structures in Fig. 4 and the functions g 12 : A 1 → A 2 , and g 23 : A 2 → A 3 , naturally induced by the indices. These can be seen to be foldings. The first one merges c 1 , in conflict with b and c 2 caused by b to a single event c 12 , in asymmetric conflict with b. The second one merges the two conflicting events a 1 and a 2 into a single one a 12 . Their composition g 13 = g 23 • g 12 : Consider the fess in Fig. 5. Again the obvious functions from F 0 to F 1 and F 2 can be seen to be foldings. Instead, seen as a pes, the event structure F 0 is minimal.
The next result shows that if we know that f : E → E is a morphism, then half of the conditions needed to be a hhp-bisimulation and thus folding, i.e., condition (1) in Definition 5, is automatically satisfied. This is used later in proofs whenever we need to show that some map is a folding.
Lemma 17 (from morphisms to foldings). Let E and E be event structures and let f : A simple but crucial result shows that the target event structure for a folding is completely determined by the mapping on events. This allows us to view foldings as equivalences on the source event structures. We first define the quotient induced by a morphism.

Definition 18 (quotients from morphisms). Let E, E be event structures and let
It is immediate to see that E /≡ f is a well-defined event structure.
Lemma 19 (folding as equivalences). Let E, E be event structures and let f : The previous result allows us to identify foldings with the corresponding equivalences on the source event structures and motivates the following definition.
Definition 20 (folding equivalences). Let E be an event structure. The set of folding Hereafter, we will freely switch between the two views of foldings as morphisms or as equivalences, since each will be convenient for some purposes.
We next observe that given two foldings we can always take their "join", providing a new folding that, roughly speaking, produces a smaller quotient than both the original ones.
Proposition 21 (joining foldings). Let E, E , E be event structures and let f : As an example, consider the pes in Fig. 2 and two morphisms f 30 : P 3 → P 0 and f 31 : P 3 → P 1 . The way all events are mapped by f 30 and f 31 is naturally suggested by their labelling, apart for the b ij for which we let It can be seen that both are foldings. Their join, constructed as in Proposition 21, is P 2 with the folding morphisms f 02 : P 0 → P 2 and f 12 : P 1 → P 2 . Fig. 7 in the Appendix for a counterexample).

Remark 22. Proposition 21 is a consequence of the fact that the category ES has pushouts of foldings. Indeed, E as defined above is the pushout of f and f (in ES and also in ES f ). It can be seen that, instead, ES does not have all pushouts (see
When interpreted in the set of folding equivalences of an event structure, Proposition 21 has a clear meaning. Recall that the equivalences over some fixed set X, ordered by inclusion, form a complete lattice, where the top element is the universal equivalence X × X and the bottom is the identity on X. Then Proposition 21 implies that FEq(E) is a sublattice of the lattice of equivalences. Actually, it can be shown that FEq(E) is itself a complete lattice. Therefore each event structure E admits a maximally folded version. It is natural to ask whether all behaviour preserving quotients correspond to foldings. Strictly speaking, the answer is negative. More precisely, there can be morphisms f : E → E such that E /≡ f is hhp-bisimilar to E, but f is not a folding. For an example, consider the pess P 0 and P 1 in Fig. 2 and the morphism f 01 : P 0 → P 1 suggested by the indexing. We already observed this is not a folding, but P 0/≡ f 01 , which is isomorphic to P 1 , is hhp-bisimilar to P 0 .
However, we can show that for any behaviour preserving quotient, there is a folding that produces a coarser equivalence, and thus a smaller quotient. For instance, in the example discussed above, there is the folding f 02 : P 0 → P 2 , that "produces" a smaller quotient.
This follows from the possibility of joining foldings (Proposition 21) and the fact that a hhp-bisimulation can be always seen as an event structure, a result that generalises to our setting a property proved for pess in [6].
Proposition 25 (foldings subsume behavioural quotients). Let E be an event structure and let f : E → E be a morphism such that E /≡ f is hhp-bisimilar to E. Then there exists a folding g : E → E such that ≡ g is coarser than ≡ f .

Folding through Prime Event Structures
Here we observe that each event structure is the folding of some canonical pes. We then prove that, interestingly enough, all foldings between event structures arise from foldings of the corresponding canonical pess.
We start with the definition of the canonical pes associated with an event structure.
Definition 26 (pes for an event structure). Let E be an event structure. Its canonical pes is P(E) = Hist(E), , #, λ where is prefix, # is inconsistency, i.e., for It can be easily seen that the definition above is well-given. In particular, P(E) is a well-defined pes because, as proved in [24], a family of posets ordered by prefix is finitary coherent prime algebraic domain. Then the tight relation between this class of domains and pes highlighted in [31] allows one to conclude the proof. For instance, in Fig. 1(right) one can find the canonical pes for the event structure on the left.
The canonical pes associated with an event structure can always be folded to the original event structure.
Lemma 27 (unfolding event structures to pes's). Let E be an event structure. Define a function φ E : We next show that any morphism and any folding from a pes to an event structure E factorises uniquely through the pes P(E) associated with E (categorically, φ E is cofree over E). This will be useful to relate foldings in E with foldings in P(E).
Lemma 28 (cofreeness of φ E ). Let E be an event structure, let P be a pes and let f : P → E be an event structure morphism. Then there exists a unique morphism g : Moreover, when f is a folding then so is g. We conclude that all foldings between event structures arise from foldings of the associated pess. Given that PES is a coreflective subcategory of ES and foldings can be seen as open maps, this result (and also the fact that morphisms φ E are foldings) can be derived from [16, Lemma 6]. The appendix gives more details on this point (and also reports a direct proof).

Foldings for Prime and Asymmetric Event Structures
In this section we study foldings on specific subclasses of poset event structures, providing suitable characterisations. Motivated by the fact that foldings on general poset event structures always arise from foldings of the corresponding canonical pess we first and mainly focus on pess. Then we discuss how this can be extended to asymmetric event structures (and only give a hint to flow and bundle event structures). We will see that while pess admit a least folding, the other classes of event structures do not.

Folding Prime Event Structures
Since foldings are special morphisms, we first provide a characterisation of pes morphisms.
Lemma 31 (pes morphisms). Let P and P be pess and let f : P → P be a function on the underlying sets of events. Then f is a morphism iff for all x, y ∈ P (y) and x = y then x#y and (b) if f (x)#f (y) then x#y.
These are the standard conditions characterising (total) pes morphisms (see, e.g., [31]), with the addition of condition (2b) that is imposed to ensure that configurations are mapped to isomorphic configurations, as required by the notion of (strong) morphism (Definition 13).
We know that not all pes morphisms are foldings. We next identify some additional conditions characterising those morphisms which are foldings.
Proposition 32 (pes foldings). Let P and P be pess and let f : P → P be a morphism. Then f is a folding if and only if it is surjective and for all X, Y ⊆ P, x, y ∈ P, y ∈ P The notion of folding on pess turns out to be closely related to that of abstraction homomorphism for pess introduced in [10] for similar purposes. More precisely, abstraction homomorphisms can be characterised as those pes morphisms additionally satisying condition (1) of Proposition 32, while they do not necessarily satisfy condition (2). Their more liberal definition is explained by the fact that they are designed to work on a subclass of structured pess (see Lemma D.2 in the Appendix).
We finally show what the conditions characterising foldings look like when transferred to equivalences.
Corollary 33 (folding equivalences for pess). Let P be a pes and let ≡ be an equivalence on P. Then ≡ is a folding equivalence in FEq(P) iff for all x, y ∈ P, if x ≡ y then For instance, in Fig. 2, consider the equivalence ≡ 01 over P 0 such that a 1 ≡ 01 a 2 . This produces P 1 as quotient. This is not a folding equivalence since condition (4) fails: a 1 # ∀ [b 2 ] ≡ 01 , but ¬(a 2 #b 2 ) and thus ¬([a 1 ] ≡ 01 # ∀ [b 2 ] ≡ 01 ). Instead, the equivalence ≡ 02 over P 0 such that a 1 ≡ 02 a 2 and b 1 ≡ 02 b 2 , producing P 2 as quotient, satisfies all five conditions. When pess are finite, the result above suggests a possible way of identifying foldings: one can pair candidate events to be folded on the basis of conditions (1)-(3) and then try to extend the sets with condition (4)-(5) when possible. The procedure can be inefficient due to the global flavor of the conditions. This will be further discussed in the conclusions.
We know from Proposition 21 that all event structures admit a "maximally folded" version. We next observe that the same result holds in the class of pess, i.e., that for each pes there is a uniquely determined minimal quotient.
Lemma 34 (joining foldings on pes's). Let P, P , P be pess and let f : P → P , f : P → P be foldings. Define E along with g : P → E and g : P → E as in Proposition 21. Then E is a pes.

Folding Asymmetric Event Structures
We know that foldings on all poset event structures arise from foldings on the corresponding canonical pess. Still, for theoretical purposes and for efficiency reasons, a direct approach, not requiring the generation of the associated pes, can be of interest. Here we explicitly discuss the case of asymmetric event structures. This generalises the results in [2] that identify conditions which are only sufficient and apply to a subclass of foldings (the so-called called elementary foldings, merging a single set of events). Note also that, despite the fact that in this paper we work in a slightly different framework, we continue to have that, as observed in [2], aess (and also fess) do not admit a unique minimal quotient in general.
We first characterise morphisms in the sense of Definition 13 on aess.

Lemma 36 (aes morphisms). Let A and A be aess and let f : A → A be a function on the underlying sets of events. Then f is a morphism if and only if for all x, y ∈
y. These are the standard conditions characterising (total) aes morphisms (see [5]), with the addition of (3b), needed in order to ensure that configurations are mapped to isomorphic configurations.

given H ∈ Hist(x), if ¬(H ∃ X), and H
there exists x 1 such that H 1 ∪ {x 1 } ∈ Hist(x 1 ) and ¬(x 1 ∃ X). We already observed that working in the class of aess we can obtain smaller quotients than in the class of pess (see, e.g., the hhp-bisimilar structures P 2 in Fig. 2 and A 0 in Fig. 4). However, not unexpectedly, the folding criteria for aess are less elegant and more complex than those for pess. In a practical use, the reference to histories could cause a loss of efficiency. Moreover, the uniqueness of the minimal quotient is lost. Consider for instance the aess in Fig. 6. It can be seen that h 01 : A 0 → A 1 is a folding where the events c 1 , caused by a and c 0 in conflict with a, are merged in a single event c 01 in asymmetric conflict with a. Similarly, h 02 : A 0 → A 2 is a folding obtained by merging c 0 and c 2 . These are two minimal foldings that do not admit a join in the class of aess. In fact, if we merge all three c-labelled events we obtain A 3 , and it is easy to see that the function h 03 : A 0 → A 3 is not a folding. In fact, consider {a, b} ∈ Conf (A 0 ). Then h 03 ({a, b}) = {a, b} c012 −−→, a transition that cannot be simulated in A 0 . Indeed, it can be seen that the join of h 01 and h 02 is the event structure E in Fig. 1(right), which cannot be represented as an aes.
In passing, we note that also in the class of fess the existence of minimal foldings is lost. In fact, consider Fig. 5. It can be easily seen that F 1 and F 2 are different minimal foldings of F 0 . In particular, merging the three d-labelled events as in F 3 modifies the behaviour. In fact, in F 3 , the event d 012 is not enabled in C = {a} since c ≺ d 012 and no event in C is in conflict with c. Instead, in F 0 , the event d 0 is clearly enabled from {a}.
Existence of a unique minimal folding could be possibly recovered by strengthening the notion of folding and, in particular, by requiring that foldings preserve and reflect histories. Note, however, that this would be against the spirit of our work where the notion of folding is not a choice. Rather, after having assumed hhp-bisimilarity as the reference behavioural equivalence, the notion of folding is essentially "determined" as a quotient (surjective function) that preserves the behaviour up to hhp-bisimilarity.

Conclusions
We studied the problem of minimisation for poset event structures, a class that encompasses many stable event structure models in the literature, taking hereditary history preserving bisimilarity as reference behavioural equivalence. We showed that a uniquely determined minimal quotient always exists for poset event structures and also in the subclass of prime event structures, while this is not the case for various models extending prime event structures. We showed that foldings between general poset event structures arise from foldings of corresponding canonical prime event structures. Finally, we provided a characterisation of foldings of prime event structures, and discussed how this could be generalised to other classes, developing explicitly the case of asymmetric event structures. As underlined throughout the paper, our theory of folding has many connections with the literature on event structures. The idea of "unfolding" more expressive models to prime algebraic domains and prime event structures has been studied by many authors (e.g., in [24,22,27,28,8]). The same can be said for the idea of refining a single action into a complex computation (see, e.g., [26] and references therein). Instead, the problem of minimisation of event structures has received less attention. We already commented on the relation with the notion of abstraction homomorphisms for pess [10], which captures the idea of behaviour preserving abstraction in a subclass of structured pess. In some cases, given a Petri net or an event structure a special transition system can be extracted, on which minimisation is performed. In particular, in [21] the authors propose an encoding of safe Petri nets into causal automata, in a way that preserves hp-bisimilarity. The causal automata can be transformed into a standard labelled transition system, which in turn can be minimised. However, in this way, the correspondence with the original events is lost.
The notion of behaviour preserving function has been given an elegant abstract characterisation in terms of open maps [16]. In the paper, we mentioned the possibility of viewing our foldings as open maps and we observed that various results admit a categorical interpretation. This gives clear indications of the possibility of providing a general abstract view of the results in this paper, something which represents an interesting topic of future research.
The characterisation of foldings on prime (and asymmetric) event structures can be used as a basis to develop, at least in the case of finite structures, an algorithm for the definition of behaviour preserving quotients. The fact that conditions for folding refer to sets of events might make the minimisation procedure very inefficient. Determining suitable heuristics for the identification of folding sets and investigating the possibility of having more "local" conditions characterising foldings are interesting directions of future development.
Although not explicitly discussed in the paper, considering elementary foldings, i.e., foldings that just merge a single set of events, one can indeed determine some more efficient folding rules. This is essentially what is done for aess and fess in [2]. However, restricting to elementary foldings is limitative, since it can be seen that general foldings cannot be always decomposed in terms of elementary ones (e.g., it can be seen that in Fig. 2, the folding f 02 : P 0 → P 2 cannot be obtained as the composition of elementary foldings).
When dealing with possibly infinite event structures one could work on some finitary representation and try to devise reduction rules acting on the representation and inducing foldings on the corresponding event structure. Observe that working, e.g., on finite safe Petri nets, the minimisation procedure would be necessarily incomplete, given that hhp-bisimilarity is known to be undecidable [17].

A Proofs for Section 2 (Event Structures and History Preserving Bisimilarity)
Lemma A.1 (properties of histories). Let E be an event structure. Then Conversely, assume that for all x ∈ C 1 we have that Moreover, for all y ∈ C 1 and x ∈ C 2 , if x ≤ C2 y then x ∈ C 2 [y]. Therefore, since by hypothesis C 1 [y] = C 2 [y], we have x ∈ C 1 and x ≤ C1 y, as desired. Therefore, C 1 C 2 . 3. Let H 1 , H 2 ∈ Hist(x) and assume that H 1 H 2 . This means that there exists C ∈ Conf (E) such that H 1 , H 2 ⊆ C. Therefore, by point (2), we have Lemma A.2 (configurations are reachable). Let E be an event structure and let C ∈ Conf (E) be a configuration. Then ∅ − → * C. More in detail, if x 1 , x 2 , . . . , x n is any linearisation of C compatible with ≤ C then, for all k ∈ {1, . . . , n}, {x 1 Proof. Immediate consequence of the prefix-closedness of the family of configurations. Proof. We rely on the characterisation of foldings provided in Lemma 17. Let C 1 ∈ Conf (E)

B Proofs for Section 3 (Foldings of Event Structures)
and assume that f (f (C 1 )) In turn, since f is a folding, Therefore f (f (x)) = x and f (f (C 2 )) = C 2 , as desired.
Lemma 17 (from morphisms to foldings). Let E and E be event structures and let f : E → E be a morphism. If for all C 1 ∈ Conf (E) and transition f (C 1 ) Proof. We have to show that R f = {(C, f |C , f (C)) | C ∈ Conf (E)} satisfies conditions (1) and (2)  Proof. Let f be a folding. In order to prove that f is a Pom-open map, assume to have a commuting square as in Definition B.2. Since C is a conflict-free prime event structures, its set of events, ordered by causality, which abusing the notation, we still denote by C is a configuration. Since c is a morphism c(C) ∈ Conf (E) and c(C) C, and thus f (c(C)) ∈ Conf (E ) and f (c(C)) C. Similarly, c (C ) ∈ Conf (E ) and c (C ) C . Finally observe that e(C) C . Thus c (e(C)) = f (c(C)) c (C ), meaning that f (c(C)) X − − → c (C ) for a suitable X . By definition of folding, there must be a transition c(C) X − → D such that f (D) = c (C ). Therefore, we can define c : C → E as follows: for all x ∈ C , let c (x ) be the unique y ∈ D such that f (y) = c (x ).
Conversely, assume that f is an Pom-open map. We show that f satisfies the condition of Lemma 17. Let C 1 ∈ Conf (E) and consider a transition f (C 1 ) x − → C 2 . If we view configurations C 1 , C 2 as pomsets, then we can build the following commuting square By the fact that f is open, we get the morphism c , and it is immediate to see that is the desired transition that completes the proof.

Lemma 19 (folding as equivalences). Let E, E be event structures and let
. It is well defined, since all elements in [x] ≡ f have the same f -image, and clearly injective. Moreover, it is also surjective. In fact, if x ∈ E then there exists C ∈ Conf (E ) such that x ∈ C . By Lemma A.2, configuration C is reachable from the empty one, and thus, since f is an hp-bisimulation, there exists C ∈ Conf (E) such that C = f (C). Therefore there is e ∈ C such that f (x) = x and thus g( Finally, observe that by definition, for all configuration C ∈ Conf (E /≡ f ), we have g(C ) C , hence we conclude. Lemma B.4 (factorising morphisms). Let E, E , E be event structures and let f : E → E be a morphism and h : E → E be a folding. Let g : E → E be a function such that f = g • h.
E E E g f h Then g is a morphism. Moreover, if f is a folding then g is.
Proof. Let us show that g is a morphism. For all C ∈ Conf (E), since h is a folding, there exists C ∈ Conf (E ) such that h(C ) = C and C C. Since f is a morphism f (C ) ∈ Conf (E ). Therefore g(C) = g(h(C )) = f (C ), as desired.
Let assume now that g is a folding. Let C 1 ∈ Conf (E) and suppose that there is a Proposition 21 (joining foldings). Let E, E , E be event structures and let f : Proof. We actually show that the construction described in the statement produces the pushout in the category ES and also in ES f . Consider the diagram Observe that E , with functions g and g is the pushout in Set, as it easily follows recalling that f and f are surjective. Another immediate observation is that the set of configurations of E can be written We prove that g is a folding. In fact Therefore g (C ) = g (f (C)) ∈ Conf (E ), by construction. Moreover, g is injective on C . In fact, take x , y ∈ C , with g (x ) = g (y ). Since C = f (C), there are x, y ∈ C such that f (x) = x and f (y) = y . Therefore, g (f (x)) = g (f (y)), and thus, by the properties of pushouts, f (x) = f (y). Since f is a folding, thus a morphism, this implies x = y and thus x = f (x) = f (y) = y , as desired.
g is a folding.
Let C 1 ∈ Conf (E ) and assume that f (C 1 ) x − − → D 2 . By (1) we know that there is D 2 ∈ Conf (E) such that D 2 = g (f (D 2 )) and D 2 D 2 . Therefore, there is D 1 D 2 such that f (g (D 1 )) = g (C 1 ) and Define And, using again the fact that f is a folding, this implies C 1 Now, we use the fact that f is a folding, and derive that In the same way, one concludes that also g is a folding.
Given any other E 1 with morphisms g 1 : E → E 1 and g 1 : E → E 1 such that g 1 • f = g 2 • f , we show that there exists a unique morphism h : E → E 1 that makes the diagram commute. Consider the unique map h : E → E 1 making the diagram commute in Set. Since g is a folding and g 1 is a morphism, by Lemma B.4, also h is a morphism. This proves that E is a pushout in ES.
By the same result, if g 1 is a folding, also the mediating morphism h is. This means that the same construction produces a pushout in ES f .
As a counterexample to the existence of pushouts in ES for general morphisms, consider the obvious mappings f 45 : P 4 → P 5 and f 46 : P 4 → P 6 in Fig. 7. Lemma B.5 (multi-colimit). Let E be an event structure. Each collection of foldings f i : E → E i with i ∈ I has a colimit in ES. Therefore the coslice category (E ↓ ES f ) has a terminal object.
Proof. When I is finite, the proof proceeds by straightforward induction on I, using Proposition 21. If instead I is infinite, let E be the colimit of the f i 's in Set.
The proof of the fact that the g i 's are foldings then proceeds as in Proposition 21. The only delicate point is the following.
, then it is not necessarily the case that f j (C) = f j (C ) for some j ∈ I. However, since configurations are finite, there is a finite subset J ⊆ I such that, if E J is the colimit of {f j | j ∈ J} and f J : E → E J the corresponding folding, whose existence is proved in the first part, then f J (C) = f J (C ). Exploiting this fact, we can conclude exactly as in Proposition 21.
Proposition 23 (lattice of foldings). Let E be an event structure. Then FEq(E) is a sublattice of the complete lattice of equivalence relations over E.
Proof. Immediate corollary of Lemma B.5. Lemma B.6 (hhp-bisimulation as an event structure). Let E , E be event structures and let R be a hhp-bisimulation between them. Then there exists a (prime) event structure E R and two foldings π : E R → E and π : E R → E .
Proof. Let E , E be event structures and let R be a hhp-bisimulation between them. Define E R as follows. Events are histories related by R, namely the triples { (H , f, H It is easy to see that Conf (E R ) is well-defined. Prefix-closedness of Conf (E R ) follows from the fact that R is downward-closed by definition of hhp-bisimulation. It can be seen that E R is actually a prime event structure, with causality defined by (H 1 , f 1 We can now define π : Then π and π are well-defined morphisms and they are foldings. We prove this for π (for π the proof is completely analogous).
π is a morphism. This is immediate by observing that for any configuration C f ∈ Conf (E R ), arising from the triple (C , f, C ) ∈ R, then we have π (C f ) = C . Note that, concerning the local order, for x , y ∈ C we have ( π is a folding. In fact, for any configuration Proposition 25 (foldings subsume behavioural quotients). Let E be an event structure and let f : E → E be a morphism such that E /≡ f is hhp-bisimilar to E. Then there exists a folding g : E → E such that ≡ g is coarser than ≡ f . Proof. Let R be a hhp-bisimulation between E and E /≡ f . Consider the event structure E R and the foldings π : E R → E and π : E R → E /≡ f , given by Lemma B.6. By Proposition 21 we can close the diagram as follows: In order to conclude that it is a folding we show that given D 1 ∈ Conf (P(E)), if By definition of transition (Definition 4), we have . Therefore, by Lemma A.1 (2), H x [y] ∈ D 1 . We thus conclude that and moreover φ E (D 2 ) C 2 . For the last statement, the only thing to observe is that the image of the causes of H x are exactly the causes of x. Indeed we have, for all H ∈ D 2 , say H ∈ Hist(y), that H H x iff y ∈ H x iff y ≤ C2 x, as desired.
Lemma 28 (cofreeness of φ E ). Let E be an event structure, let P be a pes and let f : P → E be an event structure morphism. Then there exists a unique morphism g : Moreover, when f is a folding then so is g.
Proof. The function g can be defined, for all x ∈ P as Note that this is a well-defined morphism. First observe that g(x ) ∈ Hist(E), hence it is an event in P(E). In fact, for all x ∈ P , since f is a morphism and x ∈ Conf (P ), Moreover, the reasoning above shows that g(x ) ∈ Hist(f (x )). Therefore, if g(x ) = g(y ) then f (x ) = f (y ). This fact, recalling that f is injective on configurations, implies that also g is. Finally, for all C ∈ Conf (P ), since f is a morphism, f (C ) ∈ Conf (E) and f (C ) C . Therefore its g-image is Hence, by Lemma B.7, g(C ) = hs(f (C )) ∈ Conf (P(E)) and hs(f (C )) C , as desired.
For the second part, assume that f is a folding and let us show that also g is. We use the characterisation in Lemma 17. Let C 1 ∈ Conf (P ) and assume that g(C 1 ) ). Since f is a folding, by Lemma 17, there exists a transition C 1 We only need to show that g(C 2 ) = D 2 . This is an immediate consequence of the fact that g(C 2 ) = g(C 1 ) ∪ {g(x )} = D 1 ∪ {H} = D 2 , as desired. Explicitly, let E, E be event structures, let f : E → E be a morphism and consider the commuting diagram

C Some Properties of Morphisms and Foldings
In this section, we define some relations between the events of an event structure, based on the way in which such events occur in configurations. They can be used to prove general properties of morphisms of event structures, that then can be instantiated on specific subclasses.
Definition C. 1 (precedence). Let E be an event structure. The precedence as the relation ⊆ E × E, defined for x, y ∈ E by x y if for all C ∈ Conf (E) such that x, y ∈ C it holds x < C y. We say that E has global precedence if for x, y ∈ E, if x, y ∈ C and x < C y then x y.
In words, x y whenever in each computation where x, y occur necessarily x occurs before y. The precedence relation is useful also to define a notion of semantic conflict. Observe that for any configuration C the precedences expressed by are always respected by ≤ C , i,.e., * C ⊆≤ C . When the event structure has global precedence, the precedence relation is sufficient to completely characterise the local order of configuration, i.e., for all configurations C it holds that < C = ( |C ) * .
Closely connected, we can introduce a notion of semantic conflict.
Definition C.2 (conflict). Let E be an event structure. The conflict is relation # ⊆ 2 E , defined for a finite X ⊆ E by #X if there is no C ∈ Conf (E) such that X ⊆ C. When {x, y} we often write x#y.
We observe that conflict and precedence are strictly related. In particular, binary conflict can be characterised in terms of precedence. Proposition C.3 (precedence vs conflict). Let E be an event structure. Then for X ⊆ E, if |X is cyclic then #X. for x, y ∈ E, we have x#y iff x ≺ y ≺ x.

Proof.
Let X ⊆ E. If |X is cyclic, i.e., there are x 1 , . . . , x n ∈ X such that x 1 x 2 . . . x n x 1 then the events x 1 , . . . , x n and thus X can never occur together in the same computation, i.e., there cannot be C ∈ Conf (E) such that X ⊆ C. In fact, otherwise, we should have * |C ⊆≤ C , contradicting the fact that ≤ C is a partial order. In words, each of the events x i should occur before the others, which is impossible. In particular, if x#y then x, y can never be in the same computation, hence trivially x ≺ y and y ≺ x, and observe that also the converse holds.
Otherwise, if C 1 = ∅, since for all y ∈ C 1 it holds that f (y) x , by condition (1), there exists some element x y ∈ P such that x y y and f (x y ) = x. Note that necessarily ¬(x y ≤ y), otherwise, by Lemma 31(2b) we would have x = f (x y ) ≤ f (y), which is not the case. Since C 1 is finite and consistent, an inductive argument based on condition (2), allows to derive the existence of x such that f (x) = x and (C 1 ∪ {x}). Moreover, as argued above for the x y s, it is not the case that x ≤ y for some y ∈ C 1 . Therefore there is a transition We argue that X = {x} and thus we conclude. In fact, assume that there is some x − →, all causes of x must be in f (C 1 ). Note that, since f is a morphism, by Lemma 31(2), we have x = f (x) = f ( x ). Therefore, there must exist z 1 ∈ C 1 such that f (z 1 ) = f (z). However, since z, z 1 ∈ C 1 ∪ ( x \ {x}) which is a configuration in Conf (P), and f is injective on configurations, we get z = z 1 ∈ C 1 , contradicting the hypothesis.
Proof. Let f be an abstraction homomorphism. We first prove conditions (1)-(3) of Lemma 31. The first condition is already in Definition D.1. Condition (2), is immediately implied by Definition D.1(2) Concerning condition (3), let x, y ∈ P such that f (x) = f (y) and x = y. Observe that we cannot have x < y, otherwise by Definition D.1(2), we would have f (x) < f (y). Dually, it cannot be y < x. Moreover, it cannot be x ∈ conc(y), otherwise Definition D.1(4) would be violated. Therefore, necessarily x#y. The validity of condition (3b) is proved analogously.
We finally show that f satisfies also condition (1) of Lemma 32. Let x ∈ P, y ∈ P such that ¬(f (x)#y ) and we show that ¬(x#y) for some y ∈ P such that f (y) = y . We distinguish various possibilities: If f (x) = y , we simply take y = x.
If y < f (x), by Definition D.1(2) there exists y ∈ P with y < x such that f (y) = y , and we conclude. If f (x) < y , by Definition D.1(3) there exists y ∈ P with x < y such that f (y) = y , and we conclude.
If none of the above holds, necessarily y ∈ conc(f (x))x, and thus by Definition D.1(4) there exists y ∈ P with y ∈ conc(x) such that f (y) = y , and we conclude. Conversely, let f be a pes morphism additionally satisying condition (1) of Lemma 32. We prove that conditions (1)-(4) of Definition D.1 hold. As above, the first conditions is already in Lemma 31. The second condition, namely f ( x)) = f (x)) immediately follows from Lemma 31(2), i.e, f ( x ) = f (x) . In fact, we only need to observe that for all y < x, f (y) = f (x), otherwise, by Lemma 31(3a) we would have x#y.
(⊇) Let y ∈ f (x) , i.e., f (x) < y . Then, for all y ∈ f −1 (y ), since f (x) < y = f (y), by Lemma 31(2a), there is z < y such that f (z) = f (x). Hence either z = x and thus x < y or z = x, hence, by Lemma 31(3a), x#z and thus x#y. It cannot be that x# ∀ f −1 (y ) , otherwise, by Lemma 32(1), we would have x#y, which is not the case. Therefore there must exists y ∈ f −1 (y ) such that x < y. Therefore y = f (y) ∈ f ( x ).
Take any y ∈ f −1 (y ) such that ¬(x#y). Now observe that it cannot be x < y or y < x, otherwise, by Lemma 31(2b) f (x) and y = f (y) would be ordered in the same way, contradicting y ∈ conc(f (x)). It cannot be x = y either, otherwise y = f (y) = f (x), again contradicting y ∈ conc(f (x)). Therefore, y ∈ conc(x) and thus y = f (y) ∈ f (conc(x)), as desired.
For instance, consider the pess P 7 and P 8 in Fig. 8. It can be seen that obvious function f 78 : P 7 → P 8 is an abstraction homomorphism but not a folding. Indeed, consider the configuration {b 0 , a 1 }. Then the step f 78 ({b 0 , a 1 }) c01 − − → {b 01 , a 01 , c 01 } cannot be simulated by {b 0 , a 1 }.
Corollary 33 (folding equivalences for pess). Let P be a pes and let ≡ be an equivalence on P. Then ≡ is a folding equivalence in FEq(P) iff for all x, y ∈ P, if x ≡ y then 1. λ(x) = λ(y); 2. Proof. Let P be a pess and let ≡ be a folding equivalence. This means that there exists a folding f : P → P such that ≡ and ≡ f coincide. By Lemma 19 we know that P /≡ f is isomorphic to P . Therefore using Lemma 31 and Proposition 32 we immediately get the validities of properties (1)- (5).
. Observe that P is a well-defined pes. A simple key observation is that Using (4), we can immediately inherit the partial order properties of ≤ and irreflexivity and hereditarity of # from the analogous properties of #.
If we define a function f : P → P as f (x) = [x] ≡ , it is now easy to show that it satisfies properties (1)-(3) in Lemma 31, and (1), (2) in Proposition 32, hence it is a folding and we conclude.
Lemma 34 (joining foldings on pes's). Let P, P , P be pess and let f : P → P , f : P → P be foldings. Define E along with g : P → E and g : P → E as in Proposition 21. Then E is a pes.
Proof. The result can be proved by using the fact that, by Lemma 28, PES f is a coreflective category of ES f , hence it is closed under pushout as proved in [13,Corollary 1].
Explicitly, the fact that Pr(g ) : P → P(E ) and P(g ) : P → P(E ) are foldings derive from Proposition 30. Now observe that, since In order to show that this actually provide a pushout in PES, consider two morphisms g 1 and g 2 as in the diagram below, such that g 1 • f = g 1 • f : Since E is a pushout and P(g ) • f = P(g ) • f , there is a unique morphism h : E → P(E ), making the diagram commute. Now, observe that φ E • h : E → E can be used in the diagram below as mediating morphisms: