Weak equivalence of higher-dimensional automata

This paper introduces a notion of equivalence for higher-dimensional automata, called weak equivalence. Weak equivalence focuses mainly on a traditional trace language and a new homology language, which captures the overall independence structure of an HDA. It is shown that weak equivalence is compatible with both the tensor product and the coproduct of HDAs and that, under certain conditions, HDAs may be reduced to weakly equivalent smaller ones by merging and collapsing cubes.


Higher-dimensional automata
A higher-dimensional automaton (HDA) is an automaton with a supplementary structure consisting of two-and higher-dimensional cubes linking its states and transitions. The underlying automaton of an HDA represents a concurrent system. An n-cube in an HDA indicates that the n actions starting at its origin are independent in the sense that they may be executed in any order, or even simultaneously, without any observable difference. The notion of higher-dimensional automaton goes back to Pratt [Pra91]. The concept used in this paper is essentially a generalization of the one defined by van Glabbeek [Gla06]. Our definition differs from the one of van Glabbeek in that we consider HDAs over concurrent alphabets and allow labels to be words (see Section 2.10).

Weak equivalence
The purpose of this paper is to introduce a concept of equivalence for higher-dimensional automata, called weak equivalence. The adjective weak is meant to emphasize that the structure two HDAs must have in common to be considered equivalent is reduced to a few essential features. More precisely, two HDAs must satisfy three conditions to be weakly equivalent. The first condition guarantees that two HDAs are not weakly equivalent if one of them has unreachable states but the other does not or if one has bad features such as deadlocks but the other does not.
The second requirement is that weakly equivalent HDAs must have the same trace language and the same fundamental monoid. These are defined along traditional lines as subsets of the trace monoid associated with the concurrent alphabet of the HDAs (see Section 4). Higher-dimensional automata with the same trace language behave the same with respect to safety properties that are compatible with the congruence relation induced by the independence relation of the concurrent alphabet.
The third and last condition for weak equivalence concerns primarily the higher-dimensional structure of HDAs. In [Kah18a], it has been shown that the cubical homology of an HDA can be equipped with a labeling. In Section 5, this labeling is used to define the homology language of an HDA, which reflects its global independence structure. Weakly equivalent HDAs are required to have the same homology language.

Weak implementation
Weak equivalence is the symmetric closure of a preorder, which we call weak implementation. The definition of this preorder is obtained from the one of weak equivalence essentially by replacing equalities by inclusions (see Section 6). Weak implementation is related to morphisms of HDAs in the following way: if A and B are two HDAs over the same concurrent alphabet and there exists a morphism from A to B that respects the concurrent alphabet and preserves unreachable and uncoreachable states, then A weakly implements B. This still holds for the more flexible cubical dimaps of HDAs, which have been introduced in [Kah18a]. Cubical dimaps permit one to compare HDAs of different atomicity levels, which is not possible with morphisms: if an HDA is constructed from another one by merging cubes and edge labels, then there will exist a cubical dimap but no morphism between the two HDAs. Cubical dimaps will be discussed in Section 3.

Parallel composition and nondeterministic sum
Higher-dimensional automata may be used in different ways to model concurrent systems. For HDAs modeling shared-variable systems, two categorical constructions are particularly important: the tensor product of HDAs, which models the parallel composition of independent concurrent systems, and the coproduct of HDAs, which corresponds to the nondeterministic sum of concurrent systems. We show that the relations of weak equivalence and weak implementation are compatible with the tensor product and, for coaccessible HDAs, with the coproduct (see Section 6.3).

Reduction of HDAs
In view of the state explosion problem, it is desirable to be able to reduce HDAs to weakly equivalent smaller ones. In [Kah16], conditions have been established under which a so-called topological abstraction of an HDA can be constructed by collapsing and merging cubes. Since the relation of topological abstraction is normally stronger than weak equivalence, it is possible to adapt the results of [Kah16] to obtain reduction operations that yield weakly equivalent HDAs. This is done in Sections 6.5 and 6.6.

