Abstract 1 Introduction 2 Branching Bisimilarity 3 The Main Algorithm 4 Four-Way Split 5 Stabilising New Bottom States 6 Complexity 7 Benchmarks References

A State-Based O(m log n) Partitioning Algorithm for Branching Bisimilarity

Jan Friso Groote ORCID Department of Computer Science, Eindhoven University of Technology, The Netherlands David N. Jansen ORCID Key Laboratory of System Software, Chinese Academy of Sciences, Beijing, China
State Key Laboratory of Computer Science, Institute of Software, Chinese Academy of Sciences, Beijing, China
Abstract

We present a new O(mlogn) algorithm to calculate branching bisimulation equivalence, which is the finest commonly used behavioural equivalence on labelled transition systems that takes the internal action τ into account. This algorithm combines the simpler data structure of an earlier algorithm for Kripke structures (without action labels) with the memory-efficiency of a later algorithm partitioning sets of labelled transitions. It employs a particularly elegant four-way split of blocks of states, which refines a block under two splitters and isolates all new bottom states, simultaneously. Benchmark results show that this new algorithm outperforms the best known algorithm for branching bisimulation both in time and space.

Keywords and phrases:
Algorithm, Branching bisimulation, Partition refinement of states
Funding:
David N. Jansen: This work is supported by ISCAS Basic Research ISCAS-JCZD-202302 and is part of the European Union’s Horizon 2020 research and innovation programme under the Marie Skłodowska-Curie grant no. 101008233.
Copyright and License:
[Uncaptioned image] © Jan Friso Groote and David N. Jansen; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Design and analysis of algorithms
; Software and its engineering Formal software verification
Editors:
Patricia Bouyer and Jaco van de Pol

1 Introduction

Branching bisimulation relates behaviourally equivalent states in labelled transition systems that represent behaviour [4]. It takes internal or invisible steps τ into account and preserves the branching structure of processes. It is slightly finer than weak bisimulation [11].

Almost immediately after the discovery of branching bisimulation a decently efficient O(mn)-algorithm (where m is the number of transitions and n is the number of states) became available [7]. This was a great asset not only because it allowed to decide quickly whether states were branching bisimilar, but also because it could be used as an efficient preprocessing step for many other behaviour equivalences that take internal steps into account.

A major improvement was the development of an O(mlogn) algorithm [8, 5], working on Kripke structures, which can be regarded as labelled transition systems where all transitions are labelled with τ, as, at the time, it was not clear how to efficiently deal with multiple transition labels. This algorithm could be applied to arbitrary labelled transition systems by translating them to Kripke structures where one extra state was introduced for every transition in the original transition system [1]. As the number of transitions is generally much larger than the number of states, this is costly, both in time and space.

Following [14], where it was proposed to use equivalence classes of transitions to avoid redoing work that has already been done, a new algorithm was developed that works directly on labelled transition systems [10]. By avoiding the costly translation to Kripke structures, this algorithm was 40% faster than the best algorithm known until then.

However, the use of equivalence classes of transitions feels unpleasant, given that there are in general far more transitions than states. So, the purpose of this paper is to design an algorithm that avoids partitioning transitions. The essential step that enables us to do so is the efficient grouping of transitions with the same transition label. Instead of the complex trickery used in previous algorithms, we employ a very natural and elegant four-way split of blocks, which is an extension of the three-way split used in the classical algorithm for strong bisimulation on Kripke structures by Paige and Tarjan [12, 2]. The fourth block collects the infamous “new bottom states”, that invalidate the stability invariant, allowing us to isolate the work to repair this invariant, avoiding much of the complexity of earlier algorithms.

The result is a new algorithm that is not only simpler and more elegant, but also faster and more memory-efficient than all its predecessors, although it has the same O(mlogn) time complexity – here we assume that the number of action labels is smaller than the number of transitions. Especially on large transition systems with many transitions a 40% reduction in memory usage and a fourfold reduction in time appears to be possible.

2 Branching Bisimilarity

In this section we define labelled transition systems and branching bisimilarity.

Definition 2.1 (Labelled transition system).

A labelled transition system (LTS) is a triple A=(S,𝐴𝑐𝑡,) where

  1. 1.

    S is a finite set of states. The number of states is denoted by n.

  2. 2.

    𝐴𝑐𝑡 is a finite set of actions including the internal action τ.

  3. 3.

    S×𝐴𝑐𝑡×S is a transition relation. The number of transitions m is always finite.

It is common to write s𝑎s for (s,a,s). We write s𝑎sT instead of (s,a,s)T for T. We also write s𝑎S for the set of transitions {s𝑎ssS}, and likewise S1𝑎S2 for the set {s1𝑎s2s1S1 and s2S2}. We refer to all actions except τ as the visible actions. The transitions labelled with τ are called invisible. If s𝑎s, we say that from s, the state s, the action a, and the transition s𝑎s are reachable. We write 𝑖𝑛(s) for the incoming transitions of state s and 𝑜𝑢𝑡(s) for the outgoing transitions of s. Likewise, we write 𝑖𝑛(B) and 𝑜𝑢𝑡(B) for all incoming and outgoing transitions of a set BS.

Definition 2.2 (Branching bisimilarity).

Let A=(S,𝐴𝑐𝑡,) be a labelled transition system. We call a relation RS×S a branching bisimulation relation iff it is symmetric and for all s,tS such that s𝑅t and all transitions s𝑎s we have:

  1. 1.

    a=τ and s𝑅t, or

  2. 2.

    there is a sequence t𝜏𝜏t𝑎t′′ such that s𝑅t and s𝑅t′′.

Two states s and t are branching bisimilar, denoted by s¯bt, iff there is a branching bisimulation relation R such that s𝑅t.

If we restrict the definition of branching bisimilarity such that states are only related if they both have, or both have not an infinite sequence of τ’s through branching bisimilar states, we obtain the notion of divergence-preserving branching bisimulation. This notion is useful as it – contrary to branching bisimilarity – preserves liveness properties. The algorithm that is presented below can be used for divergence-preserving branching bisimilarity with only a minor modification.

Given an equivalence relation R, a transition s𝑎t is called R-inert iff a=τ and s𝑅t. If t𝜏t1𝜏𝜏tn1𝜏tn𝑎t such that t𝑅ti for 1in, we say that the state tn, the action a, and the transition tn𝑎t are R-inertly reachable from t. Note that we can use these notions in combination with (divergence-preserving) branching bisimilarity as they are all equivalence relations.

3 The Main Algorithm

In this section we give a description of the main part of the algorithm to determine the branching bisimulation equivalence classes of a given LTS (S,𝐴𝑐𝑡,).

Removal of Inert Loops.

As the first step of the algorithm the LTS is preprocessed to contract each τ-strongly connected component (SCC) into a single state. This step is valid since all states in a τ-SCC are branching bisimilar. For divergence-preserving branching bisimilarity, the τ-self-loops are replaced by a special non-internal action. In both cases, τ-self-loops can be suppressed and therefore, from this point onwards, as the algorithm does not change the structure of the LTS further, all τ-paths in the LTS are finite, formalised by the following lemma.

Lemma 3.1 (No 𝝉-loops).

After contracting τ-SCCs into single states, there is no τ-loop in the LTS, i.e., for every sequence s1𝜏s2𝜏𝜏sn it holds that sisj for all 1i<jn.

In every set of states BS, the states without τ-transition to another state in B are called bottom states. The set of bottom states in B is denoted by 𝐵𝑜𝑡𝑡𝑜𝑚(B). Lemma 3.1 implies the following lemma:

