mCRL2
Loading...
Searching...
No Matches
liblts_weak_bisim.h
Go to the documentation of this file.
1// Author(s): Jan Friso Groote (upon request by Matthew Hennessy)
2// Copyright: see the accompanying file COPYING or copy at
3// https://github.com/mCRL2org/mCRL2/blob/master/COPYING
4//
5// Distributed under the Boost Software License, Version 1.0.
6// (See accompanying file LICENSE_1_0.txt or copy at
7// http://www.boost.org/LICENSE_1_0.txt)
8//
14
15#ifndef _LIBLTS_WEAK_BISIM_H
16#define _LIBLTS_WEAK_BISIM_H
20#include "mcrl2/lts/lts_aut.h"
21#include "mcrl2/lts/lts_fsm.h"
22#include "mcrl2/lts/lts_dot.h"
23
24namespace mcrl2
25{
26namespace lts
27{
28namespace detail
29{
30
35template < class LTS_TYPE>
37 LTS_TYPE& l,
38 const bool preserve_divergences = false)
39{
40 if (1 < l.num_states())
41 {
42 bisimulation_reduce_dnj(l, true, preserve_divergences); //< Apply branching bisimulation to l.
43 }
44
45 std::size_t divergence_label;
46 if (preserve_divergences)
47 {
48 divergence_label=mark_explicit_divergence_transitions(l);
49 }
50 if (1 < l.num_states())
51 {
52 reflexive_transitive_tau_closure(l); // Apply transitive tau closure to l.
53 bisimulation_reduce_dnj(l, false, false); // Apply strong bisimulation to l.
54 }
55 scc_reduce(l); // Remove tau loops.
56 remove_redundant_transitions(l); // Remove transitions s -a-> s' if also s-a->-tau->s' or s-tau->-a->s' is present.
57 // Note that this is correct, because l is reduced modulo strong bisimulation and
58 // does not contain tau loops.
59 if (preserve_divergences)
60 {
62 }
63}
64
65
74template < class LTS_TYPE>
76 LTS_TYPE& l1,
77 LTS_TYPE& l2,
78 const bool preserve_divergences=false)
79{
80 weak_bisimulation_reduce(l1,preserve_divergences);
81 weak_bisimulation_reduce(l2,preserve_divergences);
83}
84
85
98template < class LTS_TYPE>
100 const LTS_TYPE& l1,
101 const LTS_TYPE& l2,
102 const bool preserve_divergences = false)
103{
104 LTS_TYPE l1_copy(l1);
105 LTS_TYPE l2_copy(l2);
106 return destructive_weak_bisimulation_compare(l1_copy, l2_copy,
107 preserve_divergences);
108}
109
110}
111}
112}
113#endif // #define _LIBLTS_WEAK_BISIM_H
bool destructive_bisimulation_compare_dnj(LTS_TYPE &l1, LTS_TYPE &l2, bool const branching=false, bool const preserve_divergence=false, bool const generate_counter_examples=false, const std::string &="", bool=false)
Checks whether the two initial states of two LTSs are strong or (divergence-preserving) branching bis...
void bisimulation_reduce_dnj(LTS_TYPE &l, bool const branching=false, bool const preserve_divergence=false)
Reduce transition system l with respect to strong or (divergence-preserving) branching bisimulation.
This file contains a class that contains labelled transition systems in aut format.
This file contains a class that contains labelled transition systems in dot format.
This file contains a class that contains labelled transition systems in fsm format.
void weak_bisimulation_reduce(LTS_TYPE &l, const bool preserve_divergences=false)
Reduce LTS l with respect to (divergence-preserving) weak bisimulation.
void unmark_explicit_divergence_transitions(LTS_TYPE &l, const std::size_t divergent_transition_label)
bool weak_bisimulation_compare(const LTS_TYPE &l1, const LTS_TYPE &l2, const bool preserve_divergences=false)
Checks whether the initial states of two LTSs are weakly bisimilar.
std::size_t mark_explicit_divergence_transitions(LTS_TYPE &l)
bool destructive_weak_bisimulation_compare(LTS_TYPE &l1, LTS_TYPE &l2, const bool preserve_divergences=false)
Checks whether the initial states of two LTSs are weakly bisimilar.
void remove_redundant_transitions(lts< STATE_LABEL_T, ACTION_LABEL_T, LTS_BASE_CLASS > &l)
Removes each transition s-a->s' if also transitions s-a->-tau->s' or s-tau->-a->s' are present....
void reflexive_transitive_tau_closure(lts< STATE_LABEL_T, ACTION_LABEL_T, LTS_BASE_CLASS > &l)
void scc_reduce(LTS_TYPE &l, const bool preserve_divergence_loops=false)
Definition liblts_scc.h:362
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
Definition indexed_set.h:72