mCRL2
|
classes to calculate the stutter equivalence quotient of a LTS More...
Classes | |
class | mcrl2::lts::detail::bisim_gjkw::bisim_partitioner_gjkw_initialise_helper< LTS_TYPE > |
helps with initialising the refinable partition data structure More... | |
class | mcrl2::lts::detail::bisim_gjkw::bisim_partitioner_gjkw_initialise_helper< LTS_TYPE >::Key |
class | mcrl2::lts::detail::bisim_gjkw::bisim_partitioner_gjkw_initialise_helper< LTS_TYPE >::KeyHasher |
class | mcrl2::lts::detail::bisim_partitioner_dnj< LTS_TYPE > |
implements the main algorithm for the branching bisimulation quotient More... | |
Macros | |
#define | BLOCK_NO_SEQNR ((state_type) -1) |
Friends | |
class | mcrl2::lts::detail::bisim_gjkw::state_info_entry::part_state_t |
class | mcrl2::lts::detail::bisim_gjkw::block_t::part_state_t |
template<class LTS_TYPE > | |
class | mcrl2::lts::detail::bisim_gjkw::part_state_t::bisim_partitioner_gjkw_initialise_helper |
template<class LTS_TYPE > | |
class | mcrl2::lts::detail::bisim_gjkw::part_trans_t::bisim_partitioner_gjkw_initialise_helper |
classes to calculate the stutter equivalence quotient of a LTS
#define BLOCK_NO_SEQNR ((state_type) -1) |
Definition at line 460 of file liblts_bisim_gjkw.h.
|
inline |
The function is meant to transfer work temporarily assigned to the B_to_C slice to the transitions in the slice. It is used during handling of new bottom states, so the work is only assigned to transitions that start in a (new) bottom state. If at this moment no such (new) bottom state has been found, the work is kept with the slice and the function returns false. The work should be transferred later (but if there is no later transfer, it should be tested that the function returns true).
Definition at line 1421 of file liblts_bisim_gjkw.h.
void mcrl2::lts::detail::bisim_gjkw::part_trans_t::assert_stability | ( | const part_state_t & | part_st | ) | const |
assert that the data structure is consistent and stable
The data structure is tested against a large number of assertions to ensure that everything is consistent, e. g. pointers that should point to successors of state s actually point to a transition that starts in s.
Additionally, it is asserted that the partition is stable. i. e. every bottom state in every block can reach exactly the constellations in the list of constellations that should be reachable from it, and every nonbottom state can reach a subset of them.
Definition at line 1019 of file liblts_bisim_gjkw.cpp.
|
inline |
assigns a unique sequence number
Definition at line 502 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 1634 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 1345 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 1635 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 595 of file liblts_bisim_gjkw.h.
|
inline |
iterator to the first state in the constellation
Definition at line 923 of file liblts_bisim_gjkw.h.
|
inline |
iterator to the first state in the block
Definition at line 594 of file liblts_bisim_gjkw.h.
|
inline |
constant iterator to the first state in the constellation
Definition at line 921 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 1779 of file liblts_bisim_gjkw.h.
mcrl2::lts::detail::bisim_gjkw::bisim_partitioner_gjkw_initialise_helper< LTS_TYPE >::bisim_partitioner_gjkw_initialise_helper | ( | LTS_TYPE & | l, |
bool | branching, | ||
bool | preserve_divergence | ||
) |
constructor of the helper class
Definition at line 1415 of file liblts_bisim_gjkw.cpp.
|
inline |
find block of a state
s | number of the state |
Definition at line 1108 of file liblts_bisim_gjkw.h.
|
inline |
constructor
The constructor initialises the block to: all states are bottom states, no state is marked, the block is not refinable.
constln_ | constellation to which the block belongs |
begin_ | initial iterator to the first state of the block |
end_ | initial iterator past the last state of the block |
Definition at line 474 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 625 of file liblts_bisim_gjkw.h.
|
inline |
iterator to the first bottom state in the block
Definition at line 624 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 635 of file liblts_bisim_gjkw.h.
|
inline |
iterator past the last bottom state in the block
Definition at line 634 of file liblts_bisim_gjkw.h.
succ_iter_t mcrl2::lts::detail::bisim_gjkw::part_trans_t::change_to_C | ( | pred_iter_t | pred_iter, |
ONLY_IF_DEBUG(constln_t *SpC, constln_t *NewC,) bool | first_transition_of_state, | ||
bool | first_transition_of_block | ||
) |
transition target is moved to a new constellation
part_trans_t::change_to_C has to be called after a transition target has changed its constellation. The member function will adapt the transition data structure. It assumes that the transition is non-inert and that the new constellation does not (yet) have inert incoming transitions. It returns the boundary between transitions to SpC and transitions to NewC in the state's outgoing transition array.
pred_iter | transition that has to be changed |
SpC | splitter constellation |
NewC | new constellation, where the transition goes to now |
first_transition_of_state | This is the first transition of the state, so a new constln slice is started. |
first_transition_of_block | This is the first transition of the block, so a new B_to_C slice has to be allocated. |
Definition at line 474 of file liblts_bisim_gjkw.cpp.
|
inline |
deallocates constellations and blocks
This function can be called shortly before destructing the partition. Afterwards, the data structure is in a unusable state, as all information on states, blocks and constellations is deleted and deallocated.
Definition at line 1069 of file liblts_bisim_gjkw.h.
|
inline |
clear allocated memory
Definition at line 1555 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 2004 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 578 of file liblts_bisim_gjkw.h.
|
inline |
get constellation where the state belongs
get the constellation of the state
Definition at line 1999 of file liblts_bisim_gjkw.h.
|
inline |
constellation where the block belongs to
Definition at line 577 of file liblts_bisim_gjkw.h.
|
inline |
constructor
begin_ | iterator to the first state in the constellation |
end_ | iterator past the last state in the constellation |
Definition at line 862 of file liblts_bisim_gjkw.h.
|
private |
Definition at line 1833 of file liblts_bisim_gjkw.cpp.
|
inline |
Definition at line 202 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 201 of file liblts_bisim_gjkw.h.
|
inline |
print a state identification for debugging
This function is only available if compiled in Debug mode.
Definition at line 346 of file liblts_bisim_gjkw.h.
|
inline |
print a block identification for debugging
This function is only available if compiled in Debug mode.
Definition at line 787 of file liblts_bisim_gjkw.h.
|
inline |
print a constellation identification for debugging
Definition at line 999 of file liblts_bisim_gjkw.h.
|
inline |
print a transition identification for debugging
This function is only available if compiled in Debug mode.
Definition at line 1301 of file liblts_bisim_gjkw.h.
|
inline |
print a B_to_C slice identification for debugging
This function is only available if compiled in Debug mode.
Definition at line 1384 of file liblts_bisim_gjkw.h.
|
inline |
print a short state identification for debugging
This function is only available if compiled in Debug mode.
Definition at line 337 of file liblts_bisim_gjkw.h.
|
inline |
print a short transition identification for debugging
This function is only available if compiled in Debug mode.
Definition at line 1293 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 603 of file liblts_bisim_gjkw.h.
|
inline |
iterator past the last state in the constellation
Definition at line 933 of file liblts_bisim_gjkw.h.
|
inline |
iterator past the last state in the block
Definition at line 602 of file liblts_bisim_gjkw.h.
|
inline |
constant iterator past the last state in the constellation
Definition at line 931 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 1355 of file liblts_bisim_gjkw.h.
|
inline |
compute the source block of the transitions in this slice
Definition at line 1351 of file liblts_bisim_gjkw.h.
|
inline |
read FromRed
Definition at line 2010 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 1810 of file liblts_bisim_gjkw.h.
|
inline |
provides the next non-trivial constellation
This (non-static!) function just returns the next non-trivial constellation in the list. Note: If this constellation is the last in the list of non-trivial constellations, the convention is that the next pointer points to this constellation self (to distinguish it from nullptr).
Definition at line 887 of file liblts_bisim_gjkw.h.
|
inline |
provides the number of states in the Kripke structure
Definition at line 1748 of file liblts_bisim_gjkw.h.
|
inline |
provides the number of transitions in the Kripke structure
Definition at line 1751 of file liblts_bisim_gjkw.h.
|
inlinestatic |
provides an arbitrary non-trivial constellation
The static function is implemented in a way to provide the first constellation in the list of non-trivial constellations.
Definition at line 879 of file liblts_bisim_gjkw.h.
|
inlinestatic |
provides an arbitrary refinable block
Definition at line 510 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 1815 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 718 of file liblts_bisim_gjkw.h.
|
inline |
iterator to the first inert transition of the block
Definition at line 717 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 726 of file liblts_bisim_gjkw.h.
|
inline |
iterator past the last inert transition of the block
Definition at line 725 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 256 of file liblts_bisim_gjkw.h.
|
inline |
iterator to first inert incoming transition
Definition at line 255 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 265 of file liblts_bisim_gjkw.h.
|
inline |
iterator one past the last inert incoming transition
Definition at line 264 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 291 of file liblts_bisim_gjkw.h.
|
inline |
iterator to first inert outgoing transition
Definition at line 290 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 310 of file liblts_bisim_gjkw.h.
|
inline |
iterator past the last inert outgoing transition
Definition at line 309 of file liblts_bisim_gjkw.h.
|
inline |
initialise the state in part_st and the transitions in part_tr
Definition at line 1501 of file liblts_bisim_gjkw.cpp.
|
inline |
checks whether the block is refinable
Definition at line 514 of file liblts_bisim_gjkw.h.
|
inline |
returns true iff the constellation is trivial
If this constellation is the last in the list of non-trivial constellations, the convention is that the next pointer points to this constellation itself (to distinguish it from nullptr).
Definition at line 915 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 1699 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 1597 of file liblts_bisim_gjkw.h.
|
inline |
makes a block non-refinable (i. e. removes it from the respective list)
This member function only works if the block is the first one in the list (which will normally be the case).
Definition at line 534 of file liblts_bisim_gjkw.h.
|
inline |
makes a constellation non-trivial (i. e. inserts it into the respective list)
Definition at line 901 of file liblts_bisim_gjkw.h.
|
inline |
makes a block refinable (i. e. inserts it into the respective list)
Definition at line 519 of file liblts_bisim_gjkw.h.
|
inline |
makes a constellation trivial (i. e. removes it from the respective list)
This member function only works if the constellation is the first one in the list (which will normally be the case).
Definition at line 893 of file liblts_bisim_gjkw.h.
|
inline |
mark a state
Marking is done by moving the state to the slice of the marked bottom or non-bottom states of the block. If s
is an old bottom state, it is treated as if it already were marked.
s | the state that has to be marked |
Definition at line 757 of file liblts_bisim_gjkw.h.
|
inline |
mark a non-bottom state
Marking is done by moving the state to the slice of the marked non-bottom states of the block.
s | the non-bottom state that has to be marked |
Definition at line 743 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 704 of file liblts_bisim_gjkw.h.
|
inline |
iterator to the first marked bottom state in the block
Definition at line 700 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 714 of file liblts_bisim_gjkw.h.
|
inline |
iterator past the last marked bottom state in the block
This includes the old bottom states.
Definition at line 713 of file liblts_bisim_gjkw.h.
|
inline |
provides the number of marked bottom states in the block
This size includes the old bottom states.
Definition at line 545 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 662 of file liblts_bisim_gjkw.h.
|
inline |
iterator to the first marked non-bottom state in the block
Definition at line 658 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 678 of file liblts_bisim_gjkw.h.
|
inline |
iterator one past the last marked non-bottom state in the block
Definition at line 674 of file liblts_bisim_gjkw.h.
|
inline |
provides the number of marked states in the block
This size includes the old bottom states; in other words, the old bottom states are always regarded as marked.
Definition at line 553 of file liblts_bisim_gjkw.h.
|
inline |
returns true iff the slice is marked for postprocessing
The function uses the data registered with the goal constellation.
Definition at line 1373 of file liblts_bisim_gjkw.h.
void mcrl2::lts::detail::bisim_gjkw::part_trans_t::new_blue_block_created | ( | block_t * | OldB, |
block_t * | NewB | ||
) |
handle B_to_C slices after a new blue block has been created
part_trans_t::new_blue_block_created splits the B_to_C-slices to reflect that some transitions now start in the new block NewB. They can no longer be in the same slice as the transitions that start in the old block. Its time complexity is O(1 + |out(NewB)|).
RfnB | the old block that has been refined (now the red subblock) |
NewB | the new block (the blue subblock) |
Definition at line 666 of file liblts_bisim_gjkw.cpp.
void mcrl2::lts::detail::bisim_gjkw::part_trans_t::new_red_block_created | ( | block_t * | OldB, |
block_t * | NewB, | ||
bool | postprocessing | ||
) |
handle B_to_C slices after a new red block has been created
part_trans_t::new_red_block_created splits the B_to_C-slices to reflect that some transitions now start in the new block NewB. They can no longer be in the same slice as the transitions that start in the old block. Its time complexity is O(1 + |out(NewB)|).
RfnB | the old block that has been refined (now the blue subblock) |
NewB | the new block (the red subblock) |
postprocessing | true iff the refinement happened during postprocessing. (Otherwise, the refinement should preserve the information about FromRed() ). |
Definition at line 837 of file liblts_bisim_gjkw.cpp.
|
inline |
Definition at line 611 of file liblts_bisim_gjkw.h.
|
inline |
iterator to the first non-bottom state in the block
Definition at line 610 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 615 of file liblts_bisim_gjkw.h.
|
inline |
iterator past the last non-bottom state in the block
Definition at line 614 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 248 of file liblts_bisim_gjkw.h.
|
inline |
iterator to first non-inert incoming transition
Definition at line 247 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 252 of file liblts_bisim_gjkw.h.
|
inline |
iterator past the last non-inert incoming transition
Definition at line 251 of file liblts_bisim_gjkw.h.
|
inlinestatic |
Definition at line 1805 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 1713 of file liblts_bisim_gjkw.h.
|
inline |
compares two blocks for ordering them
The blocks are ordered according to their positions in the permutation array. This is a suitable order, as blocks may be refined, but never swap positions as a whole. Refining will make the new subblocks compare in the same way to other blocks as the original, larger block.
Definition at line 571 of file liblts_bisim_gjkw.h.
|
inline |
compares two constellations for ordering them
Constellations are ordered according to their sort keys. The keys have to be assigned in a way that when a constellation is split, the parts are placed where the split constellation was in the order. This can be achieved by assigning sort keys that are related to the size of the constellation.
Definition at line 949 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 954 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 1704 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 953 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 955 of file liblts_bisim_gjkw.h.
|
inline |
constructor
The constructor allocates memory, but does not actually initialise the partition. Immediately afterwards, the initialisation helper bisim_partitioner_gjkw_initialise_helper::init_transitions()
should be called.
n | number of states in the Kripke structure |
Definition at line 1045 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 1545 of file liblts_bisim_gjkw.h.
|
inlinestatic |
provide an iterator to the beginning of the permutation array
This iterator is required to be able to print identifications for debugging. It is only available if compiled in Debug mode.
Definition at line 797 of file liblts_bisim_gjkw.h.
|
private |
Split a block with new bottom states as needed.
The function splits RedB by checking whether all new bottom states can reach the constellations that RedB can reach.
When this function starts, it assumes that the old bottom states of RedB are marked and the new ones are not. It is an error if RedB does not contain any new bottom states. The function implements Algorithm 4 of [GJKW 2017]. It first separates the old from the new bottom states; then it walks through all constellations that can be reached from the new bottom states to separate them into smaller, stable subblocks. The return value is the block containing the old bottom states, resulting from the first separation.
RedB | block containing new bottom states that need to be stabilised |
Definition at line 3018 of file liblts_bisim_gjkw.cpp.
|
inline |
Definition at line 226 of file liblts_bisim_gjkw.h.
|
inline |
iterator to first incoming transition
Definition at line 225 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 237 of file liblts_bisim_gjkw.h.
|
inline |
iterator past the last incoming transition
Definition at line 233 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 1636 of file liblts_bisim_gjkw.h.
|
private |
print a slice of the partition (typically a block)
If the slice indicated by the parameters is not empty, the states in this slice will be printed.
message | text printed as a title if the slice is not empty |
B | block that is being printed (it is checked whether states belong to this block) |
begin | iterator to the beginning of the slice |
end | iterator past the end of the slice |
Definition at line 221 of file liblts_bisim_gjkw.cpp.
void mcrl2::lts::detail::bisim_gjkw::part_state_t::print_part | ( | const part_trans_t & | part_tr | ) | const |
print the partition as a tree (per constellation and block)
The function prints all constellations (in order); for each constellation it prints the blocks it consists of; and for each block, it lists its states, separated into nonbottom and bottom states.
part_tr | partition for the transitions |
Definition at line 255 of file liblts_bisim_gjkw.cpp.
void mcrl2::lts::detail::bisim_gjkw::part_state_t::print_trans | ( | ) | const |
print all transitions
For each state (in order), its outgoing transitions are listed, sorted by goal constellation. The function also indicates where the current constellation pointer of the state points at.
Definition at line 309 of file liblts_bisim_gjkw.cpp.
|
private |
refine a block into the part that can reach SpC
and the part that cannot
At the beginning of a call to refine()
, the block RfnB is sliced into these parts:
| unmarked |marked | unmarked |marked| | non-bottom |non-bot| bottom |bottom|
The procedure will partition the block into two parts, called blue'' and
red''. The red part can reach the splitter constellation SpC
, the blue part cannot. Upon calling refine()
, it is known that all marked states are red.
If states with a strong transition to SpC
have not yet been found, the parameter FromRed
indicates all such transitions, so refine()
can easily find their sources. It is required that either some states are marked or a non-nullptr FromRed
is supplied. In the latter case, also the current constellation pointer of all unmarked bottom states is set in a way that it makes easy to check whether the state has a transition to SpC
. (Some non-bottom states may have their current constellation pointer set similarly; while this is not required, it still speeds up refine()
.)
refine()
works by starting two coroutines to find states in the parts; as soon as the first coroutine finishes, the refinement can be completed.
Refine slices these states further as follows:
refine_blue() refine_red() shared variable local variable local variable notblue_initialised_end visited_end visited_begin v v v | blue |notblue|notblue| red | blue |unknown|not blue| red | |non-bot| > 0 |undef'd| non-bottom|bottom|bottom | bottom | bottom | ^ ^ ^ refine_blue() block.unmarked_ block.unmarked_ local variable nonbottom_end() bottom_end() blue_nonbottom_end
Note that the slices of red non-bottom and the red bottom states may become larger than the marked (non-)bottom states have been at the start of refine()
. Upon termination of one of the two coroutines, states whose colour has not yet been determined become known to be of the colour of the unfinished coroutine.
RfnB | the block that has to be refined |
SpC | the splitter constellation |
FromRed | the set of transitions from RfnB to SpC |
size_SpB | (only used for measuring the time complexity, and only if called from line 2.26) the size of the original splitter block SpB, to which the work on red bottom states is ascribed. |
postprocessing | true iff refine() is called during postprocessing new bottom states |
RfnB
. The blue coroutine finds blue states in a block, i. e. states that cannot reach the splitter. It is one of the two coroutines that together implement the fast refinement of block RfnB
into states that can reach the splitter SpC
(red states) and those that cannot (blue states).
This coroutine assumes that RfnB
is nontrivial, i. e. contains at least two states. refine()
may be called in two ways: either the initially red states are marked, or a set of transitions from RfnB
to SpC
is given. In the first case, all unmarked bottom states are blue. In the second case, however, the first thing this coroutine has to do is to decide which bottom states are blue and which ones are not. In that case, it assumes that the current_constln
pointer of bottom states is pointing to a place where a transition to SpC
could be inserted. If there is already such a transition just before or after that memory location, the bottom state is actually red; otherwise, it is blue.
After having found the blue bottom states, the coroutine proceeds to find blue non-bottom states by walking through the predecessors of the blue states. As soon as can be determined that all inert outgoing transitions of a state lead to (other) blue states, this state is also blue – with one exception: if this state has a (non-inert) transition to the splitter. If refine()
was called in the second way, one has to check the outgoing non-inert transitions to find out whether such a transition exists.
As soon as it becomes clear that the blue subblock will be larger, this coroutine is aborted. Otherwise, at the end RfnB
is actually split into its two parts, and the coroutine closes with updating the inert-ness of transitions and finding new bottom states. New bottom states will be unmarked bottom states. (It may also happen that the blue subblock is empty; in that case, RfnB
is not split.)
The coroutine implements the left-hand side of Algorithm 3 in [GJKW 2017].
The red coroutine finds red states in a block, i. e. states that can reach the splitter. It is one of the two coroutines that together implement the fast refinement of block RfnB
into states that can reach the splitter (red states) and those that cannot (blue states).
This coroutine assumes that RfnB
is nontrivial, i. e. contains at least two states, and that there is at least one red state in RfnB
. The red states can be indicated in one of two ways: either some states of RfnB
are marked, or the parameter FromRed
indicates the set of transitions from RfnB
to the splitter. Exactly one of the two must be chosen: If and only if some states are marked, FromRed
should be nullptr
.
If FromRed
is not nullptr
, the coroutine first finds initially red states, i. e. states with a transition to the splitter, and marks them. Note that it may happen that some non-bottom states (or even only non-bottom states) may be initially red as well. When all initially red states are marked, it proceeds to find other red states by walking through the inert predecessors of red states. Every such predecessor is also a red state.
As soon as it becomes clear that the red subblock will be larger, this coroutine is aborted. Otherwise, at the end RfnB
is actually split into its two parts, and the coroutine closes with updating the inert-ness of transitions and finding new bottom states. New bottom states will be unmarked bottom states.
The coroutine implements the right-hand side of Algorithm 3 in [GJKW 2017].
The blue coroutine finds blue states in a block, i. e. states that cannot reach the splitter. It is one of the two coroutines that together implement the fast refinement of block RfnB
into states that can reach the splitter SpC
(red states) and those that cannot (blue states).
This coroutine assumes that RfnB
is nontrivial, i. e. contains at least two states. refine()
may be called in two ways: either the initially red states are marked, or a set of transitions from RfnB
to SpC
is given. In the first case, all unmarked bottom states are blue. In the second case, however, the first thing this coroutine has to do is to decide which bottom states are blue and which ones are not. In that case, it assumes that the current_constln
pointer of bottom states is pointing to a place where a transition to SpC
could be inserted. If there is already such a transition just before or after that memory location, the bottom state is actually red; otherwise, it is blue.
After having found the blue bottom states, the coroutine proceeds to find blue non-bottom states by walking through the predecessors of the blue states. As soon as can be determined that all inert outgoing transitions of a state lead to (other) blue states, this state is also blue – with one exception: if this state has a (non-inert) transition to the splitter. If refine()
was called in the second way, one has to check the outgoing non-inert transitions to find out whether such a transition exists.
As soon as it becomes clear that the blue subblock will be larger, this coroutine is aborted. Otherwise, at the end RfnB
is actually split into its two parts, and the coroutine closes with updating the inert-ness of transitions and finding new bottom states. New bottom states will be unmarked bottom states. (It may also happen that the blue subblock is empty; in that case, RfnB
is not split.)
The coroutine implements the left-hand side of Algorithm 3 in [GJKW 2017].
The red coroutine finds red states in a block, i. e. states that can reach the splitter. It is one of the two coroutines that together implement the fast refinement of block RfnB
into states that can reach the splitter (red states) and those that cannot (blue states).
This coroutine assumes that RfnB
is nontrivial, i. e. contains at least two states, and that there is at least one red state in RfnB
. The red states can be indicated in one of two ways: either some states of RfnB
are marked, or the parameter FromRed
indicates the set of transitions from RfnB
to the splitter. Exactly one of the two must be chosen: If and only if some states are marked, FromRed
should be nullptr
.
If FromRed
is not nullptr
, the coroutine first finds initially red states, i. e. states with a transition to the splitter, and marks them. Note that it may happen that some non-bottom states (or even only non-bottom states) may be initially red as well. When all initially red states are marked, it proceeds to find other red states by walking through the inert predecessors of red states. Every such predecessor is also a red state.
As soon as it becomes clear that the red subblock will be larger, this coroutine is aborted. Otherwise, at the end RfnB
is actually split into its two parts, and the coroutine closes with updating the inert-ness of transitions and finding new bottom states. New bottom states will be unmarked bottom states.
The coroutine implements the right-hand side of Algorithm 3 in [GJKW 2017].
Definition at line 2364 of file liblts_bisim_gjkw.cpp.
|
private |
Definition at line 1845 of file liblts_bisim_gjkw.cpp.
|
inline |
Definition at line 1798 of file liblts_bisim_gjkw.h.
void mcrl2::lts::detail::bisim_gjkw::bisim_partitioner_gjkw_initialise_helper< LTS_TYPE >::replace_transition_system | ( | const part_state_t & | part_st, |
ONLY_IF_DEBUG(bool branching,) bool | preserve_divergence | ||
) |
Replaces the transition relation of the current LTS by the transitions of the bisimulation-reduced transition system.
Each transition (s, l, s') is replaced by a transition (t, l, t'), where t and t' are the equivalence classes of s and s', respectively. If the label l is internal, then the transition is only added if t != t' or preserve_divergence == true. This effectively removes all inert transitions. Duplicates are removed from the transitions in the new LTS.
Note that the number of states nor the initial state are not adapted by this method. These must be set separately.
The code is very much inspired by liblts_bisim_gw.h, which was written by Anton Wijs.
branching | Causes non-internal transitions to be removed. |
Definition at line 1713 of file liblts_bisim_gjkw.cpp.
|
inline |
Definition at line 507 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 596 of file liblts_bisim_gjkw.h.
|
inline |
set the iterator to the first state in the constellation
Definition at line 925 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 626 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 579 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 203 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 604 of file liblts_bisim_gjkw.h.
|
inline |
set the iterator past the last state in the constellation
Definition at line 935 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 719 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 731 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 727 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 257 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 292 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 312 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 705 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 666 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 616 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 227 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 241 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 1223 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 270 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 284 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 693 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 650 of file liblts_bisim_gjkw.h.
|
inline |
set FromRed to an existing element in to_constln
Definition at line 2032 of file liblts_bisim_gjkw.h.
|
inline |
provides the number of states in the block
Definition at line 541 of file liblts_bisim_gjkw.h.
|
inline |
returns number of states in the constellation
Definition at line 941 of file liblts_bisim_gjkw.h.
|
inlinestatic |
adds work (for time complexity measurement) to every transition in the slice to which this_
belongs.
adds work (for time complexity measurement) to every transition in the slice.
Definition at line 1321 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 1229 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 1239 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 1213 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 1218 of file liblts_bisim_gjkw.h.
|
inlinestatic |
Definition at line 1263 of file liblts_bisim_gjkw.h.
|
inlinestatic |
Definition at line 1249 of file liblts_bisim_gjkw.h.
void mcrl2::lts::detail::bisim_gjkw::part_trans_t::split_inert_to_C | ( | block_t * | B | ) |
handle the transitions from the splitter to its own constellation
split_inert_to_C splits the B_to_C slice of block SpB to its own constellation into two slices: one for the inert and one for the non-inert transitions. It is called with SpB just after a constellation is split, as the transitions from SpB to itself (= the inert transitions) now go to a different constellation than the other transitions from SpB to its old constellation. It does, however, not adapt the other transition arrays to reflect that noninert and inert transitions from block SpB would go to different constellations.
Its time complexity is O(1+min{|out_noninert(SpB-->C)|, |inert_out(SpB)|}).
SpB | pointer to the splitter block |
Definition at line 392 of file liblts_bisim_gjkw.cpp.
block_t * mcrl2::lts::detail::bisim_gjkw::block_t::split_off_blue | ( | permutation_iter_t | blue_nonbottom_end | ) |
refine the block (the blue subblock is smaller)
This function is called after a refinement function has found that the blue subblock is the smaller one. It creates a new block for the blue states.
blue_nonbottom_end | iterator past the last blue non-bottom state |
Definition at line 70 of file liblts_bisim_gjkw.cpp.
block_t * mcrl2::lts::detail::bisim_gjkw::block_t::split_off_red | ( | permutation_iter_t | red_nonbottom_begin | ) |
refine the block (the red subblock is smaller)
This function is called after a refinement function has found that the red subblock is the smaller one. It creates a new block for the red states.
red_nonbottom_begin | iterator to the first red non-bottom state |
This function is called after a refinement function has found that the red subblock is the smaller one. It creates a new block for the red states.
Both split_off_blue()
and split_off_red()
unmark all states in the blue subblock and mark all bottom states in the red subblock. (This will help the caller to distinguish old bottom states from new bottom states found after split_off_blue()
or split_off_red()
, respectively.) The two functions use the same complexity counters because their operations belong together.
red_nonbottom_begin | iterator to the first red non-bottom state |
Definition at line 149 of file liblts_bisim_gjkw.cpp.
|
inline |
split off a single block from the constellation
The function splits the current constellation after its first block or before its last block, whichever is smaller. It creates a new constellation for the split-off block and returns a pointer to the block.
It doesn't matter very much how ties are resolved here: part_tr.change_to_C()
is faster if the first block is selected to be split off. part_tr.split_s_inert_out()
is faster if the last block is selected.
Definition at line 962 of file liblts_bisim_gjkw.h.
bool mcrl2::lts::detail::bisim_gjkw::part_trans_t::split_s_inert_out | ( | state_info_ptr s | ONLY_IF_DEBUG, constln_t *OldC | ) |
Split outgoing transitions of a state in the splitter.
split_s_inert_out splits the outgoing transitions from s to its own constellation into two: the inert transitions become transitions to the new constellation of which s is now part; the non-inert transitions remain transitions to OldC. Its time complexity is O(1 + min { |out_\nottau(s)|, |out_\tau(s)| }).
s | state whose outgoing transitions need to be split |
OldC | old constellation (of which the splitter was a part earlier) |
Definition at line 555 of file liblts_bisim_gjkw.cpp.
|
inline |
provide size of state space
Definition at line 1103 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 269 of file liblts_bisim_gjkw.h.
|
inline |
iterator to first outgoing transition
Definition at line 268 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 280 of file liblts_bisim_gjkw.h.
|
inline |
iterator past the last outgoing transition
Definition at line 276 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 1637 of file liblts_bisim_gjkw.h.
bool mcrl2::lts::detail::bisim_gjkw::state_info_entry::surely_has_no_transition_to | ( | const constln_t * | SpC | ) | const |
bool mcrl2::lts::detail::bisim_gjkw::state_info_entry::surely_has_transition_to | ( | const constln_t * | SpC | ) | const |
|
inlineprivate |
Definition at line 1517 of file liblts_bisim_gjkw.h.
|
inlineprivate |
Definition at line 1501 of file liblts_bisim_gjkw.h.
|
inlineprivate |
Definition at line 1466 of file liblts_bisim_gjkw.h.
|
inlineprivate |
Definition at line 1480 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 1365 of file liblts_bisim_gjkw.h.
|
inline |
compute the goal constellation of the transitions in this slice
Definition at line 1361 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 1564 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 685 of file liblts_bisim_gjkw.h.
|
inline |
iterator to the first unmarked bottom state in the block
Definition at line 681 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 692 of file liblts_bisim_gjkw.h.
|
inline |
iterator past the last unmarked bottom state in the block
Definition at line 688 of file liblts_bisim_gjkw.h.
|
inline |
provides the number of unmarked bottom states in the block
Definition at line 560 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 639 of file liblts_bisim_gjkw.h.
|
inline |
iterator to the first unmarked non-bottom state in the block
Definition at line 638 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 646 of file liblts_bisim_gjkw.h.
|
inline |
iterator past the last unmarked non-bottom state in the block
Definition at line 642 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 1788 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 499 of file liblts_bisim_gjkw.h.
|
inline |
destructor
Definition at line 874 of file liblts_bisim_gjkw.h.
|
inline |
destructor
The destructor assumes that the caller has already executed clear()
to deallocate the memory for the partition.
Definition at line 1060 of file liblts_bisim_gjkw.h.
|
inline |
Definition at line 1550 of file liblts_bisim_gjkw.h.
|
private |
Definition at line 1725 of file liblts_bisim_gjkw.h.
|
private |
Definition at line 1686 of file liblts_bisim_gjkw.h.
B_to_C_iter_t mcrl2::lts::detail::bisim_gjkw::succ_entry::B_to_C |
Definition at line 1194 of file liblts_bisim_gjkw.h.
|
private |
Definition at line 1461 of file liblts_bisim_gjkw.h.
B_to_C_desc_iter_t mcrl2::lts::detail::bisim_gjkw::B_to_C_entry::B_to_C_slice |
Definition at line 1316 of file liblts_bisim_gjkw.h.
B_to_C_iter_t mcrl2::lts::detail::bisim_gjkw::B_to_C_descriptor::begin |
Definition at line 1343 of file liblts_bisim_gjkw.h.
block_t* mcrl2::lts::detail::bisim_gjkw::state_info_entry::block |
block where the state belongs
Definition at line 186 of file liblts_bisim_gjkw.h.
B_to_C_iter_t mcrl2::lts::detail::bisim_gjkw::B_to_C_descriptor::end |
Definition at line 1343 of file liblts_bisim_gjkw.h.
|
private |
Definition at line 1721 of file liblts_bisim_gjkw.h.
label_type mcrl2::lts::detail::bisim_gjkw::bisim_partitioner_gjkw_initialise_helper< LTS_TYPE >::Key::first |
Definition at line 1696 of file liblts_bisim_gjkw.h.
|
private |
Definition at line 1728 of file liblts_bisim_gjkw.h.
|
private |
Definition at line 1729 of file liblts_bisim_gjkw.h.
|
private |
Definition at line 1727 of file liblts_bisim_gjkw.h.
|
private |
Definition at line 1772 of file liblts_bisim_gjkw.h.
|
private |
iterator to the first state of the block
Definition at line 412 of file liblts_bisim_gjkw.h.
|
private |
iterator to the first state in the constellation
Definition at line 822 of file liblts_bisim_gjkw.h.
|
private |
iterator to the first bottom state of the block
Definition at line 418 of file liblts_bisim_gjkw.h.
|
private |
constellation to which the block belongs
Definition at line 442 of file liblts_bisim_gjkw.h.
|
private |
iterator to first outgoing transition to the constellation of interest
Definition at line 195 of file liblts_bisim_gjkw.h.
|
private |
iterator past the last state of the block
Definition at line 409 of file liblts_bisim_gjkw.h.
|
private |
iterator past the last state in the constellation
Definition at line 819 of file liblts_bisim_gjkw.h.
|
private |
iterator to the first inert transition of the block
If there are no inert transitions, then inert_begin
and inert_end
point to the end of the B_to_C-slice containing transitions from the block to its own constellation. If there is no such slice, both are equal to B_to_C
.
Definition at line 428 of file liblts_bisim_gjkw.h.
|
private |
iterator past the last inert transition of the block
Definition at line 431 of file liblts_bisim_gjkw.h.
|
private |
iterator to the first marked bottom state of the block
Definition at line 421 of file liblts_bisim_gjkw.h.
|
private |
iterator to the first marked non-bottom state of the block
Definition at line 415 of file liblts_bisim_gjkw.h.
|
private |
unique sequence number of this block
After the stuttering equivalence algorithm has terminated, this number is used as a state number in the quotient Kripke structure. (For blocks that contain extra Kripke states, the number is set to BLOCK_NO_SEQNR).
Definition at line 458 of file liblts_bisim_gjkw.h.
|
private |
points to the last or the first transition to the same constellation
We need to know, given a transition, which other transitions with the same source state and the same goal constellation there are. This pointer, in most cases, points to the last transition with the same source state and goal constellation, with the exception: If this succ_entry
is actually the last transition, then the pointer points to the first such transition. In that way, one can find the first and the last relevant transition with one or two levels of dereferencing.
The advantage of this pointer is that one does not need to allocate a separate data structure containing this information.
Definition at line 1210 of file liblts_bisim_gjkw.h.
|
private |
Definition at line 1728 of file liblts_bisim_gjkw.h.
|
private |
Definition at line 1729 of file liblts_bisim_gjkw.h.
|
private |
Definition at line 1727 of file liblts_bisim_gjkw.h.
|
staticprivate |
first constellation in the list of non-trivial constellations
Definition at line 832 of file liblts_bisim_gjkw.h.
|
private |
next constellation in the list of non-trivial constellations
If this is the last constellation in the list, nontrivial_next
points to this very constellation. Consequently, it is possible to check whether some constellation is trivial without an additional variable.
Definition at line 829 of file liblts_bisim_gjkw.h.
state_type mcrl2::lts::detail::bisim_gjkw::state_info_entry::notblue |
number of inert transitions to non-blue states
Definition at line 192 of file liblts_bisim_gjkw.h.
|
static |
total number of blocks with unique sequence number allocated
Upon starting the stuttering equivalence algorithm, the number of blocks must be zero.
Definition at line 466 of file liblts_bisim_gjkw.h.
|
private |
Definition at line 1731 of file liblts_bisim_gjkw.h.
|
private |
Definition at line 1687 of file liblts_bisim_gjkw.h.
|
private |
Definition at line 1689 of file liblts_bisim_gjkw.h.
|
private |
Definition at line 1688 of file liblts_bisim_gjkw.h.
|
private |
Definition at line 1773 of file liblts_bisim_gjkw.h.
|
private |
Definition at line 1774 of file liblts_bisim_gjkw.h.
|
staticprivate |
Definition at line 799 of file liblts_bisim_gjkw.h.
permutation_t mcrl2::lts::detail::bisim_gjkw::part_state_t::permutation |
permutation array
This is the central element of the data structure: In this array, states that belong to the same block are stored in adjacent elements, and blocks that belong to the same constellation are stored in adjacent slices.
Definition at line 1027 of file liblts_bisim_gjkw.h.
permutation_iter_t mcrl2::lts::detail::bisim_gjkw::state_info_entry::pos |
position of the state in the permutation array
Definition at line 189 of file liblts_bisim_gjkw.h.
B_to_C_iter_t mcrl2::lts::detail::bisim_gjkw::constln_t::postprocess_begin |
iterator to the first transition into this constellation that needs postprocessing
In postprocess_new_bottom()
, all transitions from a refined block to the present constellation have to be gone through. Because during this process the refined block may be refined even further, we need postprocess_begin
and postprocess_end
to store which transitions have to be gone through overall.
If no transitions to this constellation need to be postprocessed, the variable is set to the same value as postprocess_end, preferably to part_trans_t::B_to_C->end().
Definition at line 845 of file liblts_bisim_gjkw.h.
B_to_C_iter_t mcrl2::lts::detail::bisim_gjkw::constln_t::postprocess_end |
iterator past the last transition into this constellation that needs postprocessing
Definition at line 849 of file liblts_bisim_gjkw.h.
pred_iter_t mcrl2::lts::detail::bisim_gjkw::B_to_C_entry::pred |
Definition at line 1315 of file liblts_bisim_gjkw.h.
|
private |
Definition at line 1459 of file liblts_bisim_gjkw.h.
|
staticprivate |
first block in the list of refinable blocks
Definition at line 451 of file liblts_bisim_gjkw.h.
|
private |
next block in the list of refinable blocks
If this is the last block in the list, refinable_next
points to this very block. Consequently, it is possible to check whether some block is refinable without an additional variable.
Definition at line 448 of file liblts_bisim_gjkw.h.
|
staticprivate |
pointer at the first entry in the state_info
array
Definition at line 352 of file liblts_bisim_gjkw.h.
|
staticprivate |
pointer past the last actual entry in the state_info
array
state_info
actually contains an additional entry that is only used partially, namely to store pointers to the end of the transition slices of the last state. In other words, s_i_end
points at this additional, partially used entry.
Definition at line 359 of file liblts_bisim_gjkw.h.
state_type mcrl2::lts::detail::bisim_gjkw::bisim_partitioner_gjkw_initialise_helper< LTS_TYPE >::Key::second |
Definition at line 1697 of file liblts_bisim_gjkw.h.
const state_type mcrl2::lts::detail::bisim_gjkw::constln_t::sort_key |
sort key to order constellation-related information
When a constellation is created anew, it it assigned a sort key that is lower than the constellation it came from, but never lower than the sort key of any other constellation that was lower than the original constellation. This ensures that the order of other constellations does not change.
Definition at line 857 of file liblts_bisim_gjkw.h.
state_info_ptr mcrl2::lts::detail::bisim_gjkw::pred_entry::source |
Definition at line 1289 of file liblts_bisim_gjkw.h.
|
private |
iterator to first incoming transition
also serves as iterator past the last incoming transition of the previous state.
Definition at line 169 of file liblts_bisim_gjkw.h.
|
private |
iterator to first inert incoming transition
Definition at line 177 of file liblts_bisim_gjkw.h.
|
private |
iterator to first inert outgoing transition
Definition at line 180 of file liblts_bisim_gjkw.h.
|
private |
iterator past the last inert outgoing transition
Definition at line 183 of file liblts_bisim_gjkw.h.
|
private |
array with all other information about states
We allocate 1 additional `‘state’' to allow for the iterators past the last transition, as described in the documentation of state_info_entry
.
Definition at line 1034 of file liblts_bisim_gjkw.h.
|
private |
iterator to first outgoing transition
also serves as iterator past the last outgoing transition of the previous state.
Definition at line 174 of file liblts_bisim_gjkw.h.
|
private |
Definition at line 1730 of file liblts_bisim_gjkw.h.
succ_iter_t mcrl2::lts::detail::bisim_gjkw::pred_entry::succ |
Definition at line 1288 of file liblts_bisim_gjkw.h.
|
private |
Definition at line 1460 of file liblts_bisim_gjkw.h.
state_info_ptr mcrl2::lts::detail::bisim_gjkw::succ_entry::target |
Definition at line 1195 of file liblts_bisim_gjkw.h.
B_to_C_desc_list mcrl2::lts::detail::bisim_gjkw::block_t::to_constln |
list of B_to_C with transitions from this block
This list serves two purposes: it contains all B_to_C_descriptors, so that the constellations reachable from this block can be found; and if this block has transitions to the current splitter SpC\SpB, then the first element of the list points to these transitions.
Definition at line 439 of file liblts_bisim_gjkw.h.
|
mutable |
Definition at line 365 of file liblts_bisim_gjkw.h.
|
mutable |
Definition at line 805 of file liblts_bisim_gjkw.h.
|
mutable |
Definition at line 1307 of file liblts_bisim_gjkw.h.
|
mutable |
Definition at line 1450 of file liblts_bisim_gjkw.h.
|
friend |
Definition at line 1037 of file liblts_bisim_gjkw.h.
|
friend |
Definition at line 1464 of file liblts_bisim_gjkw.h.
|
friend |
Definition at line 361 of file liblts_bisim_gjkw.h.
|
friend |
Definition at line 801 of file liblts_bisim_gjkw.h.