Lemma 3.2.

For every nonempty set of states BS, we have

  1. 1.

    𝐵𝑜𝑡𝑡𝑜𝑚(B).

  2. 2.

    For every state sB, there is a path of τ-transitions within B leading to a bottom state.

Partition Refinement.

The algorithm is a partition refinement algorithm of sets of states where two partitions of states are iteratively refined.

Definition 3.3 (Partition).

For a set X a partition 𝒫 of X is a disjoint cover of X, i.e., 𝒫={BiXBi,1ik} such that BiBj= for all 1i<jk and X=1ikBi.

A partition 𝒬 is a refinement of 𝒫, and 𝒫 is coarser than 𝒬, iff for every B𝒬 there is some B𝒫 such that BB.

A partition induces an equivalence relation in the following way: s𝒫t iff there is some B𝒫 containing both s and t. We call a transition 𝒫-inert iff it is 𝒫-inert, i.e., exactly if it is a transition s𝜏t with s,tP for some P𝒫.

Our algorithm uses two partitions and 𝒞 of states. The main partition contains blocks, typically denoted with the letter B, recording the current knowledge about branching bisimilarity. Two states are in different blocks iff the algorithm has found a proof that they are not branching bisimilar, formulated contrapositionally by the following invariant:

Invariant 3.4 ( preserves branching bisimilarity).

For all states s,tS, if s¯bt, then there is some block B such that s,tB.

Stability.

We desire to make the partition “stable” in the sense that blocks of cannot be split further as all states in each block are branching bisimilar. This notion of stability is defined as follows. Consider two sets of states B,BS. We say that two states s,tB are stable under B iff if s𝑎s for any sB then

  • either B=B and a=τ,

  • or there are t1,,tkB and tB such that t=t1, k1 and t1𝜏𝜏tk𝑎t.

A partition of S is stable under a set of states BS iff for all B and s,tB it holds that s and t are stable under B. If is stable under every B we say that is stable.

An important property is that if a partition is stable, then the induced equivalence relation is a branching bisimulation.

Constellations.

In order to remember which instabilities have already been resolved we introduce a second partition 𝒞 of the set of states S of which is a refinement. We call the blocks in 𝒞 constellations and we typically denote constellations with the letter C.

The partition 𝒞 records the current knowledge about stability by guaranteeing that is always stable under each constellation C𝒞. Using Lemma 3.2 this follows from the following invariant.

Invariant 3.5 ( is stable under the constellations in 𝒞).

If there is a transition s𝑎t with tC for some constellation C𝒞 and sB for some block B, and the transition is not 𝒞-inert (i.e., aτ or sC), then every bottom state sB has a transition in s𝑎C.

The goal of the algorithm is to let the partition of constellations 𝒞 and the partition of blocks coincide. If =𝒞, then is stable, and, using Invariants 3.4 and 3.5, the partition exactly characterises branching bisimulation. As this is the core purpose of our algorithm, we formulate it as a theorem, although the proof is straightforward.

Theorem 3.6.

If =𝒞, then =¯b.

The main idea of the algorithm is to refine 𝒞 until it coincides with . After refining 𝒞, one may have to refine to reestablish Invariant 3.5. For this to work, we use two essential subroutines, namely four-way-split (Algorithm 2) and 𝗌𝗍𝖺𝖻𝗂𝗅𝗂𝗌𝖾 (Algorithm 3). We first give a summary of what these functions do, after which we explain the overall algorithm. In Sections 4 and 5 their underlying algorithms are explained.

The function four-way-split(B,SmallSp,LargeSp) splits a block B in in at most four sub-blocks based on two disjoint sets of transitions SmallSp and LargeSp that start in B. We require that at least one of these two sets is non-empty. If both are non-empty, every state in B can -inertly reach a transition in at least one of the two. The four sub-blocks are the following:

𝖠𝗏𝗈𝗂𝖽𝖫𝗋𝗀:

If 𝐿𝑎𝑟𝑔𝑒𝑆𝑝, 𝖠𝗏𝗈𝗂𝖽𝖫𝗋𝗀 contains the states in B that cannot -inertly reach 𝐿𝑎𝑟𝑔𝑒𝑆𝑝. If 𝐿𝑎𝑟𝑔𝑒𝑆𝑝=, then 𝖠𝗏𝗈𝗂𝖽𝖫𝗋𝗀=.

𝖠𝗏𝗈𝗂𝖽𝖲𝗆𝗅:

If 𝑆𝑚𝑎𝑙𝑙𝑆𝑝, 𝖠𝗏𝗈𝗂𝖽𝖲𝗆𝗅 contains the states in B that cannot -inertly reach 𝑆𝑚𝑎𝑙𝑙𝑆𝑝. If 𝑆𝑚𝑎𝑙𝑙𝑆𝑝=, then 𝖠𝗏𝗈𝗂𝖽𝖲𝗆𝗅=.

𝖱𝖾𝖺𝖼𝗁𝖠𝗅𝗐:

states in B that can always -inertly reach both splitters 𝑆𝑚𝑎𝑙𝑙𝑆𝑝 and 𝐿𝑎𝑟𝑔𝑒𝑆𝑝 if both are non-empty. Otherwise, 𝖱𝖾𝖺𝖼𝗁𝖠𝗅𝗐 consists of states in B that can always -inertly reach the non-empty splitter. “Always …reach” here also means: if a -inert transition starts in such a state, its target state, which is in B, must also be in 𝖱𝖾𝖺𝖼𝗁𝖠𝗅𝗐.

𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍:

states in B that do not fit in any of the three sets above. Original bottom states cannot end up in 𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍, and new bottom states will always end up in this sub-block.

Figure 1: Left: four-way-split(B,B𝑎B,B𝑎CB). Right: four-way-split(B,B𝜏B,).

Figure 1 contains two examples of how a block B is split. Here unlabelled transitions are -inert transitions in B. The next lemma expresses that new bottom states end up in 𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍 and Invariant 3.4 is preserved under the four-way-split.

Lemma 3.7.

Consider a partition and B. Assume given a𝐴𝑐𝑡 and disjoint sml,lrg with aτ or Bsmllrg. Let

𝑆𝑚𝑎𝑙𝑙𝑆𝑝:=B𝑎smland𝐿𝑎𝑟𝑔𝑒𝑆𝑝:=B𝑎lrg.

Assume further that 𝑆𝑚𝑎𝑙𝑙𝑆𝑝𝐿𝑎𝑟𝑔𝑒𝑆𝑝. Let be the partition ({B})({𝖠𝗏𝗈𝗂𝖽𝖫𝗋𝗀,𝖠𝗏𝗈𝗂𝖽𝖲𝗆𝗅,𝖱𝖾𝖺𝖼𝗁𝖠𝗅𝗐,𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍}{}) with the mentioned sets being the results of the call

four-way-split(B,𝑆𝑚𝑎𝑙𝑙𝑆𝑝,𝐿𝑎𝑟𝑔𝑒𝑆𝑝).

Then

  1. 1.

    For any state s𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍 it holds that s𝐵𝑜𝑡𝑡𝑜𝑚(B).

  2. 2.

    For any state s𝐵𝑜𝑡𝑡𝑜𝑚(𝖠𝗏𝗈𝗂𝖽𝖫𝗋𝗀)𝐵𝑜𝑡𝑡𝑜𝑚(𝖠𝗏𝗈𝗂𝖽𝖲𝗆𝗅)𝐵𝑜𝑡𝑡𝑜𝑚(𝖱𝖾𝖺𝖼𝗁𝖠𝗅𝗐) it holds that s𝐵𝑜𝑡𝑡𝑜𝑚(B).

  3. 3.

    If Invariant 3.4 holds for , then Invariant 3.4 holds for .

