A State-Based O(m log n) Partitioning Algorithm for Branching Bisimilarity
Abstract
We present a new 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 statesFunding:
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:
2012 ACM Subject Classification:
Theory of computation Design and analysis of algorithms ; Software and its engineering Formal software verificationEditors:
Patricia Bouyer and Jaco van de PolSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
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 -algorithm (where is the number of transitions and 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 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 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 where
-
1.
is a finite set of states. The number of states is denoted by .
-
2.
is a finite set of actions including the internal action .
-
3.
is a transition relation. The number of transitions is always finite.
It is common to write for . We write instead of for . We also write for the set of transitions , and likewise for the set . We refer to all actions except as the visible actions. The transitions labelled with are called invisible. If , we say that from , the state , the action , and the transition are reachable. We write for the incoming transitions of state and for the outgoing transitions of . Likewise, we write and for all incoming and outgoing transitions of a set .
Definition 2.2 (Branching bisimilarity).
Let be a labelled transition system. We call a relation a branching bisimulation relation iff it is symmetric and for all such that and all transitions we have:
-
1.
and , or
-
2.
there is a sequence such that and .
Two states and are branching bisimilar, denoted by , iff there is a branching bisimulation relation such that .
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 , a transition is called -inert iff and . If such that for , we say that the state , the action , and the transition are -inertly reachable from . 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 .
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 it holds that for all .
In every set of states , the states without -transition to another state in are called bottom states. The set of bottom states in is denoted by . Lemma 3.1 implies the following lemma:
Lemma 3.2.
For every nonempty set of states , we have
-
1.
.
-
2.
For every state , there is a path of -transitions within 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 a partition of is a disjoint cover of , i.e., such that for all and .
A partition is a refinement of , and is coarser than , iff for every there is some such that .
A partition induces an equivalence relation in the following way: iff there is some containing both and . We call a transition -inert iff it is -inert, i.e., exactly if it is a transition with for some .
Our algorithm uses two partitions and of states. The main partition contains blocks, typically denoted with the letter , 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 , if , then there is some block such that .
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 . We say that two states are stable under iff if for any then
-
either and ,
-
or there are and such that , and .
A partition of is stable under a set of states iff for all and it holds that and are stable under . If is stable under every 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 of which is a refinement. We call the blocks in constellations and we typically denote constellations with the letter .
The partition records the current knowledge about stability by guaranteeing that is always stable under each constellation . Using Lemma 3.2 this follows from the following invariant.
Invariant 3.5 ( is stable under the constellations in ).
If there is a transition with for some constellation and for some block , and the transition is not -inert (i.e., or ), then every bottom state has a transition in .
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 .
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 (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 splits a block in in at most four sub-blocks based on two disjoint sets of transitions SmallSp and LargeSp that start in . We require that at least one of these two sets is non-empty. If both are non-empty, every state in can -inertly reach a transition in at least one of the two. The four sub-blocks are the following:
- :
-
If , contains the states in that cannot -inertly reach . If , then .
- :
-
If , contains the states in that cannot -inertly reach . If , then .
- :
-
states in that can always -inertly reach both splitters and if both are non-empty. Otherwise, consists of states in 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 , must also be in .
- :
-
states in 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 contains two examples of how a block is split. Here unlabelled transitions are -inert transitions in . 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.
Proof.
-
1.
We use contraposition. Assume that . Then does not have an outgoing -inert transition. By construction ends up in one of the sets , and . Hence, .
-
2.
This follows by observing that if there is a bottom state where is any of the blocks , and which was not a bottom state in , then there is transition with but . Going through the various cases, it follows that cannot be in any of the three sets , and therefore must be part of .
-
3.
Using that Invariant 3.4 is valid for , we only need to show that two states that have been moved to different blocks in are not branching bisimilar.
Assume and . Then can -inertly reach . This means, using the invariant and the conditions of this lemma, it can reach a non--inert transition in . As , cannot mimic this transition, and hence . 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 . We claim that can -inertly reach both and unless they are empty, and can -inertly reach or . This can be seen as follows. If can -inertly reach but not (and ), then . Similarly, if can -inertly reach but not (and ), then . So, can reach all non-empty splitters. As , it can -inertly reach a bottom state . As (by dictum 1), we have or .
If or , then can -inertly reach a non--inert transition in or , respectively, that cannot mimic.
Now consider . We know that can -inertly reach a state , and as argued above . Suppose we can find a state reachable with internal transitions from that mimics the path from to such that . Using Invariant 3.4 for , must be -inertly reachable and . But then and . So, no such exists, and hence .
The following lemma explains which calls to are needed to reestablish Invariant 3.5 after splitting a constellation . 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 for some and and .
Let be the result of the iterative refinements with the mentioned sets being the results of the following calls. Assume that for every action these calls take place for blocks satisfying the indicated conditions such that is covered by these blocks , blocks not satisfying the conditions, singleton blocks with , or blocks that refine some block :
Then Invariant 3.5 holds for all blocks in (except for those that refine some block ) and .
Proof.
Consider a state for any block not refining any . Assume that a non--inert transition exists with for some constellation . So, or . We must prove that any has a transition with .
Let be the block . Note that by Lemma 3.7.2.
- Case :
-
That means that . Using Invariant 3.5 (for and ), has a transition with .
- Case , and :
-
If , then were -inert. So, we can assume . There is a block with such that a call
must have taken place. In this case is a sub-block of or . In the last case there is nothing to check. But implies that has a transition with , as had to be shown.
- Case ( or ) and :
-
If , we know by Invariant 3.5 (for and ) that has a transition with , and as the transition cannot go to , it must go to , which we had to prove.
Otherwise, , and there is a block with for which a call
took place with a sub-block of , or . The last case does not lead to a proof obligation. But or implies that has a transition with , as had to be shown.
- Case , and :
-
If , then were -inert. So we can assume . There is a block with such that a call
must have taken place, where is a sub-block of or . The latter case is not interesting. Again, implies that has a transition with , as had to be shown.
- Case ( or ) and :
-
If , we know by Invariant 3.5 (for and ) that has a transition with , and as the transition cannot go to , it must go to , which we had to prove.
Otherwise, , and there is a block such that and a call
must have taken place, and is a subset of or or . We can ignore the latter case. But or implies that has a transition with , 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.
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 . This makes Invariant 3.4 trivially true.
If a block has new bottom states, we use the predicate to indicate so. This is not only the case when block 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 into a partition such that all bottom states in each block 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 with size smaller than or equal to . We replace the constellation in by two new constellations and (line 1.6).
Our main task is to make Invariant 3.5 valid again. This is done by taking care that all calls to 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 for a specific block , action , and constellation . 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 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 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 for some block is selected. For the complexity, it is important that as this implies that the selected BLC set is small, hence its name.
If 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 and was part of the constellation (line 1.13). As does not contain -transitions from to , this means and the required second call in Lemma 3.8 is made. The other situation, i.e., the else part at lines 1.15–1.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 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 preserves it (see Lemma 3.7.3), and, as explained in Section 5, refines only using 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 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
This section explains how refines block under two splitters, i.e., sets of transitions and . The sets contain all transitions from with a given label to one or two given constellations.
Splitting block must be done in a time proportional to the size of and the sizes of all but the largest block into which is split. The principle “process the smaller half” then implies that every state and transition is only visited 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 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.2–2.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.2–2.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 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.
Coroutines: Extending the Splits to Non-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.12–2.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 , 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 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.29–2.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.39–2.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.
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.3–3.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 that only traverses these transitions in front of the BLC set to determine whether needs to be split.
In lines 3.8–3.12, each BLC set is iteratively chosen as potential splitter and its source block is stabilised under it. In the preparation phase of , 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.13–3.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 is split into and , time is spent proportionally to the states and incoming and outgoing transitions of .
- B.
-
When a block 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 (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.2–2.11):
-
If the function is called from the main algorithm, either consists of outgoing transitions of (line 1.8) or of incoming transitions of (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 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.29–2.33 left): The coroutine for , once it has found a state with , still needs to check whether 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.29–2.33 left differently:
-
If has no transition in , we conclude that , and we can attribute the time to the outgoing transitions of , i.e. to timing item B.
-
If, however, 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 , or :
- 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.24–2.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.42–2.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 , 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 “”.
- Initialisation (lines 3.3–3.7):
- Main loop (lines 3.8–3.12):
-
In every iteration one BLC set in is handled, so there cannot be more iterations than transitions starting in (summed over all blocks with new bottom states). The call to is attributed according to Lemma 6.1.
- Adding another new bottom block (lines 3.13–3.17):
Proof.
Theorem 6.4.
Under the reasonable assumption and , the running time of Algorithm 1 including its subroutines is in .
Proof.
- Initialisation.
- Steps under timing item C.
-
State can be in the small new constellation (line 1.6) at most times. Whenever this happens, time in is spent. Summing over all states, the total running time under timing item C is in .
- Steps
-
under timing item B. State can be in a small sub-block (when calling ) at most times. Whenever this happens, time in is spent. Summing over all states, the total running time under timing item B is in .
- Steps under timing item N.
-
State is treated as new bottom state at most once during the whole algorithm. When this happens, time in is spent. Summing over all states, the total running time under timing item N is in .
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.6–1.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 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.2–2.8). Similarly, the list entries for BLC sets containing transitions to are split into two adjacent ones, and line 1.16 can find (given ) in time .
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.
| 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 s | 1.3G | 10 s | .91G |
| vasy_6020_19353 | 1.4M | 3.9M | 256 | 510 | 1.7 s | .83G | 3. s | .83G |
| vasy_1112_5290 | 1.1M | 5.3M | 265 | 1,300 | 11. s | .56G | 6. s | .41G |
| cwi_2165_8723 | .22M | 8.7M | 4,256 | 20,880 | 20 s | .95G | 10 s | .71G |
| vasy_6120_11031 | .61M | 11M | 2,505 | 5,358 | 20 s | 1.4G | 20 s | 1.1G |
| vasy_2581_11442 | 2.6M | 11M | 704,737 | 3,972,600 | 30 s | 1.4G | 20 s | 1.5G |
| vasy_4220_13944 | 4.2M | 14M | 1,186,266 | 6,863,329 | 40 s | 2.1G | 20 s | 1.4G |
| vasy_4338_15666 | 4.3M | 16M | 704,737 | 3,972,600 | 50 s | 1.8G | 30 s | 1.8G |
| cwi_2416_17605 | 2.2M | 16M | 730 | 2,899 | 9. s | 1.6G | 20 s | 1.1G |
| vasy_11026_24660 | 11M | 25M | 775,618 | 2,454,834 | 80 s | 2.9G | 60 s | 2.6G |
| vasy_12323_27667 | 12M | 28M | 876,944 | 2,780,022 | 90 s | 3.3G | 70 s | 3.0G |
| vasy_8082_42933 | 8.1M | 42M | 290 | 680 | 90 s | 4.5G | 50 s | 3.3G |
| cwi_7838_59101 | 7.8M | 58M | 62,031 | 470,230 | 200 s | 5.9G | 120 s | 4.2G |
| 1394-fin-vvlarge | 38M | 85M | 607,942 | 1,590,210 | 300 s | 10G | 200 s | 8.1G |
| cwi_33949_165318 | 34M | 165M | 12,463 | 71,466 | 500 s | 1.8G | 500 s | 1.3G |
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 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 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 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.