Background and related work
Higher-dimensional automata have been devised by Pratt and van Glabbeek (see [Pra91,Gla06]). A bibliography on HDAs can be found in [Gla06]. Descriptions of how HDAs can be used to model concurrent systems are contained in [FGH + 16, Gau08, Gla06, GM12, Kah19]. This paper adopts Winskel and Nielsen's categorical perspective on models for concurrency, according to which the morphisms in a category of objects modeling concurrent systems represent simulations and categorical constructions correspond to composition operators [WN95]. From this point of view, weak equivalence is coarser than a kind of simulation equivalence. As we note in Remark 6.3.4, this does not remain true for history-preserving bisimilarity in the sense of [Gla06]. A categorical theory of bisimulation, which may be used to define a notion of bisimilarity that is stronger than weak equivalence, is developed in [JNW96]. A comparison of different approaches to simulation is provided in [LV95].
Weak implementation may be considered a coarse precongruence in the spirit of [Gla10]. The main properties preserved by weak implementation and weak equivalence are the trace language and the homology language. The trace language fits within the framework of Mazurkiewicz trace theory. The fundamental material on this subject is contained in [AR88,Die90,DM97,DM11,Maz87,Maz95]. The definition of the homology language is based on concepts from algebraic topology. Two of the many textbooks in this area are [Dol80,Hat01].
The existence of connections between concurrency theory and algebraic topology is at the origin of the field of directed algebraic topology [FGH + 16, Gra09]. Since the homology language is invariant under cubical dimaps that are homotopy equivalences (see Proposition 5.7.2), it may be considered a directed homotopy invariant of HDAs. However, since it depends on the labeling structure of HDAs rather than on their directed topology, it is not a concept of directed homology as those considered in the literature (see, e.g., [Gra09,Kah14a] Our results on the reduction of HDAs are inspired by but not directly related to work on partial order reduction [God96,Pel93] and discrete Morse theory [For98].

Higher-dimensional automata
This section presents basic material on precubical sets, concurrent alphabets, and higher-dimensional automata. The definition of higher-dimensional automata is essentially the one of van Glabbeek [Gla06], with the difference that we consider HDAs over concurrent alphabets and allow labels to be words. It is not our intention to provide a comprehensive introduction to the material of this section. For more details, explanations, and examples, the reader is referred to, e.g., [Die90, Maz87, FGH + 16, Gla06].

Precubical sets
A precubical set is a graded set P = (P n ) n≥0 with boundary or face operators d k i : P n → P n−1 (n > 0, k ∈ {0, 1}, i ∈ {1, . . . , n}) satisfying the relations d k . If x ∈ P n , we say that x is of degree or dimension n. The elements of degree n are called the n-cubes of P . The elements of degree 0 are also called the vertices of P , and the 1-cubes are also called the edges of P . A face d k i x is called a front face of x if k = 0 and a back face of x if k = 1. A precubical subset of a precubical set P is a graded subset of P that is stable under the boundary operators. A morphism of precubical sets is a morphism of graded sets that is compatible with the boundary operators.

Tensor product of precubical sets
The tensor product of two graded sets P and Q is the graded set P ⊗ Q given by If P and Q are precubical sets, then P ⊗Q is a precubical set. For an n-cube (x, y) ∈ P p ×Q q (p+q = n), the boundary operators are defined by With respect to this tensor product, the category Set op is a monoidal category.

Precubical cubes
The precubical n-cube is the n-fold tensor product ❲0, 1❳ ⊗n . Here, we use the convention that ❲0, 1❳ ⊗0 is the precubical set ❲0, 0❳ = {0}. The only element of degree n in ❲0, 1❳ ⊗n will be denoted by ι n . We thus have ι 0 = 0 and ι n = ([0, 1], . . . , [0, 1] n times ) for n > 0. Given an element x of degree n of a precubical set P , there exists a unique morphism of precubical sets ❲0, 1❳ ⊗n → P that sends ι n to x. This morphism will be denoted by x . We say that x is regular if x is injective and that x is weakly regular if the restrictions of x to the graded subsets (❲0, 1❳ \ {1}) ⊗n and (❲0, 1❳ \ {0}) ⊗n of ❲0, 1❳ ⊗n are injective. If all elements of P are (weakly) regular, we say that P is (weakly) regular.

Paths
A path of length l (l ≥ 0) from a vertex v of a precubical set P to a vertex w is a morphism of precubical sets ω : ❲0, l❳ → P such that ω(0) = v and ω(l) = w. If ω is a path of length l, we write L ω = l. The set of paths in P is denoted by P I . The concatenation ω · ν of two paths ω : ❲0, k❳ → P and ν : ❲0, l❳ → P with ω(k) = ν(0) is defined in the obvious way. Note that every path in P of positive length can be uniquely written as a finite concatenation of paths of the form x where x ∈ P 1 .

Dihomotopy
Two paths ω and ν in a precubical set P are said to be elementarily dihomotopic if there exist paths α, β ∈ P I and an element z ∈ P 2 such that d 0 The dihomotopy relation, denoted by ∼, is the equivalence relation generated by elementary dihomotopy [FGH + 16] (see Figure 1 for a picture).

Free monoids
Let Σ be an alphabet, i.e., a set. The free monoid over Σ will be denoted by Σ * . The unit element of Σ * , which is the empty word, will be denoted by 1. Given a string m ∈ Σ * , we will write |m| to denote its length, i.e., the unique integer n such that m ∈ Σ n . We say that a string m ∈ Σ * contains an element

Concurrent alphabets
A concurrent alphabet is a pair (Σ, D) where Σ is an alphabet and D is a reflexive and symmetric relation on Σ (see, e.g., [Die90,Maz95]). The relation D is called the dependence relation of the concurrent alphabet, and the complement of D is called the associated independence relation. A morphism of concurrent The category of concurrent alphabets is a symmetric monoidal category with respect to the tensor product defined by (Σ 1 , D 1 ) ⊗ (Σ 2 , D 2 ) = (Σ 1 Σ 2 , D ⊗ ) where D ⊗ is the union of the images of the canonical maps The tensor product is different from the coproduct (Σ 1 , D 1 ) (Σ 2 , D 2 ), which is the concurrent alphabet (Σ 1 Σ 2 , D ) where D is the union of D ⊗ and the subsets Σ 1 ×Σ 2 and Σ 2 ×Σ 1 of (Σ 1 Σ 2 )×(Σ 1 Σ 2 ). While an element of Σ 1 and an element of Σ 2 are independent in the tensor product, they are dependent in the coproduct.

Higher-dimensional automata
A higher-dimensional automaton (over a concurrent alphabet) is a tuple where P A is a precubical set, I A ∈ (P A ) 0 is an initial state, F A ⊆ (P A ) 0 is a (possibly empty) set of final states, (Σ A , D A ) is a concurrent alphabet, and λ A : (P A ) 1 → Σ * A is a labeling function. These data are subject to the following two conditions: (2) For all We say that an HDA B is a sub-HDA of an HDA A and write B ⊆ A if P B is a precubical subset of An HDA A is said to be (weakly) regular if the precubical set P A is (weakly) regular. A morphism from an HDA A to an HDA B is a pair (f, σ) consisting of a morphism of precubical sets f : P A → P B and a morphism of concurrent alphabets σ : Our definition of higher-dimensional automata differs in two points from the one of van Glabbeek [Gla06]: first, we consider HDAs over concurrent alphabets, and second, we allow labels to be words. Condition (2) above is introduced in the definition of HDAs to guarantee that the independence relation represented by the cubes of an HDA is compatible with the one associated with the concurrent alphabet. An HDA in the sense of [Gla06] can be seen as an HDA in our sense, at least if it does not admit squares where all edges have the same label. Indeed, given such an HDA, one can define a canonical dependence relation on the alphabet by declaring two actions dependent if there is no square having both of them on its boundary. Condition (2) is then automatically satisfied. We allow labels to be words in order to be able to declare sequences of actions atomic. Another possibility opened up by this modification of van Glabbeek's definition of HDAs is to use the unit of the free monoid on the alphabet to label invisible actions.

Labels of paths
Let A be an HDA. The extended labeling function of A is the map λ A : P I A → Σ * A defined as follows: If ω = x 1 · · · · · x k for a sequence (x 1 , . . . , x k ) of elements of (P A ) 1 such that d 0 if ω is a path of length 0, then we set λ A (ω) = 1. By conditions (1) and (2) in the definition of HDAs, dihomotopic paths have congruent labels.

Tensor product of HDAs
The tensor product of two HDAs A and B is the HDA A ⊗ B defined by P A⊗B = P A ⊗ P B , With respect to this tensor product, the category of HDAs is a (nonsymmetric) monoidal category. The tensor product of HDAs models the parallel composition of independent concurrent systems (for a detailed discussion, see [Kah19]).

Coproduct of HDAs
The coproduct of two HDAs A and B is the HDA A + B where P A+B is the precubical subset The coproduct of HDAs models the nondeterministic sum of concurrent systems, i.e., the combined system where initially one of the constituent systems is chosen nondeterministically (for more details, see [Kah19]).

Cubical dimaps
In their categorical approach to models of concurrency, Winskel and Nielsen [WN95] emphasize the importance of the morphisms in a category of objects modeling concurrent systems as a means to express relationships between systems. Unfortunately, the morphisms of HDAs defined in the previous section are too rigid for this purpose in at least two respects. First, they do not permit one to relate HDAs of different atomicity levels. For example, although the HDAs • a − → • b − → • and • ab − → • clearly model the same system, there does not exist any morphism between them. Second, there is normally no morphism and, in particular, no isomorphism between the tensor products A ⊗ B and B ⊗ A. This is inconsistent with the fact that the tensor product of HDAs models the parallel composition of independent systems, which is a symmetric operation. In order to address these problems, cubical dimaps (directed maps) have been introduced in [Kah18a]. Roughly speaking, a cubical dimap between two HDAs is a continuous map between their geometric realizations that sends cubes in an order-preserving way to subdivided cubes and that preserves labels of paths. There exists a cubical dimap from , and the category of HDAs and cubical dimaps is a symmetric monoidal category. In this section, we collect the main facts about cubical dimaps. More details can be found in [Kah18a]. All topological spaces considered are compactly generated Hausdorff spaces, and constructions such as products are performed in the category of these spaces (see [Ste67]).

Geometric realization
The geometric realization of a precubical set P is the quotient space where the sets P n are given the discrete topology and the equivalence relation is generated by The geometric realization of a morphism of precubical sets f : P → Q is the continuous map The geometric realization of a precubical set P is a CW complex. The n-skeleton of |P | is the geometric realization of the precubical subset P ≤n of P defined by (P ≤n ) i = P i for i ≤ n and (P ≤n ) i = ∅ for i > n. The geometric realization of the precubical interval ❲k, l❳ may be identified with the closed interval permits us to identify the spaces |P ⊗ Q| and |P | × |Q|.

Cubical dimaps of precubical sets
An elementary cubical dimap from a precubical set P to a precubical set Q is a continuous map f : |P | → |Q| such that the following two conditions hold: (1) For every vertex x ∈ P 0 , there exists a (necessarily unique) vertex y ∈ Q 0 such that f ([x, ()]) = [y, ()].
(2) For every element x ∈ P n (n > 0), there exist integers l 1 , . . . , l n ≥ 1, a morphism of precubical sets χ : n i=1 ❲0, l i ❳ → Q, a permutation θ ∈ S n , and increasing homeomorphisms φ i : [0, 1] → [0, l i ] (i ∈ {1, . . . , n}) such that the following diagram, in which t θ is given by t θ (x 1 , . . . , x n ) = (x θ(1) , . . . , x θ(n) ), is commutative: to the precubical set composed of two squares a and b such that d 1 1 a = d 0 2 b. By construction, a cubical dimap is a cellular map. It is clear that condition (1) above holds for arbitrary cubical dimaps and not only for elementary ones. Therefore a cubical dimap f : The geometric realization of a morphism of precubical sets is an elementary cubical dimap. Hence the presheaf category of precubical sets can be seen as a wide subcategory of the category of precubical sets and cubical dimaps. Another important class of cubical dimaps is given by subdivisions in the sense of [Kah14b]: A subdivision of a precubical set P consists of a precubical set Q and a homeomorphism |P | → |Q| that is an elementary cubical dimap such that the permutation in condition (2) of the definition is always the identity. In this situation we may, of course, also view P as obtained from Q by merging cubes.
The category of precubical sets and cubical dimaps is a symmetric monoidal category with respect to the usual tensor product of precubical sets. The tensor product of two cubical dimaps f : |P | → |P | and g : |Q| → |Q | is the composite which is indeed a cubical dimap. The braiding of the symmetric monoidal structure is the homeomorphism which is an elementary cubical dimap.

Cubical dimaps and paths
Let f : |P | → |Q| be a cubical dimap of precubical sets, and let ω : ❲0, k❳ → P be a path. By [Kah18a, Prop. 6.5.1], there exist a unique integer l, a unique path f I (ω) : ❲0, l❳ → Q, and a unique increasing homeomorphism φ : [0, k] → [0, l] such that the following diagram commutes: Note also that if f is the geometric realization of a morphism of precubical sets h : P → Q, then f I (ω) = h • ω. By adapting the arguments given in [Kah14b] in the context of weak morphisms, it is easily seen that the construction of f I (ω) is compatible with composition of cubical dimaps, concatenation of paths, and dihomotopy.

Cubical dimaps of HDAs
An elementary cubical dimap from an HDA A to an HDA B is a pair (f, σ) consisting of an elementary cubical dimap f : |P A | → |P B | and a morphism of concurrent alphabets σ : is a morphism of HDAs, then its geometric realization (|g|, σ) is an elementary cubical dimap from A to B. A cubical dimap of HDAs is a finite componentwise composite of elementary cubical dimaps. Note that if (f, σ) is a cubical dimap of HDAs, then f is a cubical dimap of precubical sets and the above conditions for elementary cubical dimaps hold.
The coproduct of HDAs is the coproduct in the category of HDAs and cubical dimaps. The tensor product of HDAs turns this category into a symmetric monoidal category. The tensor product of cubical dimaps and the natural isomorphisms of the symmetric monoidal structure are defined componentwise.

The trace language of an HDA
The trace language of an HDA, which is defined in this section, describes its possible finite behavior. It contains the information necessary to decide whether an HDA satisfies a given saturated safety property, i.e., a safety property that is compatible with the congruence relation of the concurrent alphabet of the HDA. In addition to the trace language of an HDA, we define its fundamental monoid. We show that the trace language and the fundamental monoid behave well with respect to cubical dimaps and establish formulas to compute them for tensor products and coproducts. The trace language of an HDA is a trace language in the sense of Mazurkiewicz

Saturated safety properties
Let Σ be an alphabet. Following van Glabbeek [Gla10], we say that a safety property is given by a set B ⊆ Σ * . An HDA A with Σ A = Σ satisfies this safety property, A |= safety(B), when for every Note that since we allow labels to be words, it is not enough to require λ A (ω) / ∈ B. Note also that B and BΣ * define the same safety property: for any HDA A with Σ A = Σ, A |= safety(B) ⇔ A |= safety(BΣ * ). If (Σ, D) is a concurrent alphabet, a safety property given by a subset B ⊆ Σ * is called saturated if for any two congruent elements m, m ∈ Σ * , m ∈ BΣ * ⇔ m ∈ BΣ * .

Prefixes
Let M be a monoid. We say that an element v ∈ M is a prefix of an element u ∈ M and write v u if there exists an element w ∈ M such that u = vw. The relation is a preorder on M . If M is free or a trace monoid, then is a partial order.

Trace language
The trace language of an HDA A is the set Note that although we use the same notation, T L(A) is different from the trace language defined in [Kah14b]. By the next two propositions, the trace language contains exactly the information needed to determine which saturated safety properties are satisfied by an HDA.
This is a saturated safety property. Indeed, let m ∈ BΣ * and m ≡ m. Then there exists an element On the other hand, B |= safety(B). Indeed, if this was not the case, there would exist a path ν ∈ P I B such that and therefore v ∈ T L(B), which is not the case. Proof: Consider an element v ∈ T L(A). Let ω ∈ P I A be a path such that

The trace language of a tensor product
Write α = x 1 · · · x k and β = y 1 · · · y l where the elements x i and y i are of degree ≤ 1.
Let ω be the path in A ⊗ B defined by For the reverse inclusion, consider an element We show that a ∈ T L(A) and b ∈ T L(B). Write ω = (x 1 , y 1 ) · · · (x n , y n ) , and consider the paths α ∈ P I A and β ∈ P I B given by α = x 1 · · · x n and β = y 1 · · · y n . Since all elements of

Fundamental monoid
The fundamental monoid of an HDA A is the submonoid π(A) of M (Σ A , D A ) defined by The term reflects an analogy with the fundamental group of a topological space. Given a cubical dimap can be decomposed as a concatenation where the α i are loops in A with α i (0) = I A and the β i are loops in B with β i (0) = I B . Therefore It follows that (π(|j A |,σ A ),π(|j B |,σ B )) is surjective.  For the reverse inclusion, consider an element v ∈ T L(A + B). Let ω ∈ P I A+B be a path of minimal length such that ω(0) = I A+B and [λ A+B (ω)] = vw for some element w ∈ M (Σ A+B , D A+B ). We may assume that ω does not lie entirely in A or B, because in that case we would have either v ∈ T L(A) or v ∈ T L(B) and there would be nothing to prove. We may further suppose that the last edge of ω is an edge of A and leave the analogous case where it is an edge of B to the reader. Decompose ω as a concatenation ω = α 1 · β 1 · · · α r · β r · γ where the α i are loops in A with α i (0) = I A , the β i are loops in B with β i (0) = I B , γ is a path in A with γ(0) = I A , and all paths except possibly α 1 have positive length. Set l 1 = L α1·β1···αr·βr and l 2 = L γ . Then |v| > l 1 . Indeed, otherwise we would have w = yz for some elements y, z ∈ M (Σ A+B , D A+B ) such that |y| = l 1 − |v| and |z| = l 2 . Moreover, we would have

The trace language of a coproduct
Since congruence classes of elements of Σ A do not commute with congruence classes of elements of which would contradict the minimality of ω. So |v| > l 1 . Hence there exist elements

The homology language of an HDA
A higher-dimensional automaton is an ordinary automaton with information on independence of actions. We have used the independence relation associated with the concurrent alphabet of an HDA, and the induced congruence relation, to define its trace language and its fundamental monoid. The higherdimensional structure of an HDA contains further information on independence. An overall picture of the independence structure of an HDA is given by its labeled homology, as introduced in [Kah18a]. Here, we use the labeling on the homology of an HDA to define its homology language. As in the case of the trace language and the fundamental monoid, we show that the homology language is compatible with cubical dimaps and establish formulas to compute it for tensor products and coproducts. We also give examples of how the homology language of an HDA can be used to reason about the independence of subsystems or components of a concurrent system. We work over a fixed principal ideal domain, which we suppress from the notation.

Chain complexes and homology
A chain complex is a graded module C = (C n ) n≥0 with boundary operators d : C n → C n−1 (n ≥ 1) satisfying d • d = 0. A chain map between two chain complexes is a morphism of graded modules that commutes with the boundary operators. The homology of a chain complex C is the graded module H * (C) = (H n (C)) n≥0 defined by H 0 (C) = C 0 /im(d : C 1 → C 0 ) and H n (C) = ker(d : C n → C n−1 )/im(d : C n+1 → C n ) (n ≥ 1).
A The direct sum of two chain complexes is the direct sum of the underlying graded modules, with boundary operators defined componentwise. The homology functor preserves direct sums. The tensor product of two graded modules A and B is the graded module A ⊗ B defined by The tensor product of two chain complexes C and D is the tensor product of the underlying graded modules with the boundary operators given by Over a field, the homology functor is compatible with tensor products. For the general case and further results in homological algebra, see, e.g., [Dol80,Hat01].

Cubical chains and cubical homology
Let P be a precubical set. The cubical chain complex of P is the chain complex C * (P ) where C n (P ) is the free module generated by P n and the boundary operator d : C n (P ) → C n−1 (P ) is given by The chain map induced by a morphism of precubical sets is defined in the obvious way. The cubical homology of P , denoted by H * (P ), is the homology of C * (P ). The cubical chain complex C * (P ) is naturally isomorphic to the cellular chain complex of |P | (cf. [Kah18a, Thm. 3.3.1]). Since a cubical dimap of precubical sets is a cellular map, it follows that the functors C * and H * extend to the category of precubical sets and cubical dimaps and, moreover, that a cubical dimap which is a homotopy equivalence induces an isomorphism in cubical homology. An explicit description of the chain map induced by an elementary cubical dimap is given in [Kah18a, Prop. 7.4.1].
Example 5.2.1. Throughout this section, we will consider the example HDA A where (P a 2 ), (a 2 , a 1 )}, and λ A (x i ) = a i (i ∈ {1, 2, 3}). We suppose, of course, that the x i and the a i are pairwise different. Geometrically, A is a wedge (one-point union) of a torus and a circle. By definition of the cubical chain complex, C 0 (P A ) is the free module generated by I A , C 1 (P A ) is the free module generated by the x i , C 2 (P A ) is the free module generated by y, and all other C n (P A ) are 0. Since d 0 i y, all boundary operators of C * (P A ) are 0. Hence H * (P A ) has 1 generator in degrees 0 and 2 and 3 generators in degree 1. As this example illustrates, homology may be seen as an algebraic tool to count holes in geometric objects such as precubical sets or topological spaces.