Proof.

  1. 1.

    We use contraposition. Assume that s𝐵𝑜𝑡𝑡𝑜𝑚(B). Then s does not have an outgoing -inert transition. By construction s ends up in one of the sets 𝖠𝗏𝗈𝗂𝖽𝖲𝗆𝗅, 𝖠𝗏𝗈𝗂𝖽𝖫𝗋𝗀 and 𝖱𝖾𝖺𝖼𝗁𝖠𝗅𝗐. Hence, s𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍.

  2. 2.

    This follows by observing that if there is a bottom state sBs where Bs is any of the blocks 𝖠𝗏𝗈𝗂𝖽𝖫𝗋𝗀, 𝖠𝗏𝗈𝗂𝖽𝖲𝗆𝗅 and 𝖱𝖾𝖺𝖼𝗁𝖠𝗅𝗐 which was not a bottom state in B, then there is transition s𝜏s with sB but sBs. Going through the various cases, it follows that s cannot be in any of the three sets Bs, and therefore must be part of 𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍.

  3. 3.

    Using that Invariant 3.4 is valid for , we only need to show that two states s,tB that have been moved to different blocks in are not branching bisimilar.

    Assume s𝖱𝖾𝖺𝖼𝗁𝖠𝗅𝗐 and t𝖠𝗏𝗈𝗂𝖽𝖲𝗆𝗅. Then s can -inertly reach 𝑆𝑚𝑎𝑙𝑙𝑆𝑝. This means, using the invariant and the conditions of this lemma, it can reach a non-¯b-inert transition in 𝑆𝑚𝑎𝑙𝑙𝑆𝑝. As t𝖠𝗏𝗈𝗂𝖽𝖲𝗆𝗅, t cannot mimic this transition, and hence s ¯bt. More concretely, all states in 𝖱𝖾𝖺𝖼𝗁𝖠𝗅𝗐 and 𝖠𝗏𝗈𝗂𝖽𝖲𝗆𝗅 are not branching bisimilar. Similarly, one proves that the states in 𝖱𝖾𝖺𝖼𝗁𝖠𝗅𝗐 and 𝖠𝗏𝗈𝗂𝖽𝖫𝗋𝗀, respectively, the states in 𝖠𝗏𝗈𝗂𝖽𝖲𝗆𝗅 and 𝖠𝗏𝗈𝗂𝖽𝖫𝗋𝗀 are not branching bisimilar.

    Now assume s𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍. We claim that s can -inertly reach both 𝑆𝑚𝑎𝑙𝑙𝑆𝑝 and 𝐿𝑎𝑟𝑔𝑒𝑆𝑝 unless they are empty, and s can -inertly reach 𝖠𝗏𝗈𝗂𝖽𝖲𝗆𝗅 or 𝖠𝗏𝗈𝗂𝖽𝖫𝗋𝗀. This can be seen as follows. If sB can -inertly reach 𝑆𝑚𝑎𝑙𝑙𝑆𝑝 but not 𝐿𝑎𝑟𝑔𝑒𝑆𝑝 (and 𝐿𝑎𝑟𝑔𝑒𝑆𝑝), then s𝖠𝗏𝗈𝗂𝖽𝖫𝗋𝗀. Similarly, if sB can -inertly reach 𝐿𝑎𝑟𝑔𝑒𝑆𝑝 but not 𝑆𝑚𝑎𝑙𝑙𝑆𝑝 (and 𝑆𝑚𝑎𝑙𝑙𝑆𝑝), then s𝖠𝗏𝗈𝗂𝖽𝖲𝗆𝗅. So, s can reach all non-empty splitters. As s𝖱𝖾𝖺𝖼𝗁𝖠𝗅𝗐, it can -inertly reach a bottom state s𝐵𝑜𝑡𝑡𝑜𝑚(B)𝖱𝖾𝖺𝖼𝗁𝖠𝗅𝗐. As s𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍 (by dictum 1), we have s𝖠𝗏𝗈𝗂𝖽𝖲𝗆𝗅 or s𝖠𝗏𝗈𝗂𝖽𝖫𝗋𝗀.

    If t𝖠𝗏𝗈𝗂𝖽𝖲𝗆𝗅 or t𝖠𝗏𝗈𝗂𝖽𝖫𝗋𝗀, then s can -inertly reach a non-¯b-inert transition in 𝑆𝑚𝑎𝑙𝑙𝑆𝑝 or 𝐿𝑎𝑟𝑔𝑒𝑆𝑝, respectively, that t cannot mimic.

    Now consider t𝖱𝖾𝖺𝖼𝗁𝖠𝗅𝗐. We know that s can -inertly reach a state s𝖠𝗏𝗈𝗂𝖽𝖲𝗆𝗅𝖠𝗏𝗈𝗂𝖽𝖫𝗋𝗀, and as argued above t ¯bs. Suppose we can find a state t reachable with internal transitions from t that mimics the path from s to s such that t¯bs. Using Invariant 3.4 for , t must be -inertly reachable and tB. But then t𝖱𝖾𝖺𝖼𝗁𝖠𝗅𝗐 and s ¯bt. So, no such t exists, and hence s ¯bt.

The following lemma explains which calls to four-way-split are needed to reestablish Invariant 3.5 after splitting a constellation C𝒞. For now we exclude blocks that contain new bottom states, i.e. sub-blocks of 𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍, cf., Lemma 3.7.1 and 3.7.2.

Lemma 3.8.

Consider a partition refining a partition of constellations 𝒞 for which Invariant 3.5 holds. Let the refined set of constellations 𝒞 be (𝒞{C}){B,CB} for some B and C𝒞 and BC.

Let be the result of the iterative refinements ({B})({𝖠𝗏𝗈𝗂𝖽𝖫𝗋𝗀,𝖠𝗏𝗈𝗂𝖽𝖲𝗆𝗅,𝖱𝖾𝖺𝖼𝗁𝖠𝗅𝗐,𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍}{}) with the mentioned sets being the results of the following calls. Assume that for every action a𝐴𝑐𝑡 these calls take place for blocks B satisfying the indicated conditions such that S is covered by these blocks B, blocks not satisfying the conditions, singleton blocks with |B|=1, or blocks that refine some block 𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍:

four-way-split(B,B𝑎B,B𝑎CB)if aτ or BC, and there are s1,s2B suchthat s1𝑎t1,s2𝑎t2 and t1B,t2CB,four-way-split(B,B𝜏B,)if BCB and there is an sB such thats𝜏t and tB,four-way-split(B,B𝜏CB,)if BB and there is an sB such thats𝜏t and tCB.

Then Invariant 3.5 holds for all blocks in (except for those that refine some block 𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍) and 𝒞.

Proof.

Consider a state sB^ for any block B^ not refining any 𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍. Assume that a non-𝒞-inert transition s𝑎t exists with tC^ for some constellation C^𝒞. So, aτ or sC^. We must prove that any s𝐵𝑜𝑡𝑡𝑜𝑚(B^) has a transition s𝑎t with tC^.

Let B^ be the block B^B^. Note that s𝐵𝑜𝑡𝑡𝑜𝑚(B^) by Lemma 3.7.2.

Case C^C:

That means that C^𝒞. Using Invariant 3.5 (for B^ and C^𝒞), s has a transition s𝑎t with tC^.

Case B^C, a=τ and C^=B:

