pub fn strong_bisim_sigref(lts: &LabelledTransitionSystem, timing: &mut Timing) -> IndexedPartition {
let partition = signature_refinement::<_, _, false>(lts, &incoming, |state_index, partition, _, builder| {
pub fn strong_bisim_sigref_naive(lts: &LabelledTransitionSystem, timing: &mut Timing) -> IndexedPartition {
pub fn branching_bisim_sigref(lts: &LabelledTransitionSystem, timing: &mut Timing) -> IndexedPartition {
signature_refinement::<_, _, true>(&preprocessed_lts, &incoming, |state_index, partition, state_to_key, builder| {
branching_bisim_signature_inductive(state_index, &preprocessed_lts, partition, state_to_key, builder);
if *label == lts.num_of_labels() && key_to_signature[*key].is_subset_of(signature, (*label, *key)) {
/// Computes a branching bisimulation partitioning using signature refinement without dirty blocks.
pub fn branching_bisim_sigref_naive(lts: &LabelledTransitionSystem, timing: &mut Timing) -> IndexedPartition {
branching_bisim_signature_sorted(state_index, &preprocessed_lts, partition, state_to_signature, builder);
fn signature_refinement<F, G, const BRANCHING: bool>(lts: &LabelledTransitionSystem, incoming: &IncomingTransitions,
partition.partition_marked_with(block_index, &mut split_builder, |state_index, partition| {
// Keep track of the index for every signature, either use the arena to allocate space or simply borrow the value.
fn signature_refinement_naive<F>(lts: &LabelledTransitionSystem, mut signature: F) -> IndexedPartition
// Keep track of the index for every state, either use the arena to allocate space or simply borrow the value.
"There can never be more splits than number of states, but at least two iterations for stability"
pub fn is_valid_refinement<F, P>(lts: &LabelledTransitionSystem, partition: &P, mut compute_signature: F) -> bool
// Check that the partition is indeed stable and as such is a quotient of strong bisimulation
let mut block_to_signature: Vec<Option<SignatureBuilder>> = vec![None; partition.num_of_blocks()];
trace!("State {state_index} has a different signature {signature:?} then the block {block} which has signature {block_signature:?}");
if strong_partition.block_number(state_index) == strong_partition.block_number(other_state_index) {
// If the states are together according to branching bisimilarity, then they should also be together according to strong bisimilarity.