The edge e i x
Let x be an element of degree n > 0 of a precubical set P , and let i ∈ {1, . . . , n}. We define the ith starting edge of x to be the element e i x ∈ P 1 given by The edge e i x leads from the initial vertex of x to the initial vertex of the face d 1 i x, i.e., we have d 0 An illustration is given in Figure 2.

Strings
Let Σ be an alphabet. Given a string m of length n ≥ 1, we will write m 1 , . . . , m n to denote the uniquely determined elements of Σ such that m = m 1 · · · m n .

Labeling chain map
Let A be an HDA. Consider the exterior algebra on the free module generated by Σ A , Λ(Σ A ). Recall that this is the quotient of the tensor algebra on the free module on Σ A by the two-sided ideal generated by all elements of the form x ⊗ x where x ∈ Σ A (see [Bou74] for more details). The exterior algebra Λ(Σ A ) is canonically graded by the exterior powers of the free module generated by Σ A . We view the graded module Λ(Σ A ) as a chain complex with d = 0 and define the labeling chain map on basis elements x ∈ (P A ) n by By [Kah18a,Prop. 4.4.5], the labeling chain map is indeed a chain map, i.e, we have l A (dx) = dl A (x) = 0 for all x ∈ C * (P A ).
Example 5.5.1. Consider the HDA A of Example 5.2.1. The exterior algebra Λ(Σ A ) is the graded module freely generated by 1 Λ(Σ A ) in degree 0, a 1 , a 2 , and a 3 in degree 1, a 1 ∧ a 2 , a 1 ∧ a 3 , and a 2 ∧ a 3 in deegre 2, and a 1 ∧ a 2 ∧ a 3 in degree 3. In degrees ≥ 4, Λ(Σ A ) is 0. We have e 1 x i = x i , e 1 y = d 0 2 y = x 1 , and e 2 y = d 0 1 y = x 2 . Hence the labeling chain map of A is given by l A (I A ) = 1 Λ(Σ A ) , l A (x 1 ) = a 1 , l A (x 2 ) = a 2 , l A (x 3 ) = a 3 , and l A (y) = a 1 ∧ a 2 . Proof: We may suppose that (f, σ) is an elementary cubical dimap of HDAs. Consider the HDA C given by P C = P A , Then (f, σ) decomposes as the composite of elementary cubical dimaps of HDAs We have l C = Λ(σ) • l A and, by [Kah18a,Thm. 7

Labeled homology
Let A be an HDA. The labeling chain map l A induces a morphism of graded modules

The homology language
We define the homology language of an HDA A to be the graded module Thus, by definition, the homology language of an HDA can be read off its labeled homology.
Example 5.7.1. The homology language of the HDA A of Examples 5.2.1, 5.5.1, and 5.6.1 is the graded submodule of Λ(Σ A ) generated by the unit and the elements a 1 , a 2 , a 3 , and a 1 ∧ a 2 . Proof: This follows from Proposition 5.6.2 and the fact that a homotopy equivalence induces an isomorphism in homology.

The homology language of a tensor product
Let A and B be two HDAs. We view HL(A) and HL(B) as graded submodules of the exterior algebra Λ(Σ A⊗B ) = Λ(Σ A Σ B ). Proof: Consider the homology cross product i.e., the composite ζ * • κ where κ is the homomorphism of graded modules and ζ is the isomorphism of chain complexes C * (P A ) ⊗ C * (P B ) → C * (P A ⊗ P B ) given by By [Kah18a, Thm. 5.3.2], we have the following commutative diagram of graded modules: By the Künneth theorem, there exists a graded torsion module U ⊆ H * (P A ⊗ P B ) such that Since Λ(Σ A⊗B ) is a free module, A⊗B (U ) = 0. Hence

The homology language of a coproduct
Let A and B be two HDAs. We view HL(A) and HL(B) as graded submodules of the exterior algebra Λ(Σ A+B ) = Λ(Σ A Σ B ). Consider the morphisms of precubical sets I → I A and I → I B from a precubical set with one vertex I to P A and P B , respectively. Then we have the following push out of precubical sets: Applying cubical chains to this push out, we obtain a push out of chain complexes, which yields a short exact sequence The induced long exact sequence in homology shows that the upper map in the following commutative diagram of graded modules is surjective: Hence

Independence
Let A be an HDA, and let A 1 , . . . , A n (n ≥ 2) be HDAs with disjoint alphabets, each contained in Σ A . We say that the A i are independent in A if there exist a sub-HDA B ⊆ A and an isomorphism (f, σ) : A 1 ⊗ · · · ⊗ A n → B in the category of HDAs and cubical dimaps such that Σ B = n i=1 Σ Ai and σ is induced by the inclusions Σ Ai → Σ B . Since Σ Ai ⊆ Σ B ⊆ Σ A , we may view HL(A i ) and HL(B) as graded submodules of both Λ(Σ B ) and Λ(Σ A ).  (ii) A small grocery store has three shopping baskets and two checkout counters. All customers behave the same: • They wait until a basket is available and then start shopping.
• Once they have selected the products they wish to buy, they move to the checkouts and wait for their turn to pay. Since they are usually very polite and give others priority, the order in which they pay is unpredictable-even if there is a queue.
• Having paid, they return the basket and leave the store.
• If they forgot to buy something, they repeat the procedure from the beginning.
Focusing on the behavior of the customers with respect to the shared resources-the baskets and the checkouts-we may describe the shopping protocol as the program graph (in the sense of [BK08]) depicted in Figure 3. The actions modify two integer variables x and y counting the available shopping baskets and the free checkouts, respectively. They are defined as follows: • basket: Wait until x > 0, and then decrement x.
• leave: Increment both y and x.
If we view x and y as semaphores and consider Dijkstra's P and V operations (see, e.g., [Dij68]), then basket = P(x), checkout = P(y), and leave = V(y); V(x).
Let us now consider a system of four customers executing the above protocol, and let us suppose that initially all shopping baskets and both checkout counters are free, i.e., x = 3 and y = 2. Assuming atomicity of the actions of the program graph, we may use the method of [Kah19], implemented in the tool pg2hda [Kah18b], to construct an HDA A modeling the state space of the system. We do not need to know A in detail. Let us just mention that it is a 3-dimensional HDA with 563 cubes altogether and that its alphabet is the set The indexes of the labels are introduced to distinguish the four customers.
The homology language of A with Z 2 -coefficients can be computed from A with the aid of the software CHomP [Pil18]. It is clear that HL(A) is generated by the unit of Λ(Σ A ) in degree 0. In degree 1, HL(A) is generated by the elements Each of these elements represents one of the customer processes executing alone. In degree 2, HL(A) is generated by the products In view of Proposition 5.10.1, this indicates that any two customers are independent and can proceed simultaneously without conflict if the other customers do nothing (or just talk). Since there are two checkouts, this is, of course, to be expected. Since there are no more than two checkouts, one would certainly also expect that no three customer processes are independent, despite the fact that there are three shopping baskets. And indeed, although A has cubes of dimension 3, HL(A) is trivial in degrees ≥ 3. We conclude that any two but no three customers are independent. Note that our analysis of the independence structure of A has been carried out at the level of the homology language, without explicit mention of HDAs representing the customer processes. Note also that the homology language would have been the same for a store with only two baskets.
As this example shows, the homology language does not necessarily uncover surprising features of concurrent systems. Arguably, however, it encodes fundamental information on independence in HDAs.

Weak equivalence
As pointed out in the introduction, weak equivalence is a coarse notion of equivalence for HDAs that focuses on a small number of fundamental features. Besides the trace language, the fundamental monoid, and the homology language, these are accessibility and coaccessibility. Weak equivalence is defined as the symmetric closure of a preorder called weak implementation. We show that both relations are compatible with the tensor product and, at least in the coaccessible case, the coproduct of HDAs. We also relate weak equivalence to the preorder of topological abstraction introduced in [Kah16] and adapt the results of that paper to provide conditions under which HDAs can be reduced to weakly equivalent smaller ones by collapsing and merging cubes.

Accessible HDAs
A state x of an HDA A is called reachable if there exists a path in A from I A to x. An HDA is called accessible if all states are reachable. The proof of the following elementary fact is left to the reader:

Coaccessible HDAs
A state x is called coreachable if there exists a path from x to a final state. An HDA is called coaccessible if all states are coreachable. Coaccessibility guarantees the absence of very bad phenomena such as deadlocks. We omit the easy proof of the following proposition:

Weak implementation and weak equivalence
We say that an HDA A weakly implements an HDA B and write A B if the following three conditions are satisfied: 1. If B is accessible, then so is A. If B is coaccessible, then so is A.

HL(A) ⊆ HL(B).
It is clear that weak implementation is a preorder on the class of HDAs. We say that two HDAs A and B are weakly equivalent and write A B if A B and B A. Remarks 6.3.4. (i) Weak equivalence has been designed to be a coarse congruence for the tensor product and (as far as possible) the coproduct such that the trace language and the homology language are invariants. In certain situations, it might be convenient to modify the definition of weak equivalence. For instance, if the compatibility with the coproduct is not considered essential, the requirement on the fundamental monoid may be dropped. Another possible modification concerns accessibility. According to our definition, an HDA with unreachable states cannot be weakly equivalent to its accessible part. This is adequate if unreachable states are interpreted as representing problems such as dead code (see, e.g., [FGH + 16, p. 22]). However, one might as well see unreachable states as just unreachable from the chosen initial state and prefer to define an equivalence where an HDA is always equivalent to its accessible part. To do so, one could define two HDAs to be equivalent if their accessible parts are weakly equivalent in the sense of this paper. For accessible HDAs, this concept of equivalence would coincide with the concept of weak equivalence proposed here.
(ii) By Proposition 6.3.1, two HDAs over the same concurrent alphabet are weakly equivalent if there exist well-behaved cubical dimaps between them in both directions. Just as morphisms of HDAs, cubical dimaps may be seen as simulations, and so, from this point of view, weak equivalence is coarser than a kind of simulation equivalence. It should be pointed out in this context that HDAs that are history-preserving bisimilar in the sense of [Gla06] need not be weakly equivalent. Consider, for example, an HDA A with only one vertex and one edge, labeled a. Then A is history-preserving bisimilar to its unfolding B, which consists of an infinite sequence of edges, all labeled a. On the other hand, since in degree 1, HL(A) is generated by a but HL(B) = 0, A and B are not weakly equivalent. Consequently, these two HDAs are also not simulation equivalent in the above sense, and indeed, there is no cubical dimap from A to B. If one wishes to define a concept of bisimilarity that is stronger than this notion of simulation equivalence, one possibility is to consider P-bisimilarity in the sense of Joyal, Nielsen, and Winskel [JNW96] where P is the wide subcategory of the category of HDAs and cubical dimaps of the form (f, id) whose morphisms are inclusions of sub-HDAs. It should be noted, though, that although it is not isomorphism, this concept of bisimilarity is very strong.

Topological abstraction
In [Kah16], a preorder for HDAs has been introduced, called topological abstraction. Roughly speaking, an HDA A is a topological abstraction of an HDA B if there exists a cubical dimap A → B that is a homotopy equivalence inducing an isomorphism of trace categories and an isomorphism of homology graphs. The homology graph of an HDA A is the directed graph where the vertices are the homology classes of A and there is an edge from a homology class υ to a homology class ν if there exist precubical subsets U, V ⊆ P A such that υ ∈ im H * (U → P A ), ν ∈ im H * (V → P A ), and for all vertices u ∈ U 0 and v ∈ V 0 , there exists a path from u to v [Kah14a]. The trace category of an HDA A is the category T C(A) whose objects are the initial state, the final states, the minimal vertices (i.e., vertices without incoming edges), and the maximal vertices (i.e., vertices without outgoing edges) and whose morphisms are the dihomotopy classes of paths between these states [Kah14b]. A cubical dimap (f, σ) : A → B that preserves minimal and maximal vertices induces a functor f * : T C(A) → T C(B), which sends an object x to f 0 (x) and a dihomotopy class [ω] to [f I (ω)]. By the following proposition, topological abstraction is often stronger than weak equivalence: Consider now an element v ∈ T L(B). Let β ∈ P I B be a path such that β(0) = I B and v [λ B (β)]. Since B is coaccessible, we may suppose that β ends in a final state b. Since f * is full and surjective on . As before, this implies that and therefore v ∈ T L(A).
Remark 6.4.2. An important difference between topological abstraction and weak equivalence is that weakly equivalent HDAs need not be homotopy equivalent and may have certain topological differences. Indeed, weak equivalence ignores zero-labeled homology classes (at least of dimension ≥ 2). Examples of such classes include torsion classes, differences of classes with the same label, classes that are noise (e.g., classes given by differences of cubes with the same boundary), and classes given by virtual boundaries (i.e., cycles that become boundaries in larger HDAs). In contexts where zero-labeled homology classes are essential, weak equivalence is too weak a notion of equivalence.

Cube collapses
We shall now provide conditions under which collapsing a cube in an HDA yields a weakly equivalent HDA. We will consider elementary and vertex-star collapses. The definition of these concepts is based on the following construction: the star of an element x of a precubical set P is the graded set star(x) defined by star(x) n = {y ∈ P n | x ∈ y (❲0, 1❳ ⊗n )}.
Thus star(x) consists of x and all elements having x in their iterated boundary. The graded set P \star(x) is a precubical subset of P . We say that a face d k i x of a regular cube x of P is free if star(d k i x) = {x, d k i x}. In this case, the inclusion |P \star(d k i x)| → |P | is a homotopy equivalence, and we say that P \star(d k i x) has been obtained from P through an elementary collapse (see Figure 4 for a picture). If x ∈ P is a regular cube of degree n ≥ 2 and k 1 , . . . , k n ∈ {0, 1} are indexes such that at least one k i = 0, at least one k i = 1, and star(d kn 1 · · · d k1 1 x) ⊆ x (❲0, 1❳ ⊗n ), then the inclusion |P \ star(d kn 1 · · · d k1 1 x)| → |P | is a homotopy equivalence and we say that P \ star(d kn 1 · · · d k1 1 x) has been obtained from P through a vertex-star collapse (see Figure 4).
In degrees ≥ 3, elementary collapses always yield weakly equivalent HDAs: Proposition 6.5.1. Let A be an HDA, and let x be a regular cube of degree n ≥ 3 with free face d k i x. Consider the sub-HDA B ⊆ A defined by P B = P A \ star(d k i x) and Σ B = Σ A . Then A B.
Proof: This follows from Proposition 5.7.2 and the fact that A and B agree in degrees ≤ 1.
Elementary 2-cube collapses are more delicate. We first deal with the case where the free face is a back face: Theorem 6.5.2. Let A be an HDA, and let x be a regular 2-cube with free face d 1 i x (i ∈ {1, 2}). Consider the sub-HDA B ⊆ A defined by P B = P A \ star(d 1 i x) and Σ B = Σ A . Suppose that there exists an edge y in B such that d 0 1 y = d 0 1 d 1 i x, and suppose that for every path ω ∈ P I B with ω(L ω ) = d 0 1 d 1 i x and ω(0) ∈ {I A , d 1 1 d 1 1 x, d 1 1 y}, there exists a path ν ∈ P I B such that ν(0) = ω(0), ν(L ν ) = d 0 For the reverse inclusions, it suffices to show that every path ω ∈ P I A with ω(0) = I A is dihomotopic to a path ω ∈ P I B . So consider ω ∈ P I A with ω(0) = I A . We may suppose that ω / ∈ P I B .
Write ω as a concatenation where each ω j is a path in P B . By our assumptions, there exist pathsω j ∈ P I B (0 ≤ j < r) such that Since x is regular, ω ∈ P I B . It is clear that ω ∼ ω. Since A and B have the same vertices and the same initial and final states and every path in B is a path in A, it is clear that A is (co)accessible if B is (co)accessible. Suppose that A is accessible, and consider a vertex b ∈ (P B ) 0 . Then there exists a path ω ∈ P I A from I A to b. As shown above, there exists a path ω ∈ P I B such that ω ∼ ω. It follows that B is accessible. Suppose that A is coaccessible. By our hypothesis, there exists an edge We show first that d 1 1 y is coreachable in B. Since A is coaccessible, there exists a path γ ∈ P I A from d 1 1 y to a vertex c ∈ F A = F B . If γ ∈ P I B , we have nothing to show. If γ / ∈ P I B , it begins with a path from d 1 1 y to d 0 1 d 1 i x. Let ω be a shortest such path. Then ω ∈ P I B , and so we may choose a path ν ∈ P I B such that ν(0) = d 1 1 y, ν(L ν ) = d 0 1 d 0 1 x, and ν · (d 0 3−i x) ∼ ω. Since γ / ∈ P I B , γ terminates with a path from d 1 1 d 1 1 x to c. Let β be a shortest such path. Then β ∈ P I B . The concatenation ν · (d 0 i x) · (d 1 3−i x) · β is a path in B from d 1 1 y to c. Hence d 1 1 y is coreachable in B. Consider now an arbitrary vertex b ∈ (P B ) 0 . Then there exists a path α ∈ P I A from b to a final state. If α ∈ P I B , b is coreachable in B. If α / ∈ P I B , it begins with a path in B from b to d 0 1 d 1 i x = d 0 1 y. Hence there exists a path in B from b to d 1 1 y. Since d 1 1 y is coreachable in B, it follows that b is coreachable in B. Hence B is coaccessible if A is coaccessible.
For elementary collapses of 2-cubes with a free front face, we state the following fact, which is proved by adapting the arguments given in the proof of Theorem 6.5.2: Theorem 6.5.3. Let A be an HDA, and let x be a regular 2-cube with free face d 0 i x (i ∈ {1, 2}). Suppose that d 1 1 d 0 i x / ∈ {I A } ∪ F A and that there exists an edge y = d 0 i x such that d 1 1 y = d 1 1 d 0 i x. Suppose also that there is no edge z = d 1 3−i x such that d 0 1 z = d 1 1 d 0 i x. Consider the sub-HDA B ⊆ A defined by P B = P A \ star(d 0 i x) and Σ B = Σ A . Then A B. Regarding vertex-star collapses, we have the following result: Theorem 6.5.4. Let x be a regular cube of degree n ≥ 2 of an HDA A, and let k 1 , . . . , k n ∈ {0, 1} such at least one k i = 0, at least one k i = 1, d kn 1 · · · d k1 1 x / ∈ {I A } ∪ F A , and star(d kn 1 · · · d k1 1 x) ⊆ x (❲0, 1❳ ⊗n ). Consider the sub-HDA B ⊆ A defined by P B = P A \ star(d kn 1 · · · d k1 1 x) and Σ B = Σ A . Then A B.

Example
An HDA modeling the accessible part of the system given by Peterson's mutual exclusion algorithm [Pet81] is depicted in Figure 5. The concurrent alphabet is the pair (Σ, D) where Σ is the set of edge labels and D is the canonical dependence relation (see Section 2.10). Peterson's algorithm is based on three shared variables-namely, the boolean variables b 0 and b 1 and the turn variable t, whose possible values are the process IDs, say 0 and 1. Process i executes the following protocol: • Set b i to 1 to indicate the intention to enter the critical section.
• Set t to 1 − i to give priority to the other process.
• Wait until b 1−i = 0 or t = i, and then enter the critical section.
• Leave the critical section setting b i to 0.
• Repeat the procedure from the beginning.
As explained in more detail in [Kah16], the HDA for Peterson's algorithm may be reduced to the one depicted in Figure 6 by collapsing and merging cubes in the way discussed in Sections 6.5 and 6.6 and, more precisely, using Theorems 6.5.2, 6.5.3, 6.5.4, and 6.6.1. Consequently, the two HDAs are weakly equivalent.
Since weakly equivalent HDAs have the same trace language, they have the same saturated safety properties (see Proposition 4.3.2). In the case of Peteron's algorithm, such properties may thus be verified for the small HDA in Figure 6 instead of for the bigger one depicted in Figure 5. This applies in particular to mutual exclusion, which is the saturated safety property given by the set Another important feature of Peterson's algorithm is starvation freedom: a process that requests access to the critical section will eventually obtain it. This liveness property can be inferred from the saturated Starvation freedom of Peterson's algorithm can thus be established using any HDA weakly equivalent to the one of Figure 5. It should be noted, however, that the trace language only contains information on saturated safety properties (see Proposition 4.3.2) and that therefore weak equivalence does not preserve liveness properties in general.

Concluding remarks
This paper introduced weak equivalence, a coarse notion of equivalence for higher-dimensional automata. Although equivalences for HDAs do not really fit into van Glabbeek's linear time -branching time spectrum [Gla01], one might want to know how weak equivalence compares with trace equivalence, the coarsest equivalence in the spectrum. What can be said is that two HDAs over the same concurrent alphabet will have the same trace language if their underlying automata are trace equivalent. On the other hand, the underlying automata of weakly equivalent HDAs will normally only be trace equivalent up to congruence. Thus, ignoring the higher-dimensional structure of HDAs and comparing only what is comparable, weak equivalence may be considered weaker than trace equivalence.
As we have pointed out, history-preserving bisimilar HDAs (see [Gla06]) need not be weakly equivalent. It would be interesting to know under which conditions history-preserving bisimilarity implies weak equivalence.
We have shown that weak equivalence is a congruence with respect to the tensor product and, at least in the coaccessible case, the coproduct of HDAs. This fact and our results on the reduction of HDAs provide means to establish that two HDAs are weakly equivalent. A fundamental problem in this context is whether weak equivalence is decidable for finite HDAs. Given the undecidability of the equivalence problem for regular trace languages [AH89], it seems likely that weak equivalence is undecidable as well.
The homology language of an HDA A has been defined as a graded submodule of the exterior algebra Λ(Σ A ). An interesting question is which submodules of exterior algebras may actually arise as homology languages of HDAs. It seems possible to show that HL(A) is necessarily a graded subcoalgebra of Λ(Σ A ). Assuming that this is true, the question becomes: Which subcoalgebras of an exterior algebra are homology languages?
The term weak equivalence has a particular meaning in homotopy theory. A natural question is thus whether there exists a homotopy theory of HDAs such that two HDAs are weakly equivalent in the sense of this paper if and only if they are weakly equivalent in the homotopy theory.