If B^B=B^, then s𝜏t were 𝒞-inert. So, we can assume B^CB. There is a block B^′′ with B^B^′′B^ such that a call

four-way-split(B^′′,B^′′𝜏B,)

must have taken place. In this case B^ is a sub-block of 𝖱𝖾𝖺𝖼𝗁𝖠𝗅𝗐 or 𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍. In the last case there is nothing to check. But B^𝖱𝖾𝖺𝖼𝗁𝖠𝗅𝗐 implies that s𝐵𝑜𝑡𝑡𝑜𝑚(B^) has a transition s𝜏t with tB, as had to be shown.

Case (B^C or aτ) and C^=B:

If (B^𝑎CB)=, we know by Invariant 3.5 (for B^ and C𝒞) that s𝐵𝑜𝑡𝑡𝑜𝑚(B^) has a transition s𝑎t with tC, and as the transition cannot go to CB, it must go to B, which we had to prove.

Otherwise, (B^𝑎CB), and there is a block B^′′ with B^B^′′B^ for which a call

four-way-split(B^′′,B^′′𝑎B,B^′′𝑎CB)

took place with B^ a sub-block of 𝖠𝗏𝗈𝗂𝖽𝖫𝗋𝗀, 𝖱𝖾𝖺𝖼𝗁𝖠𝗅𝗐 or 𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍. The last case does not lead to a proof obligation. But B^𝖠𝗏𝗈𝗂𝖽𝖫𝗋𝗀 or B^𝖱𝖾𝖺𝖼𝗁𝖠𝗅𝗐 implies that s𝐵𝑜𝑡𝑡𝑜𝑚(B^) has a transition s𝑎t with tB, as had to be shown.

Case B^C, a=τ and C^=CB:

If B^CB, then s𝜏t were 𝒞-inert. So we can assume B^B=B^. There is a block B^′′ with B^B^′′B such that a call

four-way-split(B^′′,B^′′𝜏CB,)

must have taken place, where B^ is a sub-block of 𝖱𝖾𝖺𝖼𝗁𝖠𝗅𝗐 or 𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍. The latter case is not interesting. Again, B^𝖱𝖾𝖺𝖼𝗁𝖠𝗅𝗐 implies that s𝐵𝑜𝑡𝑡𝑜𝑚(B^) has a transition s𝜏t with tCB, as had to be shown.

Case (B^C or a=τ) and C^=CB:

If (B^𝑎B)=, we know by Invariant 3.5 (for B^ and C𝒞) that s𝐵𝑜𝑡𝑡𝑜𝑚(B^) has a transition s𝑎t with tC, and as the transition cannot go to B, it must go to CB, which we had to prove.

Otherwise, (B^𝑎B), and there is a block B^′′ such that B^B^′′B^ and a call

four-way-split(B^′′,B^′′𝑎B,B^′′𝑎CB)

must have taken place, and B^ is a subset of 𝖠𝗏𝗈𝗂𝖽𝖲𝗆𝗅 or 𝖱𝖾𝖺𝖼𝗁𝖠𝗅𝗐 or 𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍. We can ignore the latter case. But B^𝖠𝗏𝗈𝗂𝖽𝖲𝗆𝗅 or B^𝖱𝖾𝖺𝖼𝗁𝖠𝗅𝗐 implies that s𝐵𝑜𝑡𝑡𝑜𝑚(B^) has a transition s𝑎t with tCB, as had to be shown.

Blocks with new bottom states, which were excluded by Lemma 3.8, are handled by the function 𝗌𝗍𝖺𝖻𝗂𝗅𝗂𝗌𝖾. It assumes that blocks without new bottom states are already stable and stabilises the blocks with new bottom states, which concretely means that it refines them under all their outgoing non-𝒞-inert transitions such that for the resulting partition Invariant 3.5 holds, while maintaining Invariant 3.4.

Algorithm 1 Branching bisimulation partitioning.

Main Algorithm.

We are now in the situation to explain Algorithm 1. First we need to take care that the Invariants 3.4 and 3.5 become valid. Therefore, in line 1.2 we set the partition and the set of constellations 𝒞 to {S}. This makes Invariant 3.4 trivially true.

If a block B has new bottom states, we use the predicate has_new_bottom_states(B) to indicate so. This is not only the case when block B is a refinement of some block 𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍 but it also applies to the initial block, and this is explicitly indicated in line 1.2. Invariant 3.5 is now made valid by one call to 𝗌𝗍𝖺𝖻𝗂𝗅𝗂𝗌𝖾 in line 1.3. Concretely, this call splits {S} into a partition such that all bottom states in each block B in have exactly the same outgoing non--inert actions, while keeping branching bisimilar states in the same block.

As stated above, the purpose of the main algorithm is to refine 𝒞 such that it ultimately coincides with . This happens in the loop starting at line 1.4. If and 𝒞 do not coincide, there is at least one block BC with size smaller than or equal to 12|C|. We replace the constellation C in 𝒞 by two new constellations B and CB (line 1.6).

Our main task is to make Invariant 3.5 valid again. This is done by taking care that all calls to four-way-split as required by Lemma 3.8 are performed. This guarantees that Invariant 3.5 is valid except for blocks of the form 𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍. Therefore, one extra call is needed to 𝗌𝗍𝖺𝖻𝗂𝗅𝗂𝗌𝖾 in line 1.19.

In order to effectively carry out the four-way-splits, transitions are organised in block-label-constellation sets (BLC sets). Every BLC set contains the transitions B𝑎C for a specific block B, action a𝐴𝑐𝑡, and constellation C𝒞. Whenever a constellation or a block is split (lines 1.6 and 2.45) these BLC sets are updated.

In line 1.8 there is a call to four-way-split(B,B𝜏(CB),) that corresponds with the third case in Lemma 3.8. So, that case has been covered.

For the remainder we put all non-𝒞-inert transitions to block B in a set . By traversing the BLC sets in the other required calls to four-way split are done. In line 1.5 such a BLC set 𝑆𝑚𝑎𝑙𝑙𝑆𝑝=B𝑎B for some block B is selected. For the complexity, it is important that |B|<12|C| as this implies that the selected BLC set is small, hence its name.

If B has only one state or is a refinement of some block 𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍 and hence has new bottom states, according to Lemma 3.8 it does not need to be considered to be split (line 1.12).

Otherwise, there are two situations. The first one is when a=τ and B was part of the constellation C (line 1.13). As does not contain τ-transitions from B to B, this means BCB and the required second call four-way-split(B,𝑆𝑚𝑎𝑙𝑙𝑆𝑝,) in Lemma 3.8 is made. The other situation, i.e., the else part at lines 1.151.18, exactly satisfies the conditions of the first mentioned call to four-way-split in Lemma 3.8. As the algorithm traverses all BLC sets that are part of , the whole set S is covered as required in Lemma 3.8.

From Lemma 3.8 it follows that at line 1.19 of the algorithm, Invariant 3.5 holds for all blocks, except for those that are of the shape 𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍. As stated above one call to 𝗌𝗍𝖺𝖻𝗂𝗅𝗂𝗌𝖾 is sufficient to restore Invariant 3.5 for all blocks. Just for the record, Invariant 3.4 remains valid, as each call to four-way-split preserves it (see Lemma 3.7.3), and, as explained in Section 5, 𝗌𝗍𝖺𝖻𝗂𝗅𝗂𝗌𝖾 refines only using four-way-split also.

This means that at line 1.4 of Algorithm 1 both invariants hold. If the condition of the while is not valid, the partitions and 𝒞 are equal, and as argued above, these resulting partitions coincide exactly with branching bisimulation. As the initial set of states S is finite, the partition 𝒞 can only be refined finitely often, which happens in the body of the while loop. This means that this algorithm always terminates with the required answer.

4 Four-Way Split

Algorithm 2 Refine a block under one or two sets of transitions.

This section explains how four-way-split(B,𝑆𝑚𝑎𝑙𝑙𝑆𝑝,𝐿𝑎𝑟𝑔𝑒𝑆𝑝) refines block B under two splitters, i.e., sets of transitions 𝑆𝑚𝑎𝑙𝑙𝑆𝑝 and 𝐿𝑎𝑟𝑔𝑒𝑆𝑝. The sets contain all transitions from B with a given label a to one or two given constellations.

Splitting block B must be done in a time proportional to the size of 𝑆𝑚𝑎𝑙𝑙𝑆𝑝 and the sizes of all but the largest block into which B is split. The principle “process the smaller half” then implies that every state and transition is only visited O(logn) times. However, we do not know a priori which of the three parts are the smallest. Therefore, we start four coroutines for the four parts, run them in lockstep and abort the coroutine that belongs to the largest part. This ensures that time proportional to the three smallest parts is used.

Preconditions.

At least one splitter must be non-empty. If both splitters are given (as in line 1.18 of Algorithm 1), it is known that every bottom state of B has a transition in at least one of the two splitters. We use data structures such that it is possible to quickly determine whether states with a transition in 𝑆𝑚𝑎𝑙𝑙𝑆𝑝 also have a transition in 𝐿𝑎𝑟𝑔𝑒𝑆𝑝.

We now go through the pseudocode shown as Algorithm 2.

Preparation: Splitting the Bottom States.

In lines 2.22.11, the algorithm initialises a number of sets of states, mainly to decide for every bottom state to which part it belongs.

In lines 2.22.4 in case 𝑆𝑚𝑎𝑙𝑙𝑆𝑝 every transition in 𝑆𝑚𝑎𝑙𝑙𝑆𝑝 is visited, and its source state is moved to 𝖱𝖾𝖺𝖼𝗁𝖠𝗅𝗐 or 𝖠𝗏𝗈𝗂𝖽𝖫𝗋𝗀, depending on whether it has a transition in 𝐿𝑎𝑟𝑔𝑒𝑆𝑝 or not. Bottom states that have not been moved belong to 𝖠𝗏𝗈𝗂𝖽𝖲𝗆𝗅. In case 𝑆𝑚𝑎𝑙𝑙𝑆𝑝=, the transitions in 𝐿𝑎𝑟𝑔𝑒𝑆𝑝 that start in a bottom state are traversed, to move these bottom states to 𝖱𝖾𝖺𝖼𝗁𝖠𝗅𝗐. The states that have not been moved belong to 𝖠𝗏𝗈𝗂𝖽𝖫𝗋𝗀.

If some non-bottom state has a transition in 𝑆𝑚𝑎𝑙𝑙𝑆𝑝, it is not immediately known to which part it belongs; it might happen that it has a -inert transition to another part. If the non-bottom state has a transition in the small splitter but not in 𝐿𝑎𝑟𝑔𝑒𝑆𝑝 (like s15 in Figure 1 at the left), it may end up in any part except 𝖠𝗏𝗈𝗂𝖽𝖲𝗆𝗅. To register this such a state is temporarily added to 𝖧𝗂𝗍𝖲𝗆𝖺𝗅𝗅 in line 2.8. It will be processed further in line 2.20 left.

If the non-bottom state has a transition in all (non-empty) splitters, it is potentially in 𝖱𝖾𝖺𝖼𝗁𝖠𝗅𝗐, unless it has a -inert transition to one of the other sub-blocks. In the latter case, it will be in 𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍. We add it temporarily to pot-ReachAlw to register this in line 2.7.

If all bottom states belong to 𝖱𝖾𝖺𝖼𝗁𝖠𝗅𝗐, the split is trivial (lines 2.52.6). Even if all bottom states belong to one of 𝖠𝗏𝗈𝗂𝖽𝖫𝗋𝗀 or 𝖠𝗏𝗈𝗂𝖽𝖲𝗆𝗅, there still can be some non-bottom states with transitions causing a split. Such states will be moved to 𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍.

Coroutines: Extending the Splits to Non-bottom States.

Algorithm 3 Stabilise the partition with respect to new bottom states.

After all bottom states have been distributed over the initial sets, we have to extend the distribution to the non-bottom states. To stay within the time bounds, we need to find all the states in the three smallest parts in time proportional to the number of their incoming and outgoing transitions.

Of the four coroutines, three (for 𝖱𝖾𝖺𝖼𝗁𝖠𝗅𝗐, 𝖠𝗏𝗈𝗂𝖽𝖲𝗆𝗅 and 𝖠𝗏𝗈𝗂𝖽𝖫𝗋𝗀) are almost the same. Their code is shown on the left of lines 2.122.41, where we use the keyword cor to indicate the three coroutines. The basic idea is the following. If all outgoing -inert transitions of some non-bottom state go to the same set, the state also belongs to this set. To avoid checking any transition more than once, we go through all incoming -inert transitions of the respective set and count how many outgoing -inert transitions of its source are not yet known to point to this set. If the -inert transitions point to different sets, the state belongs to 𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍 (line 2.21 left).

If the number of unknown transitions is 0, the source is added to the respective set, unless it has an incompatible transition in a splitter: states with a transition in both splitters can only be in 𝖱𝖾𝖺𝖼𝗁𝖠𝗅𝗐 or 𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍 and were therefore already added to pot-ReachAlw; this ensures that they move to 𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍 as soon as it is found out that they have a transition to 𝖠𝗏𝗈𝗂𝖽𝖲𝗆𝗅 or 𝖠𝗏𝗈𝗂𝖽𝖫𝗋𝗀. – States with a transition in 𝑆𝑚𝑎𝑙𝑙𝑆𝑝 but not in 𝐿𝑎𝑟𝑔𝑒𝑆𝑝 cannot be in 𝖠𝗏𝗈𝗂𝖽𝖲𝗆𝗅. If they would be added to that set, the test in line 2.20 left ensures that they will be added to 𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍 instead. – States with a transition in 𝐿𝑎𝑟𝑔𝑒𝑆𝑝 but not in 𝑆𝑚𝑎𝑙𝑙𝑆𝑝 cannot be in 𝖠𝗏𝗈𝗂𝖽𝖫𝗋𝗀. But as the algorithm is not allowed to go through all transitions in 𝐿𝑎𝑟𝑔𝑒𝑆𝑝 a priori, they are more difficult to handle. Only if the number of unknown transitions is 0 and the state is still a candidate for 𝖠𝗏𝗈𝗂𝖽𝖫𝗋𝗀, we are allowed to spend the time to check whether it has a transition in 𝐿𝑎𝑟𝑔𝑒𝑆𝑝 by looking through its non-𝒞-inert outgoing transitions in lines 2.292.33 left. Section 6 explains why this fits the time bounds.

When all incoming -inert transitions of a set have been visited, no more states can be added, so that set is finished. The states that had some -inert transitions to the set but still have unknown transitions must have transitions to some other set as well, so they are added to 𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍 in line 2.38 left. If 𝖠𝗏𝗈𝗂𝖽𝖲𝗆𝗅 is the only coroutine that still runs on the left side, any unassigned states remaining in 𝖧𝗂𝗍𝖲𝗆𝖺𝗅𝗅 also belong to 𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍, as they cannot be in 𝖠𝗏𝗈𝗂𝖽𝖲𝗆𝗅 (see lines 2.392.40 left).

The fourth coroutine, the one for 𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍, follows a slightly simpler principle. Every -inert predecessor of a 𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍-state is also in 𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍, independent of other transitions it might have. This happens in line 2.18 right. The other three coroutines may also occasionally add states to 𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍 and therefore, different from the first three coroutines, we cannot end the coroutine as soon as all incoming -inert transitions of the current 𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍 have been visited. Instead, we wait in an (outer) infinite loop. The outer loop can terminate when at least 𝖠𝗏𝗈𝗂𝖽𝖫𝗋𝗀 and one other coroutine have finished.

If only the coroutines for 𝖠𝗏𝗈𝗂𝖽𝖫𝗋𝗀 and 𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍 are still running, the latter will go through 𝐿𝑎𝑟𝑔𝑒𝑆𝑝 to find states that cannot be in 𝖠𝗏𝗈𝗂𝖽𝖫𝗋𝗀 in lines 2.242.27 right. If the source state of some transition in 𝐿𝑎𝑟𝑔𝑒𝑆𝑝 has not yet been inserted into a sub-block, it cannot be in 𝖠𝗏𝗈𝗂𝖽𝖫𝗋𝗀, so it must be in 𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍.

5 Stabilising New Bottom States

In this section we explain 𝗌𝗍𝖺𝖻𝗂𝗅𝗂𝗌𝖾 given in Algorithm 3. The procedure 𝗌𝗍𝖺𝖻𝗂𝗅𝗂𝗌𝖾 goes through all blocks with new bottom states and completely stabilises them.

Algorithm 3 shows the pseudocode of the stabilisation. In lines 3.33.7, all transitions out of the states in blocks with new bottom states are collected in 𝒬^. Additionally, all non-𝒞-inert transitions out of bottom states, which are all new, are put to the front of their BLC sets. In line 3.12 there is a call to four-way-split that only traverses these transitions in front of the BLC set to determine whether B needs to be split.

In lines 3.83.12, each BLC set is iteratively chosen as potential splitter 𝑆𝑝 and its source block B is stabilised under it. In the preparation phase of four-way-split, we can now visit the transitions in 𝑆𝑝 starting in bottom states without spending time to pick them from between those starting in non-bottom states. If this refinement leads to further new bottom states, the sub-block 𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍 is not empty. This block with new bottom states is immediately added to 𝒬^ as it requires to be stabilised again, see lines 3.133.17.

To ensure that every transition out of a new bottom state is visited only a bounded number of times, we have to take into account that some transitions out of the set 𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍 may already be in 𝒬^ and do not need to be added a second time.

6 Complexity

We attribute computation steps to certain transitions or states in the LTS to account for the time bound. There are three kinds of timing attributions:

C.

When a constellation C is split into B and CB, time is spent proportionally to the states and incoming and outgoing transitions of B.

B.

When a block B is split into 𝖠𝗏𝗈𝗂𝖽𝖫𝗋𝗀, 𝖠𝗏𝗈𝗂𝖽𝖲𝗆𝗅, 𝖱𝖾𝖺𝖼𝗁𝖠𝗅𝗐 and 𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍, time is spent proportionally to the states and incoming and outgoing transitions of the three smallest sub-blocks.

N.

When a new bottom state is found, time is spent proportionally to this state and its outgoing transitions.

We first formulate three lemmas to distribute all execution steps (except the initialisation) over the three cases above, and then state the main timing result.

Lemma 6.1.

Every step in four-way-split (Algorithm 2) falls under one of the timing items C, B, or N above.

Proof.

We can ignore the coroutine for the largest sub-block because it is aborted as soon as it is clearly the largest (line 2.13) or the three other coroutines are finished. The time it spends is at most proportional to the time attribution of the second-largest coroutine.

Initialisation (lines 2.22.11):

If the function is called from the main algorithm, 𝑆𝑚𝑎𝑙𝑙𝑆𝑝 either consists of outgoing transitions of B (line 1.8) or of incoming transitions of B (lines 1.14 and 1.18). Then the sets 𝖱𝖾𝖺𝖼𝗁𝖠𝗅𝗐, 𝖠𝗏𝗈𝗂𝖽𝖫𝗋𝗀, 𝖠𝗏𝗈𝗂𝖽𝖲𝗆𝗅, pot-ReachAlw and 𝖧𝗂𝗍𝖲𝗆𝖺𝗅𝗅 can be initialised by going through the transitions in 𝑆𝑚𝑎𝑙𝑙𝑆𝑝, which falls under timing item C. Note that we require that for states with a transition in 𝑆𝑚𝑎𝑙𝑙𝑆𝑝, one can determine in time O(1) whether they have a transition in 𝐿𝑎𝑟𝑔𝑒𝑆𝑝. This allows to distinguish 𝖱𝖾𝖺𝖼𝗁𝖠𝗅𝗐 from 𝖠𝗏𝗈𝗂𝖽𝖫𝗋𝗀 and pot-ReachAlw from 𝖧𝗂𝗍𝖲𝗆𝖺𝗅𝗅.

If the function is called from 𝗌𝗍𝖺𝖻𝗂𝗅𝗂𝗌𝖾 (line 3.12), 𝑆𝑚𝑎𝑙𝑙𝑆𝑝=, and 𝐿𝑎𝑟𝑔𝑒𝑆𝑝 consists of outgoing transitions of a block with new bottom states. Then the sets 𝖱𝖾𝖺𝖼𝗁𝖠𝗅𝗐 and 𝖠𝗏𝗈𝗂𝖽𝖫𝗋𝗀 can be distinguished by going through those transitions in 𝐿𝑎𝑟𝑔𝑒𝑆𝑝 that start in (new) bottom states, which falls under timing item N. The other sets in the initialisation are empty. Note that we only spend time on transitions in 𝐿𝑎𝑟𝑔𝑒𝑆𝑝 starting in bottom states because we singled them out in lines 3.6 and 3.16.

All coroutines:

Every coroutine generally runs a loop over all states in the respective sub-block and its incoming transitions. This can immediately be attributed to timing item B.

Coroutine

for 𝗔𝘃𝗼𝗶𝗱𝗟𝗿𝗴 (lines 2.292.33 left):  The coroutine for 𝖠𝗏𝗈𝗂𝖽𝖫𝗋𝗀, once it has found a state t with t.𝑐𝑜𝑢𝑛𝑡=0, still needs to check whether t has a transition in 𝐿𝑎𝑟𝑔𝑒𝑆𝑝 that could not be handled during initialisation. Depending on the outcome of this check, we attribute the time spent on the loop in lines 2.292.33 left differently:

  • If t has no transition in 𝐿𝑎𝑟𝑔𝑒𝑆𝑝, we conclude that t𝖠𝗏𝗈𝗂𝖽𝖫𝗋𝗀, and we can attribute the time to the outgoing transitions of 𝖠𝗏𝗈𝗂𝖽𝖫𝗋𝗀, i.e. to timing item B.

  • If, however, t has a transition in 𝐿𝑎𝑟𝑔𝑒𝑆𝑝, it is added to 𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍 in line 2.32 left, and it becomes a new bottom state: all its outgoing -inert transitions point to another sub-block (namely 𝖠𝗏𝗈𝗂𝖽𝖫𝗋𝗀). Therefore we can attribute this to timing item N.

Finalising a sub-block R=𝖱𝖾𝖺𝖼𝗁𝖠𝗅𝗐, 𝖠𝗏𝗈𝗂𝖽𝖲𝗆𝗅 or 𝖠𝗏𝗈𝗂𝖽𝖫𝗋𝗀:

In line 2.38 left, states in pot-RR are moved to 𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍. Every such state has a transition to R, so this is attributed to timing item B. In lines 2.392.40 left, the 𝖧𝗂𝗍𝖲𝗆𝖺𝗅𝗅-states are moved to 𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍. Because |𝖧𝗂𝗍𝖲𝗆𝖺𝗅𝗅||𝑆𝑚𝑎𝑙𝑙𝑆𝑝|, we can attribute this to timing item C.

Coroutine for 𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍:

This coroutine has an outer infinite loop in line 2.14 right, when all states that are known to be in 𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍 are already explored and the coroutine has to wait until a different coroutine adds another state to 𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍. Note that this will only happen as long as at least two coroutines different from 𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍 are running. So, we can attribute the waiting time to the smaller of the two sub-blocks. When only the coroutines for 𝖠𝗏𝗈𝗂𝖽𝖫𝗋𝗀 and 𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍 are unfinished, the latter goes through the transitions in 𝐿𝑎𝑟𝑔𝑒𝑆𝑝 in lines 2.242.27 right. Source states of these transitions cannot be in 𝖠𝗏𝗈𝗂𝖽𝖫𝗋𝗀, so they either are in a finished sub-block (and then that sub-block is not the largest one, so we are allowed to spend time on its outgoing transitions under timing item B) or they are in 𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍 (and then they also fall under timing item B).

Final administration (lines 2.422.46):

This can be organised in a way that only the states in the three smallest sub-blocks and their outgoing transitions are moved to new blocks and new BLC sets, respectively. So, we attribute it to timing item B.

Lemma 6.2.

Every step in 𝗌𝗍𝖺𝖻𝗂𝗅𝗂𝗌𝖾 (Algorithm 3) falls under one of the timing items C, B, or N above.

Proof.

It can happen that we have to stabilise a block with new bottom states under BLC sets whose transitions all start in non-bottom states, but then after the respective call to four-way-split, this BLC set will contain a transition that starts in a new bottom state. We denote the set of the new bottom states together with these prospective new bottom states by “𝐵𝑜𝑡𝑡𝑜𝑚+(B)”.

Initialisation (lines 3.33.7):

If one adds transitions to 𝒬^ in constant time per BLC set in line 3.4, then time O(|𝐵𝑜𝑡𝑡𝑜𝑚+(B)|) is spent. Lines 3.53.7 access new bottom states and their outgoing transitions. All these steps can be attributed to timing item N.

Main loop (lines 3.83.12):

In every iteration one BLC set in 𝒬^ is handled, so there cannot be more iterations than transitions starting in 𝐵𝑜𝑡𝑡𝑜𝑚+(B) (summed over all blocks B with new bottom states). The call to four-way-split is attributed according to Lemma 6.1.

Adding another new bottom block (lines 3.133.17):

This is the same operation as the loop body for the initialisation (lines 3.43.7), so we can attribute the timing in the same way. When adding new transitions to 𝒬^, one only has to take care not to spend time on BLC sets that have been added already earlier.

Lemma 6.3.

Every step in the main loop in Algorithm 1 (lines 1.41.19) falls under one of the timing items C, B, or N above.

Proof.

Splitting a constellation (lines 1.41.8):

This part of the algorithm handles the states and transitions of B and is attributed to timing item C.

Stabilising under B and CB (lines 1.91.19):

Except for the calls to four-way-split and 𝗌𝗍𝖺𝖻𝗂𝗅𝗂𝗌𝖾 (which fall under Lemmas 6.1 and 6.2), these lines use constant time per iteration. Because 𝑖𝑛(B), there are not too many iterations.

Theorem 6.4.

Under the reasonable assumption |𝐴𝑐𝑡|O(m) and nO(m), the running time of Algorithm 1 including its subroutines is in O(mlogn).

Proof.

Initialisation.

The calculation of the τ-SCCs (line 1.1) takes O(m) time via a standard algorithm [13]. Line 1.2 includes constructing the initial BLC sets. The essential step is to (bucket-)sort the transitions according to actions in time O(|𝐴𝑐𝑡|+m)=O(m).

Steps under timing item C.

State s can be in the small new constellation B (line 1.6) at most log2n times. Whenever this happens, time in O(1+|𝑖𝑛(s)|+|𝑜𝑢𝑡(s)|) is spent. Summing over all states, the total running time under timing item C is in O(mlogn).

Steps

under timing item B.  State s can be in a small sub-block (when calling four-way-split) at most log2n times. Whenever this happens, time in O(1+|𝑖𝑛(s)|+|𝑜𝑢𝑡(s)|) is spent. Summing over all states, the total running time under timing item B is in O(mlogn).

Steps under timing item N.

State s is treated as new bottom state at most once during the whole algorithm. When this happens, time in O(1+|𝑜𝑢𝑡(s)|) is spent. Summing over all states, the total running time under timing item N is in O(m).

As now every part of the algorithm is accounted for, either directly or through one of the above lemmas, the result follows.

Data Structures that Satisfy the Timing Constraints.

We believe that many data structures are straightforward to implement, and we only describe the less obvious data structures here.

Transitions are stored in three orderings: incoming transitions per state (used e.g. in lines 1.61.7 and 2.16), outgoing transitions per state (used e.g. in lines 2.30 left and 3.6), and transitions per BLC set (used e.g. in lines 2.24 right and 3.4). The outgoing transitions are grouped per label and target constellation, and every block has a list of BLC sets with transitions that start in this block.

When splitting a constellation (line 1.6), the groups for outgoing transitions per state to C are split into two, such that the groups for 𝑆𝑚𝑎𝑙𝑙𝑆𝑝 and 𝐿𝑎𝑟𝑔𝑒𝑆𝑝 are next to each other. This allows to find out quickly whether a state with an outgoing transition in one of them also has a transition in the other (used to distinguish 𝖱𝖾𝖺𝖼𝗁𝖠𝗅𝗐 from 𝖠𝗏𝗈𝗂𝖽𝖫𝗋𝗀 and pot-ReachAlw from 𝖧𝗂𝗍𝖲𝗆𝖺𝗅𝗅 in lines 2.22.8). Similarly, the list entries for BLC sets containing transitions to C are split into two adjacent ones, and line 1.16 can find 𝐿𝑎𝑟𝑔𝑒𝑆𝑝 (given 𝑆𝑚𝑎𝑙𝑙𝑆𝑝) in time O(1).

During 𝗌𝗍𝖺𝖻𝗂𝗅𝗂𝗌𝖾, we place BLC sets that are in 𝒬^ near the end of the list, so that line 3.14 only spends time on BLC sets that are currently not in 𝒬^.

To be absolutely sure that our correctness and timing analysis, as well as the implementation are correct we instrumented the implementation with both assertions and counters counting each operation on states and transitions and ran it on a large number of transition systems, most of which were randomly generated. Besides the invariants and the overall time bounds, it is checked that after the coroutines are finished, the counters for the largest sub-block have not been increased more often than the others, and also that the coroutine for 𝖭𝖾𝗐𝖡𝗈𝗍𝖲𝗍 did not wait too often without doing assignable work.

Table 1: Branching bisimulation benchmarks. – Running times are rounded to significant digits; trailing zeroes without following decimal point are insignificant. Bold times indicate the algorithm that is faster with 95% confidence.
After SCC After reduction JGKW This paper
#states #trans #states #trans time memory time memory
vasy_574_13561 .57M 1.4M 3,577 16,168 20.0 s 01.30G 10.0 s 0.91G
vasy_6020_19353 1.40M 3.9M 256 510 1.7 s 00.83G 3.0 s 0.83G
vasy_1112_5290 1.10M 5.3M 265 1,300 11.0 s 00.56G 6.0 s 0.41G
cwi_2165_8723 .22M 8.7M 4,256 20,880 20.0 s 00.95G 10.0 s 0.71G
vasy_6120_11031 .61M 11.0M 2,505 5,358 20.0 s 01.40G 20.0 s 1.10G
vasy_2581_11442 2.60M 11.0M 704,737 3,972,600 30.0 s 01.40G 20.0 s 1.50G
vasy_4220_13944 4.20M 14.0M 1,186,266 6,863,329 40.0 s 02.10G 20.0 s 1.40G
vasy_4338_15666 4.30M 16.0M 704,737 3,972,600 50.0 s 01.80G 30.0 s 1.80G
cwi_2416_17605 2.20M 16.0M 730 2,899 9.0 s 01.60G 20.0 s 1.10G
vasy_11026_24660  11.00M 25.0M 775,618 2,454,834 80.0 s 02.90G 60.0 s 2.60G
vasy_12323_27667  12.00M 28.0M 876,944 2,780,022 90.0 s 03.30G 70.0 s 3.00G
vasy_8082_42933 8.10M 42.0M 290 680 90.0 s 04.50G 50.0 s 3.30G
cwi_7838_59101 7.80M 58.0M 62,031 470,230 200.0 s 05.90G 120.0 s 4.20G
1394-fin-vvlarge  38.94M 85.6M 607,942 1,590,210 300.0 s 10.00G 200.0 s 8.10G
cwi_33949_165318  34.00M 165.0M 12,463 71,466 500.0 s 01.80G 500.0 s 1.30G

7 Benchmarks

In Table 1 we show some benchmarks illustrating the performance of the new algorithm. The benchmarks are mainly taken from the VLTS benchmark set111http://cadp.inria.fr/resources/vlts.. We show the number of states and transitions after removal of τ-cycles under the header “After SCC”. In the next columns the number of states after branching bisimulation reduction are given. Subsequently, the time and memory required to apply branching bisimulation algorithms are given where the time is taken to calculate the branching bisimulation equivalence classes starting with the τ-loop reduced transition systems. We compare the fastest known branching bisimulation algorithm headed “JGKW” with the algorithm presented in this paper. The row starting with 1394-fin-vvlarge reports on reducing the state space obtained from the mCRL2 model of the 1394 firewire protocol with 20 data elements as described in [3].

The results are obtained on a computer with an Intel Xeon Gold 6136 CPU at 3.00GHz processors and plenty of memory. Every benchmark was run 30 times. We removed the five fastest and the five slowest times and report the average of the remaining 20. Times are rounded to significant digits; trailing zeroes not followed by a decimal point are insignificant. The algorithm in this paper has almost always a better time and memory performance than JGKW. We also implemented optimisations, one of which performs initialisation without BLC sets. Never being detrimental, this further reduces the running time up to a factor 2. But as they are not in line with the presented algorithm we decided not to report them.

In both compared implementations states and label indices are stored as 64-bit numbers. We can substantially cut down on memory requirements by compressing these encodings, as is for instance done in [9], where incidentally an algorithm for strong bisimulation is compared to an algorithm for branching bisimulation applied to calculate a strong bisimulation reduction. As such comparisons are not very informative, we took care that the implementations of the two algorithms use the same implementation style. Both compared algorithms, along with a number of others, can be tried in the freely available mCRL2 toolset [6] available at https://www.mcrl2.org and are part of the summer 2025 release. This toolset is open-source, which means that that the complex implementation code for these algorithms can be extracted and used elsewhere if so desired.

References

  • [1] Rocco De Nicola and Frits Vaandrager. Action versus state based logics for transition systems. In I. Guessarian, editor, Semantics of systems of concurrent processes: LITP spring school on theoretical computer science, volume 469 of LNCS, pages 407–419. Springer, Berlin, 1990. doi:10.1007/3-540-53479-2_17.
  • [2] Jean-Claude Fernandez. An implementation for an efficient algorithm for bisimulation equivalence. Science of Computer Programming, 13(2–3):219–236, 1990. doi:10.1016/0167-6423(90)90071-K.
  • [3] Hubert Garavel and Bas Luttik. Four formal models of IEEE 1394 link layer. In Frédéric Lang and Matthias Volk, editors, Proceedings Sixth Workshop on Models for Formal Analysis of Real System [MARS], volume 399 of EPTCS, pages 21–100, 2024. doi:10.4204/EPTCS.399.5.
  • [4] Rob J. van Glabbeek and W. Peter Weijland. Branching time and abstraction in bisimulation semantics. J. ACM, 43(3):555–600, 1996. doi:10.1145/233551.233556.
  • [5] Jan Friso Groote, David N. Jansen, Jeroen J.A. Keiren, and Anton J. Wijs. An O(mlogn) algorithm for computing stuttering equivalence and branching bisimulation. ACM Trans. Comput. Logic, 18(2):Article 13, 2017. doi:10.1145/3060140.
  • [6] Jan Friso Groote and Mohammad Reza Mousavi. Modeling and Analysis of Communicating Systems. MIT Press, 2014. URL: https://mitpress.mit.edu/9780262547871/.
  • [7] Jan Friso Groote and Frits Vaandrager. An efficient algorithm for branching bisimulation and stuttering equivalence. In M. S. Paterson, editor, Automata, languages and programming [ICALP], volume 443 of LNCS, pages 626–638. Springer, Berlin, 1990. doi:10.1007/BFb0032063.
  • [8] Jan Friso Groote and Anton Wijs. An O(mlogn) algorithm for stuttering equivalence and branching bisimulation. In Marsha Chechik and Jean-François Raskin, editors, Tools and algorithms for the construction and analysis of systems: TACAS, volume 9636 of LNCS, pages 607–624. Springer, Berlin, 2016. doi:10.1007/978-3-662-49674-9_40.
  • [9] Jules Jacobs and Thorsten Wißmann. Fast coalgebraic bisimilarity minimization. Proc. ACM Program. Lang., 7(POPL):1514–1541, 2023. doi:10.1145/3571245.
  • [10] David N. Jansen, Jan Friso Groote, Jeroen J.A. Keiren, and Anton Wijs. An O(m log n) algorithm for branching bisimilarity on labelled transition systems. In Armin Biere and David Parker, editors, Tools and Algorithms for the Construction and Analysis of Systems: TACAS, Part II, volume 12079 of LNCS, pages 3–20. Springer, Cham, 2020. doi:10.1007/978-3-030-45237-7_1.
  • [11] Robin Milner. A Calculus of Communicating Systems, volume 92 of LNCS. Springer, Berlin, 1980. doi:10.1007/3-540-10235-3.
  • [12] Robert Paige and Robert E. Tarjan. Three partition refinement algorithms. SIAM J. Comput., 16(6):973–989, 1987. doi:10.1137/0216062.
  • [13] Robert Tarjan. Depth-first search and linear graph algorithms. SIAM J. Comput., 1(2):146–160, 1972. doi:10.1137/0201010.
  • [14] Antti Valmari. Bisimilarity minimization in O(mlogn) time. In Giuliana Franceschinis and Karsten Wolf, editors, Applications and Theory of Petri Nets: PETRI NETS, volume 5606 of LNCS, pages 123–142. Springer, Berlin, 2009. doi:10.1007/978-3-642-02424-5_9.