mCRL2
Loading...
Searching...
No Matches
liblts_bisim_gjkw.h
Go to the documentation of this file.
1// Author(s): David N. Jansen, Radboud Universiteit, Nijmegen, The Netherlands
2//
3// Copyright: see the accompanying file COPYING or copy at
4// https://github.com/mCRL2org/mCRL2/blob/master/COPYING
5//
6// Distributed under the Boost Software License, Version 1.0.
7// (See accompanying file LICENSE_1_0.txt or copy at
8// http://www.boost.org/LICENSE_1_0.txt)
9
10/// \file lts/detail/liblts_bisim_gjkw.h
11///
12/// \brief O(m log n)-time stuttering equivalence algorithm
13///
14/// \details This file implements the efficient partition refinement algorithm
15/// by Groote / Jansen / Keiren / Wijs to calculate the stuttering equivalence
16/// quotient of a Kripke structure. (Labelled transition systems are converted
17/// to Kripke structures before the main algorithm).
18/// The file accompanies the planned publication in the ACM Trans. Comput. Log.
19/// Log. special issue for TACAS 2016, to appear in 2017.
20///
21/// \author David N. Jansen, Radboud Universiteit, Nijmegen, The Netherlands
22
23#ifndef MCRL2_LTS_DETAIL_LIBLTS_BISIM_GJKW_H
24#define MCRL2_LTS_DETAIL_LIBLTS_BISIM_GJKW_H
25
26#include <unordered_map> // used during initialisation
27#include <list> // for the list of B_to_C_descriptors
28#include <utility> // for std::cmp_less_equal
29
30#include "mcrl2/lts/detail/liblts_scc.h"
31#include "mcrl2/lts/detail/liblts_merge.h"
32#include "mcrl2/lts/detail/check_complexity.h"
33#include "mcrl2/lts/detail/fixed_vector.h"
34
35namespace mcrl2::lts::detail
36{
37// The bisimulation algorithm below is hand-tuned and deliberately uses helper
38// macros such as ONLY_IF_DEBUG. This check is therefore suppressed for the
39// whole file.
40// NOLINTBEGIN(cppcoreguidelines-macro-usage)
41 #ifndef NDEBUG
42 /// \brief include something in Debug mode
43 /// \details In a few places, we have to include an additional parameter to
44 /// a function in Debug mode. While it is in principle possible to use
45 /// #ifndef NDEBUG ... #endif, that would lead to distributing the code
46 /// over many code lines. This macro expands to its arguments in Debug
47 /// mode and to nothing otherwise.
48 #define ONLY_IF_DEBUG(...) __VA_ARGS__
49 #else
50 #define ONLY_IF_DEBUG(...)
51 #endif
52// state_type and trans_type are defined in check_complexity.h.
53
54/// \brief type used to store label numbers and counts
56
57/* ************************************************************************* */
58/* */
59/* R E F I N A B L E P A R T I T I O N */
60/* */
61/* ************************************************************************* */
62
63
64
65
66
67/// \defgroup part_state
68/// \brief data structures for a refinable partition
69/// \details The following definitions provide a _refinable partition_ data
70/// structure. The basic idea is that we store a permutation of the states (in
71/// a permutation_t array), so that states belonging to the same block are
72/// adjacent, and also that blocks belonging to the same constellation are
73/// adjacent.
74///
75/// The basic structure therefore consists of the classes:
76///
77/// state_info_ptr - an entry in the permutation array; it contains a
78/// pointer to a state_info_entry.
79/// permutation_t - an array of permutation_entries.
80/// constln_t - contains information about a constellation, in
81/// particular which slice of permutation_t contains its
82/// states.
83/// block_t - contains information about a block, in particular which
84/// slice of permutation_t contains its states, and its
85/// constellation.
86/// state_info_entry - contains information about a state, in particular its
87/// position in the permutation_t array and its block.
88/// state_info_t - an array of state_info_entries.
89/// part_state_t - the complete data structure combining state_info_t and
90/// permutation_t.
91///
92/// This basic structure is extended as follows:
93/// - Because we combine this data structure with a partition of the
94/// transitions, a state_info_entry also contains information which slice of
95/// the incoming and outgoing, inert and non-inert transitions belong to the
96/// state. In many cases the slice of this state ends exactly where the
97/// slice of the next state begins, so we can find the end of this state's
98/// slice by looking at the next state's state_info_entry. Therefore,
99/// state_info_ptr actually contains a pointer to a state_info_entry with
100/// the additional guarantee that this is not the last entry in state_info_t.
101/// (To make this a small bit more type safe, we could change the type
102/// state_info_ptr to something like ``pointer to an array with two
103/// state_info_entries'', typedef state_info_entry (*state_info_ptr)[2];.
104/// Still, that would allow unsafe pointer juggling.)
105/// - A block_t also contains information about its outgoing inert transitions.
106/// - A state_info_entry also contains information used during `refine()` or
107/// `process_new_bottom()`.
108///@{
109
110namespace bisim_gjkw
111{
112
113class state_info_entry;
114
115using state_info_ptr = state_info_entry*;
116using state_info_const_ptr = const state_info_entry*;
117
118/// \class permutation_t
119/// \brief stores a permutation of the states, ordered by block
120/// \details This is the central concept of the _refinable partition_: the
121/// permutation of the states, such that states belonging to the same block are
122/// adjacent, and also that blocks belonging to the same constellation are
123/// adjacent.
124///
125/// Iterating over the states of a block or the blocks of a constellation will
126/// therefore be done using the permutation_t array.
127using permutation_t = fixed_vector<state_info_ptr>;
130
131class block_t;
132class constln_t;
133
134class B_to_C_entry;
135class pred_entry;
136class succ_entry;
140
144class B_to_C_descriptor;
148
149/// \class state_info_entry
150/// \brief stores information about a single state
151/// \details This class stores all other information about a state that the
152/// partition needs. In particular: the block where the state belongs and the
153/// position in the permutation array (i. e. the inverse of the permutation).
154///
155/// A `state_info_entry` only works correctly if it is part of an array where
156/// there is one more `state_info_entry`. The reason is that iterators past
157/// the last transition are not actually stored here, as they are equal to the
158/// iterator to the first transition of the next state. The array will contain
159/// one additional ``state'' that is only used for these pointers.
160class state_info_entry
161{
162 private:
163 /// \brief iterator to first incoming transition
164 /// \details also serves as iterator past the last incoming transition of
165 /// the previous state.
166 pred_iter_t state_in_begin;
167
168 /// \brief iterator to first outgoing transition
169 /// \details also serves as iterator past the last outgoing transition of
170 /// the previous state.
171 succ_iter_t state_out_begin;
172
173 /// iterator to first _inert_ incoming transition
174 pred_iter_t state_inert_in_begin;
175
176 /// iterator to first _inert_ outgoing transition
177 succ_iter_t state_inert_out_begin;
178
179 /// iterator past the last _inert_ outgoing transition
180 succ_iter_t state_inert_out_end;
181 public:
182 /// block where the state belongs
183 block_t* block = nullptr;
184
185 /// position of the state in the permutation array
186 permutation_iter_t pos;
187
188 /// number of inert transitions to non-blue states
189 state_type notblue = 0UL;
190 private:
191 /// iterator to first outgoing transition to the constellation of interest
192 succ_iter_t int_current_constln;
193 public:
194 /// get constellation where the state belongs
195 const constln_t* constln() const;
196 constln_t* constln();
197
198 succ_const_iter_t current_constln() const { return int_current_constln; }
199 succ_iter_t current_constln() { return int_current_constln; }
200 void set_current_constln(succ_iter_t const new_current_constln)
201 {
202 int_current_constln = new_current_constln; // current_constln points to a successor transition of this state:
203 assert(succ_begin() <= int_current_constln);
204 assert(int_current_constln <= succ_end());
205 // it points to a place where a constellation slice starts or ends:
206 // (This assertion cannot be tested because the types are not yet
207 // complete.)
208 // assert(succ_begin() == int_current_constln ||
209 // succ_end() == int_current_constln ||
210 // int_current_constln[-1].constln_slice !=
211 // int_current_constln->constln_slice);
212 // it points to the relevant constellation:
213 // The following assertions cannot be executed immediately after each
214 // call.
215 // assert(succ_begin() == current_constln() ||
216 // *current_constln()[-1].target->constln() <= *SpC);
217 // assert(succ_end() == current_constln() ||
218 // *SpC <= *current_constln()->target->constln());
219 }
220
221 /// iterator to first incoming transition
222 pred_const_iter_t pred_begin() const { return state_in_begin; }
223 pred_iter_t pred_begin() { return state_in_begin; }
224 void set_pred_begin(pred_iter_t new_in_begin)
225 {
226 state_in_begin = new_in_begin;
227 }
228
229 /// iterator past the last incoming transition
230 pred_const_iter_t pred_end() const
231 { assert(s_i_begin <= this); assert(this < s_i_end);
232 return this[1].state_in_begin;
233 }
234 pred_iter_t pred_end()
235 { assert(s_i_begin <= this); assert(this < s_i_end);
236 return this[1].state_in_begin;
237 }
238 void set_pred_end(pred_iter_t new_in_end)
239 { assert(s_i_begin <= this); assert(this < s_i_end);
240 this[1].set_pred_begin(new_in_end);
241 }
242
243 /// iterator to first non-inert incoming transition
244 pred_const_iter_t noninert_pred_begin() const { return state_in_begin; }
245 pred_iter_t noninert_pred_begin() { return state_in_begin; }
246
247 /// iterator past the last non-inert incoming transition
248 pred_const_iter_t noninert_pred_end() const { return inert_pred_begin(); }
249 pred_iter_t noninert_pred_end() { return inert_pred_begin(); }
250
251 /// iterator to first inert incoming transition
252 pred_const_iter_t inert_pred_begin() const { return state_inert_in_begin; }
253 pred_iter_t inert_pred_begin() { return state_inert_in_begin; }
254 void set_inert_pred_begin(pred_iter_t new_inert_in_begin)
255 {
256 state_inert_in_begin = new_inert_in_begin; assert(pred_begin() <= inert_pred_begin());
257 assert(inert_pred_begin() <= pred_end());
258 }
259
260 /// iterator one past the last inert incoming transition
261 pred_const_iter_t inert_pred_end() const { return pred_end(); }
262 pred_iter_t inert_pred_end() { return pred_end(); }
263
264 /// iterator to first outgoing transition
265 succ_const_iter_t succ_begin() const { return state_out_begin; }
266 succ_iter_t succ_begin() { return state_out_begin; }
267 void set_succ_begin(succ_iter_t new_out_begin)
268 {
269 state_out_begin = new_out_begin;
270 }
271
272 /// iterator past the last outgoing transition
273 succ_const_iter_t succ_end() const
274 { assert(s_i_begin <= this); assert(this < s_i_end);
275 return this[1].state_out_begin;
276 }
277 succ_iter_t succ_end()
278 { assert(s_i_begin <= this); assert(this < s_i_end);
279 return this[1].state_out_begin;
280 }
281 void set_succ_end(succ_iter_t new_out_end)
282 { assert(s_i_begin <= this); assert(this < s_i_end);
283 this[1].set_succ_begin(new_out_end); assert(succ_begin() <= succ_end());
284 }
285
286 /// iterator to first inert outgoing transition
287 succ_const_iter_t inert_succ_begin() const {return state_inert_out_begin;}
288 succ_iter_t inert_succ_begin() { return state_inert_out_begin; }
289 void set_inert_succ_begin(succ_iter_t const new_inert_out_begin)
290 { // The following assertions cannot be tested because the respective
291 // types are not yet complete.
292 // if (new_inert_out_begin > inert_succ_begin())
293 // {
294 // assert(*new_inert_out_begin[-1].target->constln()<=*constln());
295 // assert(new_inert_out_begin[-1].target->block != block);
296 // }
297 // else if (new_inert_out_begin < inert_succ_begin())
298 // {
299 // assert(new_inert_out_begin->target->block == block);
300 // }
301 state_inert_out_begin = new_inert_out_begin; assert(succ_begin() <= inert_succ_begin());
302 assert(inert_succ_begin() <= inert_succ_end());
303 }
304
305 /// iterator past the last inert outgoing transition
306 succ_const_iter_t inert_succ_end() const { return state_inert_out_end; }
307 succ_iter_t inert_succ_end() { return state_inert_out_end; }
308
309 void set_inert_succ_begin_and_end(succ_iter_t new_inert_out_begin,
310 succ_iter_t new_inert_out_end)
311 {
312 state_inert_out_begin = new_inert_out_begin;
313 state_inert_out_end = new_inert_out_end; assert(succ_begin() <= inert_succ_begin());
314 assert(inert_succ_begin() <= inert_succ_end());
315 assert(inert_succ_end() <= succ_end());
316 // The following assertions cannot be tested always, as the function
317 // may be called earlier than the assertions are reestablished.
318 // assert(succ_begin() == inert_succ_begin() ||
319 // *inert_succ_begin()[-1].target->constln() <= *constln());
320 // assert(succ_begin() == inert_succ_begin() ||
321 // inert_succ_begin()[-1].target->block != block);
322 // assert(inert_succ_begin() == inert_succ_end() ||
323 // (inert_succ_begin()->target->block == block &&
324 // inert_succ_end()[-1].target->block == block));
325 // assert(succ_end() == inert_succ_end() ||
326 // *constln() < *inert_succ_end()->target->constln());
327 }
328
329 bool surely_has_transition_to(const constln_t* SpC) const;
330 bool surely_has_no_transition_to(const constln_t* SpC) const;
331 #ifndef NDEBUG
332 /// \brief print a short state identification for debugging
333 /// \details This function is only available if compiled in Debug mode.
334 std::string debug_id_short() const
335 {
336 assert(s_i_begin <= this);
337 assert(this < s_i_end);
338 return std::to_string(this - s_i_begin);
339 }
340
341 /// \brief print a state identification for debugging
342 /// \details This function is only available if compiled in Debug mode.
343 std::string debug_id() const
344 {
345 return "state " + debug_id_short();
346 }
347 private:
348 /// \brief pointer at the first entry in the `state_info` array
349 static state_info_const_ptr s_i_begin;
350
351 /// \brief pointer past the last actual entry in the `state_info` array
352 /// \details `state_info` actually contains an additional entry that is
353 /// only used partially, namely to store pointers to the end of the
354 /// transition slices of the last state. In other words, `s_i_end` points
355 /// at this additional, partially used entry.
356 static state_info_const_ptr s_i_end;
357
358 friend class part_state_t;
359 public:
360 #endif
361 #if !defined(NDEBUG) || defined(COUNT_WORK_BALANCE)
362 mutable check_complexity::state_counter_t work_counter;
363 #endif
364};
365
366
367/// swap two permutations
368static inline void swap_permutation(permutation_iter_t s1,
369 permutation_iter_t s2)
370{
371 // swap contents of permutation array
372 std::swap(*s1, *s2);
373 // swap pointers to permutation array
374 (*s1)->pos = s1;
375 (*s2)->pos = s2;
376}
377
378/// \class block_t
379/// \brief stores information about a block
380/// \details A block corresponds to a slice of the permutation array. As the
381/// number of blocks is initially unknown, we will allocate instances of this
382/// class dynamically.
383///
384/// The slice in the permutation array containing the states of the block is
385/// subdivided into the following subslices (in this order):
386/// 1. unmarked non-bottom states
387/// 2. marked non-bottom states (initially empty)
388/// 3. unmarked bottom states
389/// 4. marked bottom states (initially empty)
390///
391/// A state should be marked iff it is a predecessor of the current splitter
392/// (through a strong transition). The marking is later extended to the red
393/// states; that are the states with a weak transition to the splitter.
394///
395/// (During the execution of some functions, more slices are subdivided
396/// further; however, as these subdivisions are local to a single function,
397/// they are not stored here.)
398///
399/// The blocks keep track of the total number of blocks allocated and number
400/// themselves sequentially using the static member `nr_of_blocks`. It is
401/// therefore impossible to have multiple refinements running at the same time.
402class block_t
403{
404 private:
405 /// iterator past the last state of the block
406 permutation_iter_t int_end;
407
408 /// iterator to the first state of the block
409 permutation_iter_t int_begin;
410
411 /// iterator to the first marked non-bottom state of the block
412 permutation_iter_t int_marked_nonbottom_begin;
413
414 /// iterator to the first bottom state of the block
415 permutation_iter_t int_bottom_begin;
416
417 /// iterator to the first marked bottom state of the block
418 permutation_iter_t int_marked_bottom_begin;
419
420 /// \brief iterator to the first inert transition of the block
421 /// \details If there are no inert transitions, then `inert_begin` and
422 /// `inert_end` point to the end of the B_to_C-slice containing transitions
423 /// from the block to its own constellation. If there is no such slice,
424 /// both are equal to `B_to_C`.
425 B_to_C_iter_t int_inert_begin;
426
427 /// iterator past the last inert transition of the block
428 B_to_C_iter_t int_inert_end;
429 public:
430 /// \brief list of B_to_C with transitions from this block
431 /// \details This list serves two purposes: it contains all
432 /// B_to_C_descriptors, so that the constellations reachable from this
433 /// block can be found; and if this block has transitions to the current
434 /// splitter SpC\SpB, then the first element of the list points to these
435 /// transitions.
436 B_to_C_desc_list to_constln;
437 private:
438 /// constellation to which the block belongs
439 constln_t* int_constln;
440
441 /// \brief next block in the list of refinable blocks
442 /// \details If this is the last block in the list, `refinable_next` points
443 /// to this very block. Consequently, it is possible to check whether some
444 /// block is refinable without an additional variable.
445 block_t* refinable_next = nullptr;
446
447 /// first block in the list of refinable blocks
448 static block_t* refinable_first;
449
450 /// \brief unique sequence number of this block
451 /// \details After the stuttering equivalence algorithm has terminated,
452 /// this number is used as a state number in the quotient Kripke structure.
453 /// (For blocks that contain extra Kripke states, the number is set to
454 /// BLOCK_NO_SEQNR).
455 state_type int_seqnr;
456
457#define BLOCK_NO_SEQNR ((state_type) -1)
458
459 public:
460 /// \brief total number of blocks with unique sequence number allocated
461 /// \details Upon starting the stuttering equivalence algorithm, the number
462 /// of blocks must be zero.
463 static state_type nr_of_blocks;
464
465 /// \brief constructor
466 /// \details The constructor initialises the block to: all states are
467 /// bottom states, no state is marked, the block is not refinable.
468 /// \param constln_ constellation to which the block belongs
469 /// \param begin_ initial iterator to the first state of the block
470 /// \param end_ initial iterator past the last state of the block
471 block_t(constln_t* const constln_, permutation_iter_t const begin_, permutation_iter_t const end_)
472 : int_end(end_),
473 int_begin(begin_),
474 int_marked_nonbottom_begin(begin_), // no non-bottom state is marked
475 int_bottom_begin(begin_), // all states are bottom states
476 int_marked_bottom_begin(end_), // no bottom state is marked
477 // int_inert_begin -- is initialised by part_trans_t::create_new_block
478 // int_inert_end -- is initialised by part_trans_t::create_new_block
479 to_constln(), // empty list
480 int_constln(constln_),
481
482 int_seqnr(BLOCK_NO_SEQNR)
483 { // The following assertions hold trivially.
484 // assert(int_begin <= int_marked_nonbottom_begin);
485 // assert(int_marked_nonbottom_begin <= int_bottom_begin);
486 // assert(int_bottom_begin <= int_marked_bottom_begin);
487 // assert(int_marked_bottom_begin <= int_end);
488 assert(int_bottom_begin < int_end);
489 // The following assertions cannot be tested because constln_t is not
490 // yet complete.
491 // assert(int_constln->begin() <= int_begin);
492 // assert(int_end <= int_constln->end());
493 }
494
495 ~block_t() = default;
496
497 /// assigns a unique sequence number
498 void assign_seqnr()
499 { assert(BLOCK_NO_SEQNR == int_seqnr);
500 int_seqnr = nr_of_blocks++;
501 }
502
503 state_type seqnr() const { return int_seqnr; }
504
505 /// provides an arbitrary refinable block
506 static block_t* get_some_refinable() { return refinable_first; }
507
508 /// \brief checks whether the block is refinable
509 /// \returns true if the block is refinable
510 bool is_refinable() const { return nullptr != refinable_next; }
511
512 /// \brief makes a block refinable (i. e. inserts it into the respective
513 /// list)
514 /// \returns true if the block was not refinable before
515 bool make_refinable()
516 {
517 if (is_refinable())
518 {
519 return false;
520 }
521 refinable_next = nullptr == refinable_first ? this : refinable_first;
522 refinable_first = this;
523 return true;
524 }
525
526 /// \brief makes a block non-refinable (i. e. removes it from the
527 /// respective list)
528 /// \details This member function only works if the block is the first one
529 /// in the list (which will normally be the case).
530 void make_nonrefinable()
531 { assert(refinable_first == this);
532 refinable_first = refinable_next == this ? nullptr : refinable_next;
533 refinable_next = nullptr;
534 }
535
536 /// provides the number of states in the block
537 state_type size() const { return int_end - int_begin; }
538
539 /// \brief provides the number of marked bottom states in the block
540 /// \details This size includes the old bottom states.
541 state_type marked_bottom_size() const
542 {
543 return marked_bottom_end() - marked_bottom_begin();
544 }
545
546 /// \brief provides the number of marked states in the block
547 /// \details This size includes the old bottom states; in other words, the
548 /// old bottom states are always regarded as marked.
549 state_type marked_size() const
550 {
551 return marked_nonbottom_end() - marked_nonbottom_begin() +
552 marked_bottom_size();
553 }
554
555 /// provides the number of unmarked bottom states in the block
556 state_type unmarked_bottom_size() const
557 {
558 return unmarked_bottom_end() - unmarked_bottom_begin();
559 }
560
561 /// \brief compares two blocks for ordering them
562 /// \details The blocks are ordered according to their positions in the
563 /// permutation array. This is a suitable order, as blocks may be refined,
564 /// but never swap positions as a whole. Refining will make the new
565 /// subblocks compare in the same way to other blocks as the original,
566 /// larger block.
567 bool operator<(const block_t& other) const
568 {
569 return begin() < other.begin();
570 }
571
572 /// constellation where the block belongs to
573 const constln_t* constln() const { return int_constln; }
574 constln_t* constln() { return int_constln; }
575 void set_constln(constln_t* new_constln)
576 { // The following assertion cannot be tested because the type constln_t
577 int_constln = new_constln; // is not yet complete.
578 // assert(nullptr == int_constln ||
579 // (int_constln->begin() <= int_begin &&
580 // int_end <= int_constln->end()));
581 }
582
583 /// read FromRed
584 B_to_C_descriptor* FromRed(const constln_t* SpC);
585
586 /// set FromRed to an existing element in to_constln
587 void SetFromRed(B_to_C_desc_iter_t new_fromred);
588
589 /// iterator to the first state in the block
590 permutation_const_iter_t begin() const { return int_begin; }
591 permutation_iter_t begin() { return int_begin; }
592 void set_begin(permutation_iter_t new_begin)
593 {
594 int_begin = new_begin; assert(int_begin <= int_marked_nonbottom_begin);
595 }
596
597 /// iterator past the last state in the block
598 permutation_const_iter_t end() const { return int_end; }
599 permutation_iter_t end() { return int_end; }
600 void set_end(permutation_iter_t new_end)
601 {
602 int_end = new_end; assert(int_marked_bottom_begin <= int_end); assert(int_bottom_begin < int_end);
603 }
604
605 /// iterator to the first non-bottom state in the block
606 permutation_const_iter_t nonbottom_begin() const { return int_begin; }
607 permutation_iter_t nonbottom_begin() { return int_begin; }
608
609 /// iterator past the last non-bottom state in the block
610 permutation_const_iter_t nonbottom_end() const { return int_bottom_begin; }
611 permutation_iter_t nonbottom_end() { return int_bottom_begin; }
612 void set_nonbottom_end(permutation_iter_t new_nonbottom_end)
613 {
614 int_bottom_begin = new_nonbottom_end; assert(int_marked_nonbottom_begin <= int_bottom_begin);
615 assert(int_bottom_begin <= int_marked_bottom_begin);
616 assert(int_bottom_begin < int_end);
617 }
618
619 /// iterator to the first bottom state in the block
620 permutation_const_iter_t bottom_begin() const { return int_bottom_begin; }
621 permutation_iter_t bottom_begin() { return int_bottom_begin; }
622 void set_bottom_begin(permutation_iter_t new_bottom_begin)
623 {
624 int_bottom_begin = new_bottom_begin; assert(int_marked_nonbottom_begin <= int_bottom_begin);
625 assert(int_bottom_begin <= int_marked_bottom_begin);
626 // assert(int_bottom_begin < int_end);
627 }
628
629 /// iterator past the last bottom state in the block
630 permutation_const_iter_t bottom_end() const { return int_end; }
631 permutation_iter_t bottom_end() { return int_end; }
632
633 /// iterator to the first unmarked non-bottom state in the block
634 permutation_const_iter_t unmarked_nonbottom_begin()const{return int_begin;}
635 permutation_iter_t unmarked_nonbottom_begin() { return int_begin; }
636
637 /// iterator past the last unmarked non-bottom state in the block
638 permutation_const_iter_t unmarked_nonbottom_end() const
639 {
640 return int_marked_nonbottom_begin;
641 }
642 permutation_iter_t unmarked_nonbottom_end()
643 {
644 return int_marked_nonbottom_begin;
645 }
646 void set_unmarked_nonbottom_end(permutation_iter_t
647 new_unmarked_nonbottom_end)
648 {
649 int_marked_nonbottom_begin = new_unmarked_nonbottom_end; assert(int_begin <= int_marked_nonbottom_begin);
650 assert(int_marked_nonbottom_begin <= int_bottom_begin);
651 }
652
653 /// iterator to the first marked non-bottom state in the block
654 permutation_const_iter_t marked_nonbottom_begin() const
655 {
656 return int_marked_nonbottom_begin;
657 }
658 permutation_iter_t marked_nonbottom_begin()
659 {
660 return int_marked_nonbottom_begin;
661 }
662 void set_marked_nonbottom_begin(permutation_iter_t
663 new_marked_nonbottom_begin)
664 {
665 int_marked_nonbottom_begin = new_marked_nonbottom_begin; assert(int_begin <= int_marked_nonbottom_begin);
666 assert(int_marked_nonbottom_begin <= int_bottom_begin);
667 }
668
669 /// iterator one past the last marked non-bottom state in the block
670 permutation_const_iter_t marked_nonbottom_end() const
671 {
672 return int_bottom_begin;
673 }
674 permutation_iter_t marked_nonbottom_end() { return int_bottom_begin; }
675
676 /// iterator to the first unmarked bottom state in the block
677 permutation_const_iter_t unmarked_bottom_begin() const
678 {
679 return int_bottom_begin;
680 }
681 permutation_iter_t unmarked_bottom_begin() { return int_bottom_begin; }
682
683 /// iterator past the last unmarked bottom state in the block
684 permutation_const_iter_t unmarked_bottom_end() const
685 {
686 return int_marked_bottom_begin;
687 }
688 permutation_iter_t unmarked_bottom_end() {return int_marked_bottom_begin;}
689 void set_unmarked_bottom_end(permutation_iter_t new_unmarked_bottom_end)
690 {
691 int_marked_bottom_begin = new_unmarked_bottom_end; assert(int_bottom_begin <= int_marked_bottom_begin);
692 assert(int_marked_bottom_begin <= int_end);
693 }
694
695 /// iterator to the first marked bottom state in the block
696 permutation_const_iter_t marked_bottom_begin() const
697 {
698 return int_marked_bottom_begin;
699 }
700 permutation_iter_t marked_bottom_begin() {return int_marked_bottom_begin;}
701 void set_marked_bottom_begin(permutation_iter_t new_marked_bottom_begin)
702 {
703 int_marked_bottom_begin = new_marked_bottom_begin; assert(int_bottom_begin <= int_marked_bottom_begin);
704 assert(int_marked_bottom_begin <= int_end);
705 }
706
707 /// \brief iterator past the last marked bottom state in the block
708 /// \details This includes the old bottom states.
709 permutation_const_iter_t marked_bottom_end() const { return int_end; }
710 permutation_iter_t marked_bottom_end() { return int_end; }
711
712 /// iterator to the first inert transition of the block
713 B_to_C_const_iter_t inert_begin() const { return int_inert_begin; }
714 B_to_C_iter_t inert_begin() { return int_inert_begin; }
715 void set_inert_begin(B_to_C_iter_t new_inert_begin)
716 {
717 int_inert_begin = new_inert_begin; assert(int_inert_begin <= int_inert_end);
718 }
719
720 /// iterator past the last inert transition of the block
721 B_to_C_const_iter_t inert_end() const { return int_inert_end; }
722 B_to_C_iter_t inert_end() { return int_inert_end; }
723 void set_inert_end(B_to_C_iter_t new_inert_end)
724 {
725 int_inert_end = new_inert_end; assert(int_inert_begin <= int_inert_end);
726 }
727 void set_inert_begin_and_end(B_to_C_iter_t new_inert_begin,
728 B_to_C_iter_t new_inert_end)
729 {
730 int_inert_begin = new_inert_begin;
731 int_inert_end = new_inert_end; assert(int_inert_begin <= int_inert_end);
732 }
733
734 /// \brief mark a non-bottom state
735 /// \details Marking is done by moving the state to the slice of the marked
736 /// non-bottom states of the block.
737 /// \param s the non-bottom state that has to be marked
738 /// \returns true if the state was not marked before
739 bool mark_nonbottom(state_info_ptr s)
740 { assert(s->pos < nonbottom_end()); assert(nonbottom_begin() <= s->pos);
741 if (marked_nonbottom_begin() <= s->pos)
742 {
743 return false;
744 }
745 set_marked_nonbottom_begin(marked_nonbottom_begin() - 1);
746 swap_permutation(s->pos, marked_nonbottom_begin());
747 return true;
748 }
749
750 /// \brief mark a state
751 /// \details Marking is done by moving the state to the slice of the marked
752 /// bottom or non-bottom states of the block. If `s` is an old bottom
753 /// state, it is treated as if it already were marked.
754 /// \param s the state that has to be marked
755 /// \returns true if the state was not marked before
756 bool mark(state_info_ptr s)
757 { assert(s->pos < end());
758 if (bottom_begin() <= s->pos)
759 {
760 if (marked_bottom_begin() <= s->pos)
761 {
762 return false;
763 }
764 set_marked_bottom_begin(marked_bottom_begin() - 1);
765 swap_permutation(s->pos, marked_bottom_begin());
766 return true;
767 }
768 return mark_nonbottom(s);
769 }
770
771 /// \brief refine the block (the blue subblock is smaller)
772 /// \details This function is called after a refinement function has found
773 /// that the blue subblock is the smaller one. It creates a new block for
774 /// the blue states.
775 /// \param blue_nonbottom_end iterator past the last blue non-bottom state
776 /// \returns pointer to the new (blue) block
777 block_t* split_off_blue(permutation_iter_t blue_nonbottom_end);
778
779 /// \brief refine the block (the red subblock is smaller)
780 /// \details This function is called after a refinement function has found
781 /// that the red subblock is the smaller one. It creates a new block for
782 /// the red states.
783 /// \param red_nonbottom_begin iterator to the first red non-bottom state
784 /// \returns pointer to the new (red) block
785 block_t* split_off_red(permutation_iter_t red_nonbottom_begin);
786 #ifndef NDEBUG
787 /// \brief print a block identification for debugging
788 /// \details This function is only available if compiled in Debug mode.
789 std::string debug_id() const
790 {
791 return "block [" + std::to_string(begin() - perm_begin) + "," +
792 std::to_string(end() - perm_begin) + ")" +
793 (BLOCK_NO_SEQNR != seqnr() ?" (#"+std::to_string(seqnr())+")" :"");
794 }
795
796 /// \brief provide an iterator to the beginning of the permutation array
797 /// \details This iterator is required to be able to print identifications
798 /// for debugging. It is only available if compiled in Debug mode.
799 static permutation_const_iter_t permutation_begin() { return perm_begin; }
800 private:
801 static permutation_const_iter_t perm_begin;
802
803 friend class part_state_t;
804 #endif
805 #if !defined(NDEBUG) || defined(COUNT_WORK_BALANCE)
806 public:
807 mutable check_complexity::block_counter_t work_counter;
808 #endif
809};
810
811
812/// \class constln_t
813/// \brief stores information about a constellation
814/// \details A constellation corresponds to a slice in the permutation array;
815/// its boundaries are also block boundaries. As the number of constellations
816/// is initially unknown, we will allocate it dynamically.
817class constln_t
818{
819 private:
820 /// iterator past the last state in the constellation
821 permutation_iter_t int_end;
822
823 /// iterator to the first state in the constellation
824 permutation_iter_t int_begin;
825
826 /// \brief next constellation in the list of non-trivial constellations
827 /// \details If this is the last constellation in the list,
828 /// `nontrivial_next` points to this very constellation. Consequently, it
829 /// is possible to check whether some constellation is trivial without an
830 /// additional variable.
831 constln_t* nontrivial_next = nullptr;
832
833 /// first constellation in the list of non-trivial constellations
834 static constln_t* nontrivial_first;
835 public:
836 /// \brief iterator to the first transition into this constellation that
837 /// needs postprocessing
838 /// \details In `postprocess_new_bottom()`, all transitions from a refined
839 /// block to the present constellation have to be gone through. Because
840 /// during this process the refined block may be refined even further, we
841 /// need `postprocess_begin` and `postprocess_end` to store which
842 /// transitions have to be gone through overall.
843 ///
844 /// If no transitions to this constellation need to be postprocessed, the
845 /// variable is set to the same value as postprocess_end, preferably to
846 /// part_trans_t::B_to_C->end().
847 B_to_C_iter_t postprocess_begin;
848
849 /// \brief iterator past the last transition into this constellation that
850 /// needs postprocessing
851 B_to_C_iter_t postprocess_end;
852
853 /// \brief sort key to order constellation-related information
854 /// \details When a constellation is created anew, it it assigned a sort
855 /// key that is lower than the constellation it came from, but never lower
856 /// than the sort key of any other constellation that was lower than the
857 /// original constellation. This ensures that the order of other
858 /// constellations does not change.
859 const state_type sort_key;
860
861 /// \brief constructor
862 /// \param begin_ iterator to the first state in the constellation
863 /// \param end_ iterator past the last state in the constellation
864 constln_t(state_type sort_key_, permutation_iter_t begin_, permutation_iter_t end_, B_to_C_iter_t postprocess_none)
865 : int_end(end_),
866 int_begin(begin_),
867
868 postprocess_begin(postprocess_none),
869 postprocess_end(postprocess_none),
870 sort_key(sort_key_)
871 { assert(int_begin<int_end); assert(std::cmp_less_equal(int_end-int_begin, sort_key));
872 }
873
874 /// \brief destructor
875 ~constln_t() = default;
876
877 /// \brief provides an arbitrary non-trivial constellation
878 /// \details The static function is implemented in a way to provide the
879 /// first constellation in the list of non-trivial constellations.
880 static constln_t* get_some_nontrivial() { return nontrivial_first; }
881
882 /// \brief provides the next non-trivial constellation
883 /// \details This (non-static!) function just returns the next non-trivial
884 /// constellation in the list. Note: If this constellation is the last in
885 /// the list of non-trivial constellations, the convention is that the next
886 /// pointer points to this constellation self (to distinguish it from
887 /// nullptr).
888 const constln_t* get_nontrivial_next() const { return nontrivial_next; }
889
890 /// \brief makes a constellation trivial (i. e. removes it from the
891 /// respective list)
892 /// \details This member function only works if the constellation is the
893 /// first one in the list (which will normally be the case).
894 void make_trivial()
895 { assert(nontrivial_first == this);
896 nontrivial_first = nontrivial_next == this ? nullptr : nontrivial_next;
897 nontrivial_next = nullptr;
898 }
899
900 /// \brief makes a constellation non-trivial (i. e. inserts it into the
901 /// respective list)
902 void make_nontrivial()
903 {
904 if (nullptr == nontrivial_next)
905 {
906 nontrivial_next = nullptr == nontrivial_first ? this
907 : nontrivial_first;
908 nontrivial_first = this;
909 }
910 }
911
912 /// \brief returns true iff the constellation is trivial
913 /// \details If this constellation is the last in the list of non-trivial
914 /// constellations, the convention is that the next pointer points to this
915 /// constellation itself (to distinguish it from nullptr).
916 bool is_trivial() const
917 {
918 return nullptr == nontrivial_next;
919 }
920
921 /// \brief constant iterator to the first state in the constellation
922 permutation_const_iter_t begin() const { return int_begin; }
923 /// \brief iterator to the first state in the constellation
924 permutation_iter_t begin() { return int_begin; }
925 /// \brief set the iterator to the first state in the constellation
926 void set_begin(permutation_iter_t new_begin)
927 {
928 int_begin = new_begin; assert(int_begin < int_end);
929 }
930
931 /// \brief constant iterator past the last state in the constellation
932 permutation_const_iter_t end() const { return int_end; }
933 /// \brief iterator past the last state in the constellation
934 permutation_iter_t end() { return int_end; }
935 /// \brief set the iterator past the last state in the constellation
936 void set_end(permutation_iter_t new_end)
937 {
938 int_end = new_end; assert(int_begin < int_end);
939 }
940
941 /// \brief returns number of states in the constellation
942 state_type size() const { return int_end - int_begin; }
943
944 /// \brief compares two constellations for ordering them
945 /// \details Constellations are ordered according to their sort keys. The
946 /// keys have to be assigned in a way that when a constellation is split,
947 /// the parts are placed where the split constellation was in the order.
948 /// This can be achieved by assigning sort keys that are related to the
949 /// size of the constellation.
950 bool operator<(const constln_t& other) const
951 {
952 return sort_key < other.sort_key;
953 }
954 bool operator> (const constln_t& other) const { return other < *this; }
955 bool operator<=(const constln_t& other) const { return !(other < *this); }
956 bool operator>=(const constln_t& other) const { return !(*this < other); }
957
958 /// \brief split off a single block from the constellation
959 /// \details The function splits the current constellation after its first
960 /// block or before its last block, whichever is smaller. It creates a new
961 /// constellation for the split-off block and returns a pointer to the
962 /// block.
963 block_t* split_off_small_block()
964 { assert(begin() < end());
965 block_t* const FirstB = (*begin())->block;
966 block_t* const LastB = end()[-1]->block; assert(FirstB != LastB);
967 if (FirstB->end() == LastB->begin()) { make_trivial(); } assert(FirstB->constln() == this); assert(LastB->constln() == this);
968 assert(postprocess_begin == postprocess_end);
969 // 2.5: Choose a small splitter block SpB subset of SpC from P,
970 // i.e. |SpB| <= 1/2*|SpC|
971 /// It doesn't matter very much how ties are resolved here:
972 /// `part_tr.change_to_C()` is faster if the first block is selected to
973 /// be split off. `part_tr.split_s_inert_out()` is faster if the last
974 /// block is selected.
975 if (FirstB->size() > LastB->size())
976 {
977 // 2.6: Create a new constellation NewC
978 // 2.6: ... and move SpB from SpC to NewC
979 constln_t* NewC =
980 new constln_t(sort_key - (LastB->begin() - begin()),
981 LastB->begin(), end(), postprocess_end);
982 set_end(LastB->begin());
983 LastB->set_constln(NewC);
984 return LastB;
985 }
986 else
987 {
988 // 2.6: Create a new constellation NewC
989 // 2.6: ... and move SpB from SpC to NewC
990 constln_t* NewC =
991 new constln_t(sort_key - (end() - FirstB->end()), begin(),
992 FirstB->end(), postprocess_end);
993 set_begin(FirstB->end());
994 FirstB->set_constln(NewC);
995 return FirstB;
996 }
997 }
998 #ifndef NDEBUG
999 /// \brief print a constellation identification for debugging
1000 std::string debug_id() const
1001 {
1002 return "constellation [" +
1003 std::to_string(begin() - block_t::permutation_begin()) +
1004 "," + std::to_string(end() - block_t::permutation_begin()) +
1005 ") (#" + std::to_string(sort_key) + ")";
1006 }
1007 #endif
1008};
1009
1010
1011template <class LTS_TYPE>
1012class bisim_partitioner_gjkw_initialise_helper;
1013
1014class part_trans_t;
1015
1016/// \class part_state_t
1017/// \brief refinable partition data structure
1018/// \details This class collects all information about a partition of the
1019/// states.
1020class part_state_t
1021{
1022 public:
1023 /// \brief permutation array
1024 /// \details This is the central element of the data structure: In this
1025 /// array, states that belong to the same block are stored in adjacent
1026 /// elements, and blocks that belong to the same constellation are stored
1027 /// in adjacent slices.
1028 permutation_t permutation;
1029
1030 private:
1031 /// \brief array with all other information about states
1032 /// \details We allocate 1 additional ``state'' to allow for the iterators
1033 /// past the last transition, as described in the documentation of
1034 /// `state_info_entry`.
1035 fixed_vector<state_info_entry> state_info;
1036
1037 template <class LTS_TYPE>
1038 friend class bisim_partitioner_gjkw_initialise_helper;
1039 public:
1040 /// \brief constructor
1041 /// \details The constructor allocates memory, but does not actually
1042 /// initialise the partition. Immediately afterwards, the initialisation
1043 /// helper `bisim_partitioner_gjkw_initialise_helper::init_transitions()`
1044 /// should be called.
1045 /// \param n number of states in the Kripke structure
1046 part_state_t(state_type n)
1047 : permutation(n),
1048 state_info(n+1) //< an additional ``state'' is needed to store pointers
1049 // to the end of the slices of transitions of the last state
1050 { assert(0 == block_t::nr_of_blocks);
1051 #ifndef NDEBUG
1052 block_t::perm_begin = permutation.begin();
1053 state_info_entry::s_i_begin = state_info.data();
1054 state_info_entry::s_i_end = state_info_entry::s_i_begin + n;
1055 #endif
1056 }
1057
1058 /// \brief destructor
1059 /// \details The destructor assumes that the caller has already executed
1060 /// `clear()` to deallocate the memory for the partition.
1061 ~part_state_t()
1062 { assert(state_info.empty()); assert(permutation.empty());
1063 }
1064
1065 /// \brief deallocates constellations and blocks
1066 /// \details This function can be called shortly before destructing the
1067 /// partition. Afterwards, the data structure is in a unusable state,
1068 /// as all information on states, blocks and constellations is deleted and
1069 /// deallocated.
1070 void clear()
1071 {
1072 // We have to deallocate constellations first because deallocating
1073 // blocks makes the constellations inaccessible.
1074 for (permutation_iter_t permutation_iter = permutation.end();
1075 permutation.begin() != permutation_iter; )
1076 {
1077 constln_t* const C = permutation_iter[-1]->constln(); assert(C->end() == permutation_iter);
1078 // permutation_iter[-1]->block->set_constln(nullptr); // assert that constellation is trivial:
1079 assert(permutation_iter[-1]->block->begin() == C->begin());
1080 permutation_iter = C->begin();
1081 delete C;
1082 }
1083 #ifndef NDEBUG
1084 state_type deleted_blocks = 0;
1085 #endif
1086 for (permutation_iter_t permutation_iter = permutation.end();
1087 permutation.begin() != permutation_iter; )
1088 {
1089 block_t* const B = permutation_iter[-1]->block; assert(B->end() == permutation_iter);
1090 permutation_iter = B->begin();
1091 #ifndef NDEBUG
1092 if (BLOCK_NO_SEQNR != B->seqnr())
1093 {
1094 ++deleted_blocks;
1095 }
1096 else
1097 {
1098 assert(0 == deleted_blocks);
1099 }
1100#endif
1101 delete B;
1102 } assert(deleted_blocks == block_t::nr_of_blocks);
1103 block_t::nr_of_blocks = 0;
1104 state_info.clear();
1105 permutation.clear();
1106 }
1107
1108 /// \brief provide size of state space
1109 /// \returns the stored size of the state space
1110 state_type state_size() const { return permutation.size(); }
1111
1112 /// \brief find block of a state
1113 /// \param s number of the state
1114 /// \returns a pointer to the block where state s resides in
1115 const block_t* block(state_type s) const
1116 {
1117 return state_info[s].block;
1118 }
1119 #ifndef NDEBUG
1120 private:
1121 /// \brief print a slice of the partition (typically a block)
1122 /// \details If the slice indicated by the parameters is not empty, the
1123 /// states in this slice will be printed.
1124 /// \param message text printed as a title if the slice is not empty
1125 /// \param B block that is being printed (it is checked whether
1126 /// states belong to this block)
1127 /// \param begin iterator to the beginning of the slice
1128 /// \param end iterator past the end of the slice
1129 void print_block(const char* message, const block_t* B,
1130 permutation_const_iter_t begin, permutation_const_iter_t end) const;
1131 public:
1132 /// \brief print the partition as a tree (per constellation and block)
1133 /// \details The function prints all constellations (in order); for each
1134 /// constellation it prints the blocks it consists of; and for each block,
1135 /// it lists its states, separated into nonbottom and bottom states.
1136 /// \param part_tr partition for the transitions
1137 void print_part(const part_trans_t& part_tr) const;
1138
1139 /// \brief print all transitions
1140 /// \details For each state (in order), its outgoing transitions are
1141 /// listed, sorted by goal constellation. The function also indicates
1142 /// where the current constellation pointer of the state points at.
1143 void print_trans() const;
1144 #endif
1145};
1146
1147///@} (end of group part_state)
1148
1149
1150
1151
1152
1153/* ************************************************************************* */
1154/* */
1155/* T R A N S I T I O N S */
1156/* */
1157/* ************************************************************************* */
1158
1159
1160
1161
1162
1163/// \defgroup part_trans
1164/// \brief data structures for transitions used during partition refinement
1165/// \details These definitions provide a partition for transition data
1166/// structure that can be used for the partition refinement algorithm.
1167///
1168/// Basically, transitions are stored in three arrays:
1169/// - `pred`: transitions ordered by goal state, to allow finding all
1170/// predecessors of a goal state.
1171/// - `succ`: transitions ordered by source state and goal constellation, to
1172/// allow finding all successors of a source state. Given a transition in
1173/// this array, it is easy to find all transitions from the same source state
1174/// to the same goal constellation. It is possible to find out, in time
1175/// logarithmic in the out-degree, whether a state has a transition to a
1176/// given constellation.
1177/// - `B_to_C`: a permutation of the transitions such that transitions from the
1178/// same source block to the same goal constellation are adjacent. Further,
1179/// this array does not need a specific sort order.
1180///
1181/// Within this sort order, inert transitions are always placed after non-inert
1182/// transitions.
1183///
1184/// state_info_entry and block_t (defined above) contain pointers to the slices
1185/// of these arrays. For the incoming transitions, they contain enough
1186/// information; for the outgoing and the B_to_C-transitions, we additionally
1187/// use so-called _descriptors_ that show which slice belongs together.
1188/// The above was the original design described in our publication
1189/// [Groote/Jansen/Keiren/Wijs 2017]. This code reduces the descriptor for the
1190/// outgoing transitions to a single pointer, which is stored in the `succ`
1191/// array directly.
1192
1193///@{
1194
1195/* pred_entry, succ_entry, and B_to_C_entry contain the data that is stored
1196about a transition. Every transition has one of each data structure; the three
1197structures are linked through the iterators (used here as pointers). */
1198class succ_entry
1199{
1200 public:
1201 B_to_C_iter_t B_to_C;
1202 state_info_ptr target = nullptr;
1203
1204 private:
1205 /// \brief points to the last or the first transition to the same
1206 /// constellation
1207 /// \details We need to know, given a transition, which other transitions
1208 /// with the same source state and the same goal constellation there are.
1209 /// This pointer, in most cases, points to the last transition with the
1210 /// same source state and goal constellation, with the exception: If this
1211 /// `succ_entry` is actually the last transition, then the pointer points
1212 /// to the first such transition. In that way, one can find the first and
1213 /// the last relevant transition with one or two levels of dereferencing.
1214 ///
1215 /// The advantage of this pointer is that one does not need to allocate a
1216 /// separate data structure containing this information.
1217 succ_iter_t int_slice_begin_or_before_end;
1218 public:
1219
1220 succ_iter_t slice_begin_or_before_end()
1221 {
1222 return int_slice_begin_or_before_end;
1223 }
1224
1225 succ_const_iter_t slice_begin_or_before_end() const
1226 {
1227 return int_slice_begin_or_before_end;
1228 }
1229
1230 void set_slice_begin_or_before_end(succ_iter_t new_value)
1231 {
1232 int_slice_begin_or_before_end = new_value;
1233 }
1234
1235
1236 succ_iter_t slice_begin()
1237 {
1238 if (this < &*int_slice_begin_or_before_end)
1239 { assert(&*int_slice_begin_or_before_end->int_slice_begin_or_before_end <= this);
1240 return int_slice_begin_or_before_end->
1241 int_slice_begin_or_before_end;
1242 } assert(&*int_slice_begin_or_before_end->int_slice_begin_or_before_end == this);
1243 return int_slice_begin_or_before_end;
1244 }
1245
1246 succ_const_iter_t slice_begin() const
1247 {
1248 if (this < &*int_slice_begin_or_before_end)
1249 { assert(&*int_slice_begin_or_before_end->int_slice_begin_or_before_end <= this);
1250 return int_slice_begin_or_before_end->
1251 int_slice_begin_or_before_end;
1252 } assert(&*int_slice_begin_or_before_end->int_slice_begin_or_before_end == this);
1253 return int_slice_begin_or_before_end;
1254 }
1255
1256 static succ_iter_t slice_end(succ_iter_t this_)
1257 {
1258 if (this_ < this_->int_slice_begin_or_before_end)
1259 { assert(this_->int_slice_begin_or_before_end->
1260 int_slice_begin_or_before_end <= this_);
1261 return this_->int_slice_begin_or_before_end + 1;
1262 } assert(this_->int_slice_begin_or_before_end->
1263 int_slice_begin_or_before_end == this_);
1264 // The following line requires an iterator but a normal method would
1265 // only have a pointer, not an iterator. That's why we need to jump
1266 // through the `static` hoop.
1267 return this_ + 1;
1268 }
1269
1270 static succ_const_iter_t slice_end(succ_const_iter_t this_)
1271 {
1272 if (this_ < this_->int_slice_begin_or_before_end)
1273 { assert(this_->int_slice_begin_or_before_end->
1274 int_slice_begin_or_before_end <= this_);
1275 return this_->int_slice_begin_or_before_end + 1;
1276 } assert(this_->int_slice_begin_or_before_end->
1277 int_slice_begin_or_before_end == this_);
1278 // The following line requires an iterator but a normal method would
1279 // only have a pointer, not an iterator. That's why we need to jump
1280 // through the `static` hoop.
1281 return this_ + 1;
1282 }
1283 #if !defined(NDEBUG) || defined(COUNT_WORK_BALANCE)
1284 /// adds work (for time complexity measurement) to every transition in the
1285 /// slice to which `this_` belongs.
1286 static void slice_add_work_to_transns(succ_const_iter_t this_,
1287 enum check_complexity::counter_type ctr, unsigned max_value);
1288 #endif
1289};
1290
1291
1292class pred_entry
1293{
1294 public:
1295 succ_iter_t succ;
1296 state_info_ptr source = nullptr;
1297#ifndef NDEBUG
1298 /// \brief print a short transition identification for debugging
1299 /// \details This function is only available if compiled in Debug mode.
1300 std::string debug_id_short() const
1301 {
1302 return "from " + source->debug_id_short() + " to " +
1303 succ->target->debug_id_short();
1304 }
1305
1306 /// \brief print a transition identification for debugging
1307 /// \details This function is only available if compiled in Debug mode.
1308 std::string debug_id() const
1309 {
1310 return "transition " + debug_id_short();
1311 }
1312 #endif
1313 #if !defined(NDEBUG) || defined(COUNT_WORK_BALANCE)
1314 mutable check_complexity::trans_counter_t work_counter;
1315 #endif
1316};
1317
1318
1319class B_to_C_entry
1320{
1321 public:
1322 pred_iter_t pred;
1323 B_to_C_desc_iter_t B_to_C_slice;
1324};
1325 #if !defined(NDEBUG) || defined(COUNT_WORK_BALANCE)
1326 /// adds work (for time complexity measurement) to every transition in the
1327 /// slice.
1328 inline void succ_entry::slice_add_work_to_transns(succ_const_iter_t this_,
1329 enum check_complexity::counter_type ctr, unsigned max_value)
1330 {
1331 succ_const_iter_t iter = this_->slice_begin();
1332 succ_const_iter_t end = slice_end(this_); (void) end;
1333 assert(iter < end);
1334 mCRL2complexity(iter->B_to_C->pred, add_work(ctr, max_value), );
1335 #ifndef NDEBUG
1336 while (++iter != end)
1337 {
1338 // treat temporary counters specially
1339 mCRL2complexity(iter->B_to_C->pred,
1340 add_work_notemporary(ctr, max_value), );
1341 }
1342 #endif
1343 }
1344 #endif
1345/* B_to_C_descriptor is a data type that indicates which slice of states
1346belongs together. */
1347class B_to_C_descriptor
1348{
1349 public:
1350 B_to_C_iter_t end, begin;
1351
1352 B_to_C_descriptor(B_to_C_iter_t begin_, B_to_C_iter_t end_)
1353 : end(end_),
1354 begin(begin_)
1355 { }
1356
1357 /// compute the source block of the transitions in this slice
1358 const block_t* from_block() const
1359 { assert(begin < end); assert(begin->pred->succ->B_to_C == begin);
1360 return begin->pred->source->block;
1361 }
1362 block_t* from_block()
1363 { assert(begin < end); assert(begin->pred->succ->B_to_C == begin);
1364 return begin->pred->source->block;
1365 }
1366
1367 /// compute the goal constellation of the transitions in this slice
1368 const constln_t* to_constln() const
1369 { assert(begin < end); assert(begin->pred->succ->B_to_C == begin);
1370 return begin->pred->succ->target->constln();
1371 }
1372 constln_t* to_constln()
1373 { assert(begin < end); assert(begin->pred->succ->B_to_C == begin);
1374 return begin->pred->succ->target->constln();
1375 }
1376
1377 /// \brief returns true iff the slice is marked for postprocessing
1378 /// \details The function uses the data registered with the goal
1379 /// constellation.
1380 bool needs_postprocessing() const
1381 { assert(to_constln()->postprocess_end <= begin ||
1382 end <= to_constln()->postprocess_end);
1383 assert(to_constln()->postprocess_begin <= begin ||
1384 end <= to_constln()->postprocess_begin);
1385 return to_constln()->postprocess_begin <= begin &&
1386 end <= to_constln()->postprocess_end;
1387 }
1388 #ifndef NDEBUG
1389 /// \brief print a B_to_C slice identification for debugging
1390 /// \details This function is only available if compiled in Debug mode.
1391 std::string debug_id() const
1392 {
1393 assert(begin < end);
1394 std::string result("slice containing transition");
1395 if (end - begin > 1)
1396 {
1397 result += "s ";
1398 }
1399 else
1400 {
1401 result += " ";
1402 }
1403 B_to_C_const_iter_t iter = begin;
1404 assert(iter->pred->succ->B_to_C == iter);
1405 result += iter->pred->debug_id_short();
1406 if (end - iter > 4)
1407 {
1408 assert(iter[1].pred->succ->B_to_C == iter+1);
1409 result += ", ";
1410 result += iter[1].pred->debug_id_short();
1411 result += ", ...";
1412 iter = end - 3;
1413 }
1414 while (++iter != end)
1415 {
1416 assert(iter->pred->succ->B_to_C == iter);
1417 result += ", ";
1418 result += iter->pred->debug_id_short();
1419 }
1420 return result;
1421 }
1422 #endif
1423 #if !defined(NDEBUG) || defined(COUNT_WORK_BALANCE)
1424 /// The function is meant to transfer work temporarily assigned to the
1425 /// B_to_C slice to the transitions in the slice. It is used during
1426 /// handling of new bottom states, so the work is only assigned to
1427 /// transitions that start in a (new) bottom state.
1428 /// If at this moment no such (new) bottom state has been found, the work
1429 /// is kept with the slice and the function returns false. The work should
1430 /// be transferred later (but if there is no later transfer, it should be
1431 /// tested that the function returns true).
1432 bool add_work_to_bottom_transns(enum check_complexity::counter_type ctr,
1433 unsigned max_value)
1434 {
1435 bool added = false;
1436
1437 for (B_to_C_const_iter_t iter = begin; iter != end; ++iter)
1438 {
1439 if (iter->pred->source->pos >=
1440 iter->pred->source->block->bottom_begin())
1441 {
1442 // source state of the transition is a bottom state
1443 #ifndef NDEBUG
1444 if (added)
1445 {
1446 mCRL2complexity(iter->pred,
1447 add_work_notemporary(ctr, max_value), );
1448 continue;
1449 }
1450 #endif
1451 mCRL2complexity(iter->pred, add_work(ctr, max_value), );
1452 added = true;
1453 #ifdef NDEBUG
1454 break;
1455 #endif
1456 }
1457 }
1458 return added;
1459 }
1460
1461 mutable check_complexity::B_to_C_counter_t work_counter;
1462 #endif
1463};
1464
1465
1466/* part_trans_t collects and organises all data for the transitions. */
1467class part_trans_t
1468{
1469 private:
1470 fixed_vector<pred_entry> pred;
1471 fixed_vector<succ_entry> succ;
1472 fixed_vector<B_to_C_entry> B_to_C;
1473
1474 template <class LTS_TYPE>
1475 friend class bisim_partitioner_gjkw_initialise_helper;
1476
1477 void swap_in(B_to_C_iter_t const pos1, B_to_C_iter_t const pos2)
1478 { assert(B_to_C.end() > pos1); assert(pos1->pred->succ->B_to_C == pos1);
1479 assert(B_to_C.end() > pos2); assert(pos2->pred->succ->B_to_C == pos2);
1480 // swap contents
1481 pred_entry const temp_entry(*pos1->pred);
1482 *pos1->pred = *pos2->pred;
1483 *pos2->pred = temp_entry;
1484 // swap pointers to contents
1485 pred_iter_t const temp_iter(pos1->pred);
1486 pos1->pred = pos2->pred;
1487 pos2->pred = temp_iter; assert(B_to_C.end() > pos1); assert(pos1->pred->succ->B_to_C == pos1);
1488 assert(B_to_C.end() > pos2); assert(pos2->pred->succ->B_to_C == pos2);
1489 }
1490
1491 void swap_out(pred_iter_t const pos1, pred_iter_t const pos2)
1492 { assert(pred.end() > pos1); assert(pos1->succ->B_to_C->pred == pos1);
1493 assert(pred.end() > pos2); assert(pos2->succ->B_to_C->pred == pos2);
1494 assert(pos1->succ->slice_begin() == pos2->succ->slice_begin());
1495 assert(succ_entry::slice_end(pos1->succ) == succ_entry::slice_end(pos2->succ));
1496 // swap contents, but do not swap slice_begin_or_before_end
1497 B_to_C_iter_t const temp_B_to_C(pos1->succ->B_to_C);
1498 state_info_ptr temp_target(pos1->succ->target);
1499 pos1->succ->B_to_C = pos2->succ->B_to_C;
1500 pos1->succ->target = pos2->succ->target;
1501 pos2->succ->B_to_C = temp_B_to_C;
1502 pos2->succ->target = temp_target;
1503 // swap pointers to contents
1504 succ_iter_t const temp_iter(pos1->succ);
1505 pos1->succ = pos2->succ;
1506 pos2->succ = temp_iter; assert(pred.end() > pos1); assert(pos1->succ->B_to_C->pred == pos1);
1507 assert(pred.end() > pos2); assert(pos2->succ->B_to_C->pred == pos2);
1508 assert(pos1->succ->slice_begin() == pos2->succ->slice_begin());
1509 assert(succ_entry::slice_end(pos1->succ) == succ_entry::slice_end(pos2->succ));
1510 }
1511
1512 void swap_B_to_C(succ_iter_t const pos1, succ_iter_t const pos2)
1513 { assert(succ.end() > pos1); assert(pos1->B_to_C->pred->succ == pos1);
1514 assert(succ.end() > pos2); assert(pos2->B_to_C->pred->succ == pos2);
1515 if (pos1 != pos2)
1516 {
1517 // swap contents
1518 std::swap(*pos1->B_to_C,*pos2->B_to_C);
1519 // swap pointers to contents
1520 B_to_C_iter_t const temp_iter(std::move(pos1->B_to_C));
1521 pos1->B_to_C = std::move(pos2->B_to_C);
1522 pos2->B_to_C = std::move(temp_iter);
1523 } assert(succ.end() > pos1); assert(pos1->B_to_C->pred->succ == pos1);
1524 assert(succ.end() > pos2); assert(pos2->B_to_C->pred->succ == pos2);
1525 }
1526
1527 // *pos1 -> *pos2 -> *pos3 -> *pos1, where pos3 is between pos1 and pos2
1528 void swap3_B_to_C(succ_iter_t const pos1, succ_iter_t const pos2,
1529 succ_iter_t const pos3)
1530 { assert((pos1->B_to_C <= pos3->B_to_C && pos3->B_to_C <= pos2->B_to_C) ||
1531 (pos2->B_to_C <= pos3->B_to_C && pos3->B_to_C <= pos1->B_to_C));
1532 if (pos2 == pos3 || pos1 == pos3)
1533 {
1534 swap_B_to_C(pos1, pos2);
1535 }
1536 else
1537 { assert(succ.end() > pos1); assert(pos1->B_to_C->pred->succ == pos1);
1538 assert(succ.end() > pos2); assert(pos2->B_to_C->pred->succ == pos2);
1539 assert(succ.end() > pos3); assert(pos3->B_to_C->pred->succ == pos3);
1540 assert(pos1 != pos2); assert(pos1 != pos3); assert(pos2 != pos3);
1541 // swap contents
1542 B_to_C_entry const temp_entry(std::move(*pos1->B_to_C));
1543 *pos1->B_to_C = std::move(*pos3->B_to_C);
1544 *pos3->B_to_C = std::move(*pos2->B_to_C);
1545 *pos2->B_to_C = std::move(temp_entry);
1546 // swap pointers to contents
1547 B_to_C_iter_t const temp_iter(std::move(pos2->B_to_C));
1548 pos2->B_to_C = std::move(pos3->B_to_C);
1549 pos3->B_to_C = std::move(pos1->B_to_C);
1550 pos1->B_to_C = std::move(temp_iter); assert(succ.end() > pos1); assert(pos1->B_to_C->pred->succ == pos1);
1551 assert(succ.end() > pos2); assert(pos2->B_to_C->pred->succ == pos2);
1552 assert(succ.end() > pos3); assert(pos3->B_to_C->pred->succ == pos3);
1553 }
1554 }
1555 public:
1556 part_trans_t(trans_type m)
1557 : pred(m),
1558 succ(m),
1559 B_to_C(m)
1560 { }
1561 ~part_trans_t()
1562 { assert(B_to_C.empty()); assert(succ.empty()); assert(pred.empty());
1563 }
1564
1565 /// clear allocated memory
1566 void clear()
1567 {
1568 // B_to_C_descriptors are deallocated when their respective lists are
1569 // deallocated by destructing the blocks.
1570 B_to_C.clear();
1571 succ.clear();
1572 pred.clear();
1573 }
1574
1575 trans_type trans_size() const { return pred.size(); }
1576
1577 /* split_inert_to_C splits the B_to_C slice of block b to its own
1578 constellation into two slices: one for the inert and one for the non-inert
1579 transitions. It is called with SpB just after a constellation is split, as
1580 the transitions from SpB to itself (= the inert transitions) now go to a
1581 different constellation than the other transitions from SpB to its old
1582 constellation. It does, however, not adapt the other transition arrays to
1583 reflect that noninert and inert transitions from block b would go to
1584 different constellations.
1585 Its time complexity is O(1+min {|out_noninert(b-->C)|, |out_inert(b)|}). */
1586 void split_inert_to_C(block_t* B);
1587
1588 /* part_trans_t::change_to_C has to be called after a transition target has
1589 changed its constellation. The member function will adapt the transition
1590 data structure. It assumes that the transition is non-inert and that the
1591 new constellation does not (yet) have inert incoming transitions. It
1592 returns the boundary between transitions to OldC and transitions to NewC in
1593 the state's outgoing transition array. */
1594 succ_iter_t change_to_C(pred_iter_t pred_iter, ONLY_IF_DEBUG( constln_t* SpC, constln_t* NewC, )
1595 bool first_transition_of_state, bool first_transition_of_block);
1596
1597 /* split_s_inert_out splits the outgoing transitions from s to its own
1598 constellation into two: the inert transitions become transitions to the
1599 new constellation of which s is now part; the non-inert transitions remain
1600 transitions to OldC. It returns the boundary between transitions to
1601 OldC and transitions to NewC in the outgoing transition array of s.
1602 Its time complexity is O(1 + min { |out_\nottau(s)|, |out_\tau(s)| }). */
1603 bool split_s_inert_out(state_info_ptr s ONLY_IF_DEBUG(, constln_t* OldC)
1604 );
1605
1606 /* part_trans_t::make_noninert makes the transition identified by succ_iter
1607 noninert. */
1608 void make_noninert(succ_iter_t const succ_iter)
1609 {
1610 // change B_to_C
1611 B_to_C_iter_t const other_B_to_C =
1612 succ_iter->B_to_C->pred->source->block->inert_begin(); assert(succ_iter->B_to_C->B_to_C_slice->begin <= other_B_to_C);
1613 assert(other_B_to_C <= succ_iter->B_to_C);
1614 assert(succ_iter->B_to_C < succ_iter->B_to_C->B_to_C_slice->end);
1615 swap_B_to_C(succ_iter, other_B_to_C->pred->succ);
1616 succ_iter->B_to_C->pred->source->block->set_inert_begin(other_B_to_C +
1617 1);
1618 // change pred
1619 pred_iter_t const other_pred = succ_iter->target->inert_pred_begin(); assert(succ_iter->target->pred_begin() <= other_pred);
1620 assert(other_pred <= succ_iter->B_to_C->pred);
1621 assert(succ_iter->B_to_C->pred < succ_iter->target->pred_end());
1622 swap_in(succ_iter->B_to_C, other_pred->succ->B_to_C);
1623 succ_iter->target->set_inert_pred_begin(other_pred + 1);
1624 // change succ
1625 succ_iter_t const other_succ =
1626 succ_iter->B_to_C->pred->source->inert_succ_begin(); assert(succ_iter->B_to_C->pred->source->succ_begin() <= other_succ);
1627 assert(other_succ <= succ_iter);
1628 assert(succ_iter < succ_iter->B_to_C->pred->source->succ_end());
1629 swap_out(succ_iter->B_to_C->pred, other_succ->B_to_C->pred);
1630 succ_iter->B_to_C->pred->source->set_inert_succ_begin(other_succ + 1);
1631 }
1632
1633 /* part_trans_t::new_block_created splits the B_to_C-slices to reflect that
1634 some transitions now start in the new block NewB. They can no longer be in
1635 the same slice as the transitions that start in the old block.
1636
1637 We need separate functions for blue and red blocks because the B_to_C-slice
1638 of the red block should come after the B_to_C-slice of the blue block,
1639 at least while postprocessing.
1640
1641 Its time complexity is O(1 + |out(NewB)|). */
1642 void new_blue_block_created(block_t* OldB, block_t* NewB);
1643 void new_red_block_created(block_t*OldB,block_t*NewB, bool postprocessing);
1644
1645 B_to_C_const_iter_t B_to_C_begin() const { return B_to_C.begin(); }
1646 B_to_C_iter_t B_to_C_end () { return B_to_C.end (); }
1647 pred_const_iter_t pred_end() const { return pred.end(); }
1648 succ_const_iter_t succ_end() const { return succ.end(); }
1649 #ifndef NDEBUG
1650 /// \brief assert that the data structure is consistent and stable
1651 void assert_stability(const part_state_t& part_st) const;
1652 #endif
1653};
1654
1655///@} (end of group part_trans)
1656
1657
1658
1659
1660
1661
1662/* ************************************************************************* */
1663/* */
1664/* A L G O R I T H M S */
1665/* */
1666/* ************************************************************************* */
1667
1668
1669
1670
1671
1672/// \defgroup part_refine
1673/// \brief classes to calculate the stutter equivalence quotient of a LTS
1674///@{
1675
1676
1677
1678/*=============================================================================
1679= create initial partition and data structures =
1680=============================================================================*/
1681
1682
1683
1684/// \class bisim_partitioner_gjkw_initialise_helper
1685/// \brief helps with initialising the refinable partition data structure
1686/// \details Before allocating memory for the refinable partition data
1687/// structure, the number of states and transitions (including extra states
1688/// generated by the translation from labelled transition system to Kripke
1689/// structure) has to be known. This class serves to calculate these numbers.
1690///
1691/// The helper class also initialises the variables used by check_complexity to
1692/// find the number of states and transitions in time complexity checks.
1693template<class LTS_TYPE>
1694class bisim_partitioner_gjkw_initialise_helper
1695{
1696 private:
1697 LTS_TYPE& aut;
1698 state_type nr_of_states;
1699 const state_type orig_nr_of_states;
1700 trans_type nr_of_transitions;
1701
1702 // key and hash function for (action, target state) pair. Required since
1703 // unordered_map does not directly allow to use pair keys
1704 class Key
1705 {
1706 public:
1707 label_type first;
1708 state_type second;
1709
1710 Key(const label_type& f, const state_type& s)
1711 : first(f),
1712 second(s)
1713 {}
1714
1715 bool operator==(const Key &other) const
1716 {
1717 return first == other.first && second == other.second;
1718 }
1719 };
1720
1721 class KeyHasher
1722 {
1723 public:
1724 std::size_t operator()(const Key& k) const
1725 {
1726 return std::hash<label_type>()(k.first) ^
1727 (std::hash<state_type>()(k.second) << 1);
1728 }
1729 };
1730 // Map used to convert LTS to Kripke structure
1731 // (also used when converting Kripke structure back to LTS)
1732 std::unordered_map<Key, state_type, KeyHasher> extra_kripke_states;
1733
1734 // temporary map to keep track of blocks. maps transition labels (different
1735 // from tau) to blocks
1736 std::unordered_map<label_type, state_type> action_block_map;
1737
1738 std::vector<state_type> noninert_out_per_state, inert_out_per_state;
1739 std::vector<state_type> noninert_in_per_state, inert_in_per_state;
1740 std::vector<state_type> noninert_out_per_block, inert_out_per_block;
1741 std::vector<state_type> states_per_block;
1742 state_type nr_of_nonbottom_states = 0;
1743 public:
1744 bisim_partitioner_gjkw_initialise_helper(LTS_TYPE& l, bool branching,
1745 bool preserve_divergence);
1746
1747 /// initialise the state in part_st and the transitions in part_tr
1748 void init_transitions(part_state_t& part_st, part_trans_t& part_tr,
1749 bool branching, bool preserve_divergence);
1750
1751 // replace_transition_system() replaces the transitions of the LTS stored here by
1752 // those of its bisimulation quotient. However, it does not change
1753 // anything else; in particular, it does not change the number of states of
1754 // the LTS.
1755 void replace_transition_system(const part_state_t& part_st, ONLY_IF_DEBUG( bool branching, )
1756 bool preserve_divergence);
1757
1758 /// provides the number of states in the Kripke structure
1759 state_type get_nr_of_states() const { return nr_of_states; }
1760
1761 /// provides the number of transitions in the Kripke structure
1762 trans_type get_nr_of_transitions() const { return nr_of_transitions; }
1763};
1764
1765
1766
1767/*=============================================================================
1768= main class =
1769=============================================================================*/
1770
1771
1772
1773struct refine_shared_t;
1774
1775} // end namespace bisim_gjkw
1776
1777/// \class bisim_partitioner_gjkw
1778/// \brief implements the main algorithm for the stutter equivalence quotient
1779template <class LTS_TYPE>
1780class bisim_partitioner_gjkw
1781{
1782 private:
1783 bisim_gjkw::bisim_partitioner_gjkw_initialise_helper<LTS_TYPE> init_helper;
1784 bisim_gjkw::part_state_t part_st;
1785 bisim_gjkw::part_trans_t part_tr;
1786 public:
1787 // The constructor constructs the data structures and immediately
1788 // calculates the bisimulation quotient. However, it does not change the
1789 // LTS.
1790 bisim_partitioner_gjkw(LTS_TYPE& l, bool branching = false,
1791 bool preserve_divergence = false)
1792 : init_helper(l, branching, preserve_divergence),
1793 part_st(init_helper.get_nr_of_states()),
1794 part_tr(init_helper.get_nr_of_transitions())
1795 { assert(branching || !preserve_divergence);
1796 create_initial_partition_gjkw(branching, preserve_divergence);
1797 refine_partition_until_it_becomes_stable_gjkw();
1798 }
1799 ~bisim_partitioner_gjkw()
1800 {
1801 part_tr.clear();
1802 part_st.clear();
1803 }
1804
1805 // replace_transition_system() replaces the transitions of the LTS stored here by
1806 // those of its bisimulation quotient. However, it does not change
1807 // anything else; in particular, it does not change the number of states of
1808 // the LTS.
1809 void replace_transition_system(bool branching, bool preserve_divergence)
1810 {
1811 (void) branching; // avoid warning about unused parameter.
1812 init_helper.replace_transition_system(part_st, ONLY_IF_DEBUG( branching, )
1813 preserve_divergence);
1814 }
1815
1816 static state_type num_eq_classes()
1817 {
1818 return bisim_gjkw::block_t::nr_of_blocks;
1819 }
1820
1821 state_type get_eq_class(state_type s) const
1822 {
1823 return part_st.block(s)->seqnr();
1824 }
1825
1826 bool in_same_class(state_type s, state_type t) const
1827 {
1828 return part_st.block(s) == part_st.block(t);
1829 }
1830
1831 private:
1832
1833 /*-------- dbStutteringEquivalence -- Algorithm 2 of [GJKW 2017] --------*/
1834
1835 void create_initial_partition_gjkw(bool branching,
1836 bool preserve_divergence);
1837 void refine_partition_until_it_becomes_stable_gjkw();
1838
1839 /*----------------- Refine -- Algorithm 3 of [GJKW 2017] ----------------*/
1840
1841 bisim_gjkw::block_t* refine(bisim_gjkw::block_t* RfnB,
1842 const bisim_gjkw::constln_t* SpC,
1843 const bisim_gjkw::B_to_C_descriptor* FromRed,
1844 bool postprocessing
1845 #if !defined(NDEBUG) || defined(COUNT_WORK_BALANCE)
1846 , const bisim_gjkw::constln_t* NewC = nullptr
1847 #endif
1848 );
1849
1850 /*--------- PostprocessNewBottom -- Algorithm 4 of [GJKW 2017] ----------*/
1851
1852 bisim_gjkw::block_t* postprocess_new_bottom(bisim_gjkw::block_t* RedB);
1853};
1854
1855///@} (end of group part_refine)
1856
1857
1858
1859
1860
1861/* ************************************************************************* */
1862/* */
1863/* I N T E R F A C E */
1864/* */
1865/* ************************************************************************* */
1866
1867
1868
1869
1870
1871/// \defgroup part_interface
1872/// \brief nonmember functions serving as interface with the rest of mCRL2
1873/// \details These functions are copied, almost without changes, from
1874/// liblts_bisim_gw.h, which was written by Anton Wijs.
1875///@{
1876
1877/** \brief Reduce transition system l with respect to strong or (divergence
1878 * preserving) branching bisimulation.
1879 * \param[in,out] l The transition system that is reduced.
1880 * \param branching If true branching bisimulation is
1881 * applied, otherwise strong bisimulation.
1882 * \param preserve_divergence Indicates whether loops of internal
1883 * actions on states must be preserved. If
1884 * false these are removed. If true these
1885 * are preserved. */
1886template <class LTS_TYPE>
1887void bisimulation_reduce_gjkw(LTS_TYPE& l, bool branching = false,
1888 bool preserve_divergence = false);
1889
1890/** \brief Checks whether the two initial states of two LTSs are strong or
1891 * branching bisimilar.
1892 * \details The LTSs l1 and l2 are not usable anymore after this call.
1893 * The space consumption is O(n) and time is O(m log n). It uses the branching
1894 * bisimulation algorithm by Groote/Jansen/Keiren/Wijs.
1895 * \param[in,out] l1 A first transition system.
1896 * \param[in,out] l2 A second transistion system.
1897 * \param branching If true branching bisimulation is used,
1898 * otherwise strong bisimulation is applied.
1899 * \param preserve_divergence If true and branching is true, preserve
1900 * tau loops on states.
1901 * \retval True iff the initial states of the current transition system and l2
1902 * are (divergence preserving) (branching) bisimilar. */
1903template <class LTS_TYPE>
1904bool destructive_bisimulation_compare_gjkw(LTS_TYPE& l1, LTS_TYPE& l2,
1905 bool branching = false, bool preserve_divergence = false,
1906 bool generate_counter_examples = false);
1907
1908/** \brief Checks whether the two initial states of two LTSs are strong or
1909 * branching bisimilar.
1910 * \details The LTSs l1 and l2 are first duplicated and subsequently reduced
1911 * modulo bisimulation. If memory space is a concern, one could consider to use
1912 * destructive_bisimulation_compare. This routine uses the O(m log n) branching
1913 * bisimulation routine. It runs in O(m log n) time and uses O(n) memory, where
1914 * n is the number of states and m is the number of transitions.
1915 * \param[in,out] l1 A first transition system.
1916 * \param[in,out] l2 A second transistion system.
1917 * \param branching If true branching bisimulation is used,
1918 * otherwise strong bisimulation is applied.
1919 * \param preserve_divergence If true and branching is true, preserve
1920 * tau loops on states.
1921 * \retval True iff the initial states of the current transition system and l2
1922 * are (divergence preserving) (branching) bisimilar. */
1923template <class LTS_TYPE>
1924bool bisimulation_compare_gjkw(const LTS_TYPE& l1, const LTS_TYPE& l2,
1925 bool branching = false, bool preserve_divergence = false);
1926
1927/// calculates the bisimulation quotient of a LTS.
1928template <class LTS_TYPE>
1929void bisimulation_reduce_gjkw(LTS_TYPE& l, bool const branching /* = false */,
1930 bool const preserve_divergence /* = false */)
1931{
1932 // First, remove tau loops in case of branching bisimulation.
1933 if (branching)
1934 {
1935 scc_reduce(l, preserve_divergence);
1936 }
1937
1938 // Second, apply the branching bisimulation reduction algorithm. If there are
1939 // no taus, this will automatically yield strong bisimulation.
1940 detail::bisim_partitioner_gjkw<LTS_TYPE> bisim_part(l, branching,
1941 preserve_divergence);
1942
1943 // Assign the reduced LTS
1944 bisim_part.replace_transition_system(branching, preserve_divergence);
1945}
1946
1947template <class LTS_TYPE>
1948inline bool bisimulation_compare_gjkw(const LTS_TYPE& l1, const LTS_TYPE& l2,
1949 bool branching /* = false */, bool preserve_divergence /* = false */)
1950{
1951 LTS_TYPE l1_copy(l1);
1952 LTS_TYPE l2_copy(l2);
1953 return destructive_bisimulation_compare_gjkw(l1_copy, l2_copy, branching,
1954 preserve_divergence);
1955}
1956
1957template <class LTS_TYPE>
1958bool destructive_bisimulation_compare_gjkw(LTS_TYPE& l1, LTS_TYPE& l2,
1959 bool branching /* = false */, bool preserve_divergence /* = false */,
1960 bool generate_counter_examples /* = false */,
1961 const std::string& /*counter_example_file = "" */,
1962 bool /*structured_output = false */)
1963{
1964 if (generate_counter_examples)
1965 {
1966 mCRL2log(log::warning) << "The GJKW branching bisimulation algorithm does "
1967 "not generate counterexamples.\n";
1968 }
1969 state_type init_l2 = l2.initial_state() + l1.num_states();
1970 mcrl2::lts::detail::merge(l1, l2);
1971 l2.clear(); // No use for l2 anymore.
1972
1973 // First remove tau loops in case of branching bisimulation.
1974 if (branching)
1975 {
1976 detail::scc_partitioner<LTS_TYPE> scc_part(l1);
1977 scc_part.replace_transition_system(preserve_divergence);
1978 init_l2 = scc_part.get_eq_class(init_l2);
1979 }
1980
1981 detail::bisim_partitioner_gjkw<LTS_TYPE> bisim_part(l1, branching,
1982 preserve_divergence);
1983 return bisim_part.in_same_class(l1.initial_state(), init_l2);
1984}
1985
1986///@} (end of group part_interface)
1987
1988
1989
1990
1991
1992/* ************************************************************************* */
1993/* */
1994/* I M P L E M E N T A T I O N S */
1995/* */
1996/* ************************************************************************* */
1997
1998
1999
2000
2001
2002// This section contains implementations of functions that refer to details of
2003// classes defined later, so they could not be defined at the point of
2004// declaration.
2005
2006namespace bisim_gjkw
2007{
2008
2009/// get the constellation of the state
2010inline const constln_t* state_info_entry::constln() const
2011{
2012 return block->constln();
2013}
2014
2015inline constln_t* state_info_entry::constln()
2016{
2017 return block->constln();
2018}
2019
2020/// read FromRed
2021inline B_to_C_descriptor* block_t::FromRed(const constln_t* const SpC)
2022{
2023 if (!to_constln.empty() && to_constln.front().to_constln() == SpC)
2024 {
2025 return &*to_constln.begin();
2026 }
2027 else
2028 {
2029 #ifndef NDEBUG
2030 for (B_to_C_desc_const_iter_t iter = to_constln.begin();
2031 to_constln.end() != iter; ++iter)
2032 {
2033 assert(iter->from_block() == this);
2034 assert(iter->to_constln() != SpC);
2035 }
2036 #endif
2037 return nullptr;
2038 }
2039}
2040
2041
2042/// set FromRed to an existing element in to_constln
2043inline void block_t::SetFromRed(B_to_C_desc_iter_t const new_fromred)
2044{ assert(!to_constln.empty());
2045 if (to_constln.begin() != new_fromred)
2046 {
2047 to_constln.splice(to_constln.begin(), to_constln, new_fromred);
2048 } assert(new_fromred->from_block() == this);
2049}
2050
2051
2052/// \brief quick check to find out whether the state has a transition to `SpC`
2053/// \details If the current constellation pointer happens to be set to `SpC`,
2054/// the function can quickly find out whether the state has a transition to
2055/// `SpC`.
2056/// The function should not be called for the constellation in which the state
2057/// resides.
2058/// \param SpC constellation of interest
2059/// \returns true if the state is known to have a transition to `SpC`
2060/// \memberof state_info_entry
2061inline bool state_info_entry::surely_has_transition_to(const constln_t* const
2062 SpC) const
2063{ assert(succ_begin()<=current_constln()); assert(current_constln()<=succ_end());
2064 assert(succ_begin() == current_constln() || succ_end() == current_constln() ||
2065 *current_constln()[-1].target->constln() <
2066 *current_constln()->target->constln());
2067 assert(constln() != SpC);
2068 // either current_constln()->target or current_constln()[-1].target is in
2069 // SpC
2070 if (current_constln() != succ_end() &&
2071 current_constln()->target->constln() == SpC)
2072 {
2073 return true;
2074 }
2075 return false;
2076}
2077
2078
2079/// \brief quick check to find out whether the state has _no_ transition to
2080/// `SpC`
2081/// \details If the current constellation pointer happens to be set to `SpC` or
2082/// its successor, the function can quickly find out whether the state has a
2083/// transition to `SpC`.
2084/// The function should not be called for the constellation in which the state
2085/// resides.
2086/// \param SpC constellation of interest
2087/// \returns true if the state is known to have _no_ transition to `SpC`
2088/// \memberof state_info_entry
2089inline bool state_info_entry::surely_has_no_transition_to(
2090 const constln_t* const SpC) const
2091{ assert(succ_begin()<=current_constln()); assert(current_constln()<=succ_end());
2092 assert(succ_begin() == current_constln() || succ_end() == current_constln() ||
2093 *current_constln()[-1].target->constln() <
2094 *current_constln()->target->constln());
2095 assert(constln() != SpC);
2096 // condition:
2097 // current_constln()->target is in a constellation > SpC and
2098 // current_constln()[-1].target is in a constellation < SpC.
2099 if (current_constln() != succ_end() &&
2100 *current_constln()->target->constln() <= *SpC)
2101 {
2102 return false;
2103 }
2104 if (current_constln() != succ_begin() &&
2105 *SpC <= *current_constln()[-1].target->constln())
2106 {
2107 return false;
2108 }
2109 return true;
2110}
2111
2112
2113// NOLINTEND(cppcoreguidelines-macro-usage)
2114
2115} // end namespace bisim_gjkw
2116} // end namespace detail
2117// end namespace lts
2118// end namespace mcrl2
2119
2120#endif // MCRL2_LTS_DETAIL_LIBLTS_BISIM_GJKW_H
#define mCRL2complexity(unit, call, info_for_debug)
Assigns work to a counter and checks for errors.
aterm & operator=(const aterm &other) noexcept=default
aterm(const aterm &other) noexcept=default
This class has user-declared copy constructor so declare default copy and move operators.
static constexpr std::size_t maximal_size_of_stack
std::array< unprotected_aterm_core, maximal_size_of_stack > m_stack
void initialise(const term_balanced_tree< Term > &tree)
const Term & dereference() const
Dereference operator.
bool equal(const iterator &other) const
Equality operator.
iterator(const term_balanced_tree< Term > &tree)
void increment()
Increments the iterator.
bool is_node() const
Returns true iff the tree is a node with a left and right subtree.
static void make_tree_helper(aterm &result, ForwardTraversalIterator &p, const std::size_t size, Transformer transformer)
term_balanced_tree & operator=(const term_balanced_tree &) noexcept=default
Assignment operator.
size_type size() const
Returns the size of the term_balanced_tree.
term_balanced_tree(term_balanced_tree &&) noexcept=default
Move constructor.
bool empty() const
Returns true if tree is empty.
static const aterm & empty_tree()
static void make_tree(aterm &result, ForwardTraversalIterator &p, const std::size_t size, Transformer transformer)
term_balanced_tree(ForwardTraversalIterator first, const std::size_t size)
Creates an term_balanced_tree with a copy of a range.
static const function_symbol & tree_single_node_function()
const aterm & left_branch() const
Get the left branch of the tree.
term_balanced_tree(const term_balanced_tree &) noexcept=default
Copy constructor.
term_balanced_tree(ForwardTraversalIterator first, const std::size_t size, Transformer transformer)
Creates an term_balanced_tree with a copy of a range, where a transformer is applied to each term bef...
static const function_symbol & tree_node_function()
const Term & operator[](std::size_t position) const
Element indexing operator.
iterator begin() const
Returns an iterator pointing to the beginning of the term_balanced_tree.
iterator end() const
Returns an iterator pointing to the end of the term_balanced_tree.
term_balanced_tree()
Default constructor. Creates an empty tree.
const aterm & right_branch() const
Get the left branch of the tree.
term_balanced_tree & operator=(term_balanced_tree &&) noexcept=default
Move assign operator.
term_balanced_tree(const aterm &tree)
Construction from aterm.
const Term & element_at(std::size_t position, std::size_t size) const
Get an element at the indicated position.
static const function_symbol & tree_empty_function()
friend void make_term_balanced_tree(term_balanced_tree< Term1 > &result, ForwardTraversalIterator p, std::size_t size, Transformer transformer)
term_balanced_tree(detail::_term_appl *t)
A list of aterm objects.
Definition aterm_list.h:26
A unordered_map class in which aterms can be stored.
action_formula(action_formula &&) noexcept=default
action_formula & operator=(const action_formula &) noexcept=default
action_formula(const atermpp::aterm &term)
action_formula(const data::data_expression &x)
\brief Constructor Z6.
action_formula(const action_formula &) noexcept=default
Move semantics.
action_formula & operator=(action_formula &&) noexcept=default
action_formula(const data::untyped_data_parameter &x)
\brief Constructor Z6.
action_formula()
\brief Default constructor X3.
action_formula(const process::untyped_multi_action &x)
\brief Constructor Z6.
\brief The and operator for action formulas
and_ & operator=(const and_ &) noexcept=default
and_ & operator=(and_ &&) noexcept=default
and_(const action_formula &left, const action_formula &right)
\brief Constructor Z14.
and_()
\brief Default constructor X3.
and_(and_ &&) noexcept=default
const action_formula & left() const
and_(const atermpp::aterm &term)
and_(const and_ &) noexcept=default
Move semantics.
const action_formula & right() const
\brief The at operator for action formulas
at(const atermpp::aterm &term)
const data::data_expression & time_stamp() const
at & operator=(at &&) noexcept=default
const action_formula & operand() const
at(const at &) noexcept=default
Move semantics.
at(at &&) noexcept=default
at()
\brief Default constructor X3.
at & operator=(const at &) noexcept=default
at(const action_formula &operand, const data::data_expression &time_stamp)
\brief Constructor Z14.
\brief The existential quantification operator for action formulas
exists(const atermpp::aterm &term)
exists & operator=(exists &&) noexcept=default
exists(exists &&) noexcept=default
exists(const exists &) noexcept=default
Move semantics.
exists()
\brief Default constructor X3.
const data::variable_list & variables() const
exists & operator=(const exists &) noexcept=default
const action_formula & body() const
exists(const data::variable_list &variables, const action_formula &body)
\brief Constructor Z14.
\brief The value false for action formulas
false_(const atermpp::aterm &term)
false_()
\brief Default constructor X3.
false_(false_ &&) noexcept=default
false_(const false_ &) noexcept=default
Move semantics.
false_ & operator=(const false_ &) noexcept=default
false_ & operator=(false_ &&) noexcept=default
\brief The universal quantification operator for action formulas
forall & operator=(const forall &) noexcept=default
const action_formula & body() const
forall & operator=(forall &&) noexcept=default
forall(const atermpp::aterm &term)
const data::variable_list & variables() const
forall()
\brief Default constructor X3.
forall(const data::variable_list &variables, const action_formula &body)
\brief Constructor Z14.
forall(const forall &) noexcept=default
Move semantics.
forall(forall &&) noexcept=default
\brief The implication operator for action formulas
const action_formula & left() const
imp(const imp &) noexcept=default
Move semantics.
imp(imp &&) noexcept=default
imp & operator=(imp &&) noexcept=default
imp(const action_formula &left, const action_formula &right)
\brief Constructor Z14.
imp()
\brief Default constructor X3.
imp & operator=(const imp &) noexcept=default
imp(const atermpp::aterm &term)
const action_formula & right() const
\brief The multi action for action formulas
multi_action(const multi_action &) noexcept=default
Move semantics.
multi_action(multi_action &&) noexcept=default
multi_action(const process::action_list &actions)
\brief Constructor Z14.
multi_action(const atermpp::aterm &term)
multi_action & operator=(const multi_action &) noexcept=default
multi_action()
\brief Default constructor X3.
const process::action_list & actions() const
multi_action & operator=(multi_action &&) noexcept=default
\brief The not operator for action formulas
not_(const action_formula &operand)
\brief Constructor Z14.
not_()
\brief Default constructor X3.
const action_formula & operand() const
not_(const atermpp::aterm &term)
not_(not_ &&) noexcept=default
not_(const not_ &) noexcept=default
Move semantics.
not_ & operator=(const not_ &) noexcept=default
not_ & operator=(not_ &&) noexcept=default
\brief The or operator for action formulas
or_ & operator=(const or_ &) noexcept=default
or_(or_ &&) noexcept=default
or_()
\brief Default constructor X3.
or_ & operator=(or_ &&) noexcept=default
or_(const action_formula &left, const action_formula &right)
\brief Constructor Z14.
or_(const atermpp::aterm &term)
or_(const or_ &) noexcept=default
Move semantics.
const action_formula & right() const
const action_formula & left() const
\brief The value true for action formulas
true_(true_ &&) noexcept=default
true_ & operator=(const true_ &) noexcept=default
true_()
\brief Default constructor X3.
true_(const true_ &) noexcept=default
Move semantics.
true_(const atermpp::aterm &term)
true_ & operator=(true_ &&) noexcept=default
data_expression & operator=(data_expression &&) noexcept=default
sort_expression sort() const
Returns the sort of the data expression.
Definition data.cpp:107
data_expression(const data_expression &) noexcept=default
Move semantics.
data_expression(data_expression &&) noexcept=default
Rewriter that operates on data expressions.
Definition rewriter.h:84
data_expression operator()(const data_expression &d) const
Rewrites a data expression.
Definition rewriter.h:161
void add_sort(const basic_sort &s)
Adds a sort to this specification.
\brief A data variable
Definition variable.h:25
Action rename specification.
\brief A timed multi-action
multi_action(const multi_action &) noexcept=default
Move semantics.
const process::action_list & actions() const
multi_action(const process::action_list &actions=process::action_list(), data::data_expression time=data::undefined_real())
Constructor. Actions are sorted to establish the sorted-storage invariant.
This class contains labels for probabilistic transistions, consisting of a numerator and a denumerato...
static probabilistic_data_expression one()
Constant one.
probabilistic_data_expression operator+(const probabilistic_data_expression &other) const
Standard addition operator. Note that the expression is not evaluated. For this the rewriter has to b...
probabilistic_data_expression(const data::data_expression &d)
Construct a probabilistic_data_expression from a data_expression, which must be of sort real.
bool operator==(const probabilistic_data_expression &other) const
probabilistic_data_expression(std::size_t enumerator, std::size_t denominator)
bool operator!=(const probabilistic_data_expression &other) const
bool operator>=(const probabilistic_data_expression &other) const
bool operator<(const probabilistic_data_expression &other) const
bool operator<=(const probabilistic_data_expression &other) const
bool operator>(const probabilistic_data_expression &other) const
probabilistic_data_expression(const std::string &enumerator, const std::string &denominator)
probabilistic_data_expression operator-(const probabilistic_data_expression &other) const
Standard subtraction operator.
static data::data_specification data_specification_with_real()
static probabilistic_data_expression zero()
Constant zero.
Linear process specification.
STATE & state()
Get the state in a state probability pair.
state_probability_pair(state_probability_pair &&p)=default
state_probability_pair & operator=(state_probability_pair &&p)=default
state_probability_pair(const state_probability_pair &p)=default
Copy constructor;.
state_probability_pair & operator=(const state_probability_pair &p)=default
Standard assignment.
const PROBABILITY & probability() const
get the probability from a state proability pair.
const STATE & state() const
Get the state from a state probability pair.
PROBABILITY & probability()
Set the probability in a state probability pair.
state_probability_pair(const STATE &state, const PROBABILITY &probability)
constructor.
bool operator==(const state_probability_pair &other) const
Standard equality operator.
A class containing the values for action labels for the .lts format.
Definition lts_lts.h:142
action_label_lts & operator=(const action_label_lts &)=default
Copy assignment.
void hide_actions(const std::vector< std::string > &tau_actions)
Hide the actions with labels in tau_actions.
Definition lts_lts.h:163
action_label_lts(const action_label_lts &)=default
Copy constructor.
static const action_label_lts & tau_action()
Definition lts_lts.h:179
action_label_lts(const mcrl2::lps::multi_action &a)
Constructor.
Definition lts_lts.h:155
action_label_lts()=default
Default constructor.
void set_truths(formula &f)
Compute and set the truth values of a formula f.
level_type gca_level(const block_index_type B1, const block_index_type B2)
Auxiliarry function that computes the level of the greatest common ancestor. In other words a lvl i s...
bisim_partitioner_minimal_depth(LTS_TYPE &l, const std::size_t init_l2)
Creates a bisimulation partitioner for an LTS.
mcrl2::state_formulas::state_formula dist_formula_mindepth(const std::size_t s, const std::size_t t)
Creates a state formula that distinguishes state s from state t.
formula distinguish(const block_index_type b1, const block_index_type b2)
Creates a formula that distinguishes a block b1 from the block b2.
~bisim_partitioner_minimal_depth()=default
Destroys this partitioner.
regular_formulas::regular_formula create_regular_formula(const mcrl2::lps::multi_action &a) const
create_regular_formula Creates a regular formula that represents action a
bool in_same_class(const std::size_t s, const std::size_t t)
block_index_type lift_block(const block_index_type B1, level_type goal)
mcrl2::state_formulas::state_formula conjunction(std::vector< formula > &conjunctions)
conjunction Creates a conjunction of state formulas
mcrl2::state_formulas::state_formula convert_formula(formula &f)
void split_BL(level_type lvl)
Performs the splits based on the blocks in Bsplit and the flags set in state_flags.
mcrl2::state_formulas::state_formula conjunction(std::set< mcrl2::state_formulas::state_formula > terms) const
conjunction Creates a conjunction of state formulas
regular_formulas::regular_formula create_regular_formula(const mcrl2::lts::action_label_string &a) const
create_regular_formula Creates a regular formula that represents action a
regular_formulas::regular_formula create_regular_formula(const mcrl2::lps::multi_action &a) const
create_regular_formula Creates a regular formula that represents action a
std::vector< bool > block_is_in_to_be_processed
std::map< block_index_type, block_index_type > right_child
std::vector< block_index_type > BL
bool in_same_class(const std::size_t s, const std::size_t t) const
Returns whether two states are in the same bisimulation equivalence class.
mcrl2::state_formulas::state_formula until_formula(const mcrl2::state_formulas::state_formula &phi1, const label_type &a, const mcrl2::state_formulas::state_formula &phi2)
until_formula Creates a state formula that corresponds to the until operator phi1phi2 from HMLU
std::size_t get_eq_class(const std::size_t s) const
Gives the bisimulation equivalence class number of a state.
bisim_partitioner(LTS_TYPE &l, const bool branching=false, const bool preserve_divergence=false, const bool generate_counter_examples=false)
Creates a bisimulation partitioner for an LTS.
~bisim_partitioner()=default
Destroys this partitioner.
std::map< block_index_type, label_type > split_by_action
std::size_t num_eq_classes() const
Gives the number of bisimulation equivalence classes of the LTS.
mcrl2::state_formulas::state_formula counter_formula(std::size_t s, std::size_t t)
Creates a state formula that distinguishes state s from state t.
void order_recursively_on_tau_reachability(const state_type s, std::map< state_type, std::vector< state_type > > &inert_transition_map, std::vector< non_bottom_state > &new_non_bottom_states, std::set< state_type > &visited)
std::vector< block_index_type > to_be_processed
std::map< block_index_type, block_index_type > split_by_block
void replace_transition_system(const bool branching, const bool preserve_divergences)
Replaces the transition relation of the current lts by the transitions of the bisimulation reduced tr...
void order_on_tau_reachability(std::vector< non_bottom_state > &non_bottom_states)
void split_the_blocks_in_BL(bool &partition_is_unstable, const label_type splitter_label, const block_index_type splitter_block)
void refine_partition_until_it_becomes_stable(const bool branching, const bool preserve_divergence)
void create_initial_partition(const bool branching, const bool preserve_divergences)
std::vector< state_type > block_index_of_a_state
mcrl2::state_formulas::state_formula counter_formula_aux(const block_index_type B1, const block_index_type B2)
void check_internal_consistency_of_the_partitioning_data_structure(const bool branching, const bool preserve_divergence) const
outgoing_transitions_per_state_action_t outgoing_transitions
function object to compare two constln_t pointers based on their contents
A class that can be used to store counterexample trees and.
lts_type type()
Provides the type of this lts, in casu lts_aut.
Definition lts_aut.h:39
bool operator==(const lts_aut_base &) const
Standard equality function.
Definition lts_aut.h:52
void swap(lts_aut_base &) noexcept
Standard swap function.
Definition lts_aut.h:45
void swap(lts_dot_base &) noexcept
The standard swap function.
Definition lts_dot.h:120
lts_type type() const
The lts_type of state_label_dot. In this case lts_dot.
Definition lts_dot.h:113
void clear()
Clear the transitions system.
Definition lts_fsm.h:134
const std::vector< std::string > & state_element_values(std::size_t idx) const
Provides the vector of strings that correspond to the values of the number at position idx in a vecto...
Definition lts_fsm.h:146
std::size_t add_state_element_value(std::size_t idx, const std::string &s)
Adds a string to the state element values for the idx-th position in a state vector....
Definition lts_fsm.h:178
void swap(lts_fsm_base &other) noexcept
Standard swap function.
Definition lts_fsm.h:123
bool operator==(const lts_fsm_base &other) const
Definition lts_fsm.h:108
lts_type type() const
The lts_type of this labelled transition system. In this case lts_fsm.
Definition lts_fsm.h:117
std::string state_element_value(std::size_t parameter_index, std::size_t element_index) const
Returns the element_index'th element for the parameter with index parameter_index.
Definition lts_fsm.h:193
std::string state_label_to_string(const state_label_fsm &l) const
Pretty print a state value of this FSM.
Definition lts_fsm.h:156
a base class for lts_lts_t and probabilistic_lts_t.
Definition lts_lts.h:268
static lts_type type()
Yields the type of this lts, in this case lts_lts.
Definition lts_lts.h:296
void set_process_parameters(const data::variable_list &params)
Set the state parameters for this LTS.
Definition lts_lts.h:354
lts_lts_base()=default
Default constructor.
bool operator==(const lts_lts_base &other) const
Standard equality function;.
Definition lts_lts.h:279
process::action_label_list m_action_decls
Definition lts_lts.h:272
void set_action_label_declarations(const process::action_label_list &decls)
Set the action label information for this LTS.
Definition lts_lts.h:318
const data::variable & process_parameter(std::size_t i) const
Returns the i-th parameter of the state vectors stored in this LTS.
Definition lts_lts.h:341
data::data_specification m_data_spec
Definition lts_lts.h:270
const data::variable_list & process_parameters() const
Return the process parameters stored in this LTS.
Definition lts_lts.h:333
void set_data(const data::data_specification &spec)
Set the mCRL2 data specification of this LTS.
Definition lts_lts.h:326
void swap(lts_lts_base &l) noexcept
Definition lts_lts.h:286
const process::action_label_list & action_label_declarations() const
Return action label declarations stored in this LTS.
Definition lts_lts.h:310
data::variable_list m_parameters
Definition lts_lts.h:271
A simple labelled transition format with only strings as action labels.
Definition lts_aut.h:67
void load(const std::string &filename)
Load the labelled transition system from a file.
void load(std::istream &is)
Load the labelled transition system from an input stream.
void save(const std::string &filename) const
Save the labelled transition system to file.
A class to contain labelled transition systems in graphviz format.
Definition lts_dot.h:132
void save(const std::string &filename) const
Save the labelled transition system to a file.
void save(std::ostream &os) const
Save the labelled transition system to a stream.
The class lts_fsm_t contains labelled transition systems in .fsm format.
Definition lts_fsm.h:254
void load(const std::string &filename)
Save the labelled transition system to file.
void save(const std::string &filename) const
Save the labelled transition system to file.
This class contains labelled transition systems in .lts format.
Definition lts_lts.h:370
lts_lts_t()=default
Creates an object containing no information.
void save(const std::string &filename) const
Save the labelled transition system to file.
void load(const std::string &filename)
Load the labelled transition system from file.
A simple labelled transition format with only strings as action labels.
Definition lts_aut.h:100
void load(const std::string &filename)
Load the labelled transition system from a file.
void load(std::istream &is)
Load the labelled transition system from an input stream.
void save(const std::string &filename) const
Save the labelled transition system to file.
A class to contain labelled transition systems in graphviz format.
Definition lts_dot.h:158
void save(std::ostream &os) const
Save the labelled transition system to a stream.
void save(const std::string &filename) const
Save the labelled transition system to a file.
The class lts_fsm_t contains labelled transition systems in .fsm format.
Definition lts_fsm.h:282
This class contains probabilistic labelled transition systems in .lts format.
Definition lts_lts.h:398
probabilistic_lts_lts_t()=default
Creates an object containing no information.
void load(const std::string &filename)
Load the labelled transition system from file.
void save(const std::string &filename) const
Save the labelled transition system to file.
A class that contains a labelled transition system.
probabilistic_lts(probabilistic_lts &&other)=default
Standard move constructor.
void set_initial_probabilistic_state(const PROBABILISTIC_STATE_T &state)
Sets the probabilistic initial state number of this LTS.
probabilistic_lts()=default
Creates an empty LTS.
const PROBABILISTIC_STATE_T & initial_probabilistic_state() const
Gets the initial state number of this LTS.
bool operator==(const probabilistic_lts &other) const
Standard equality operator.
labels_size_type num_probabilistic_states() const
Gets the number of probabilistic states of this LTS.
static constexpr bool is_probabilistic_lts
An indicator that this is a probabilistic lts.
void clear_probabilistic_states()
Clear the probabilistic states in this probabilistic transitions system.
states_size_type add_and_reset_probabilistic_state(PROBABILISTIC_STATE_T &s)
Adds a probabilistic state to this LTS and resets the state to empty.
void clear()
Clear the transitions system.
probabilistic_lts & operator=(probabilistic_lts &&other)=default
Standard assignment move operator.
void swap(probabilistic_lts &other) noexcept
Swap this lts with the supplied supplied LTS.
probabilistic_lts & operator=(const probabilistic_lts &other)=default
Standard assignment operator.
std::vector< PROBABILISTIC_STATE_T > m_probabilistic_states
probabilistic_lts(const probabilistic_lts &other)=default
Standard copy constructor.
states_size_type add_probabilistic_state(const PROBABILISTIC_STATE_T &s)
Adds a probabilistic state to this LTS.
states_size_type initial_state() const
PROBABILISTIC_STATE_T m_init_probabilistic_state
A class that contains a probabilistic state.
void set(const STATE &s)
Set this probabilistic state to a single state with probability one.
const_iterator begin() const
Gets an iterator over pairs of state and probability. This can only be used when the state is stored ...
void construct_internal_vector_representation()
Guarantee that this probabilistic state is internally stored as a vector, such that begin/end,...
probabilistic_state & operator=(const probabilistic_state &other)
Copy assignment constructor.
const_reverse_iterator rbegin() const
Gets a reverse iterator over pairs of state and probability. This can only be used when the state is ...
std::size_t size() const
Gets the number of probabilistic states in the vector representation of this state....
bool operator!=(const probabilistic_state &other) const
Standard equality operator.
iterator begin()
Gets an iterator over pairs of state and probability. This can only be used if the state is internall...
probabilistic_state & operator=(probabilistic_state &&other)=default
Move assignment operator.
STATE get() const
Get a probabilistic state if is is simple, i.e., consists of a single state.
void swap(probabilistic_state &other) noexcept
Swap this probabilistic state.
iterator end()
Gets the end iterator over pairs of state and probability.
reverse_iterator rbegin()
Gets a reverse iterator over pairs of state and probability. This can only be used if the state is in...
std::vector< state_probability_pair > m_probabilistic_state
const_iterator end() const
Gets the end iterator over pairs of state and probability.
reverse_iterator rend()
Gets the reverse end iterator over pairs of state and probability.
bool operator==(const probabilistic_state &other) const
Standard equality operator.
void clear()
Makes the probabilistic state empty.
probabilistic_state(probabilistic_state &&other)=default
Move constructor.
probabilistic_state(const STATE_PROBABILITY_PAIR_ITERATOR begin, const STATE_PROBABILITY_PAIR_ITERATOR end)
Creates a probabilistic state on the basis of state_probability_pairs.
STATE maximal_state() const
Provides the maximal state index in a probabilistic state.
probabilistic_state(const probabilistic_state &other)
Copy constructor.
void shrink_to_fit()
If a probabilistic state is ready, shrinking it to minimal size might be useful to reduce its memory ...
probabilistic_state()
Default constructor.
probabilistic_state(const STATE &s)
Constructor of a probabilistic state from a non probabilistic state.
void add(const STATE &s, const PROBABILITY &p)
Add a state with a probability to the probabilistic state.
const_reverse_iterator rend() const
Gets the reverse end iterator over pairs of state and probability.
Class for computing the signature for strong bisimulation.
Definition sigref.h:74
Class for computing the signature for branching bisimulation.
Definition sigref.h:104
Class for computing the signature for divergence preserving branching bisimulation.
Definition sigref.h:183
Signature based reductions for labelled transition systems.
Definition sigref.h:349
This class contains labels for states in dot format.
Definition lts_dot.h:34
void set_name(const std::string &s)
This method sets the name of the state label to the string s.
Definition lts_dot.h:53
std::string name() const
This method returns the string in the name field of a state label.
Definition lts_dot.h:60
std::string label() const
This method returns the label in the name field of a state label.
Definition lts_dot.h:74
void set_label(const std::string &s)
This method sets the label field of the state label to the string s.
Definition lts_dot.h:67
state_label_dot(const std::string &state_name, const std::string &state_label)
A constructor setting the name and label of this state label to the indicated values.
Definition lts_dot.h:47
std::string m_state_label
Definition lts_dot.h:37
bool operator==(const state_label_dot &l) const
Standard comparison operator, comparing both the string in the name field, as well as the one in the ...
Definition lts_dot.h:82
bool operator!=(const state_label_dot &l) const
Standard inequality operator. Just the negation of equality.
Definition lts_dot.h:89
state_label_dot()=default
The default constructor.
This class contains state labels for the fsm format.
Definition lts_fsm.h:36
state_label_fsm()=default
Default constructor. The label becomes an empty vector.
state_label_fsm(const state_label_fsm &)=default
Copy constructor.
state_label_fsm & operator=(const state_label_fsm &)=default
Copy assignment.
static state_label_fsm number_to_label(const std::size_t n)
Create a state label consisting of a number as the only list element.
Definition lts_fsm.h:67
state_label_fsm(const std::vector< std::size_t > &v)
Default constructor. The label is set to the vector v.
Definition lts_fsm.h:50
state_label_fsm operator+(const state_label_fsm &l) const
An operator to concatenate two state labels. Fsm labels cannot be concatenated. Therefore,...
Definition lts_fsm.h:56
This class contains state labels for an labelled transition system in .lts format.
Definition lts_lts.h:38
state_label_lts(const state_label_lts &)=default
Copy constructor.
state_label_lts operator+(const state_label_lts &l) const
An operator to concatenate two state labels.
Definition lts_lts.h:79
state_label_lts(const super &l)
Construct a state label out of list of balanced trees of data expressions, representing a state label...
Definition lts_lts.h:71
state_label_lts()=default
Default constructor.
state_label_lts(const lps::state &l)
Construct a state label out of a balanced tree of data expressions, representing a state label.
Definition lts_lts.h:64
state_label_lts & operator=(const state_label_lts &)=default
Copy assignment.
static state_label_lts number_to_label(const std::size_t n)
Create a state label consisting of a number as the only list element.
Definition lts_lts.h:94
state_label_lts(const CONTAINER &l)
Construct a single state label out of the elements in a container.
Definition lts_lts.h:55
Process specification consisting of a data specification, action labels, a sequence of process equati...
\brief An untyped multi action or data application
\brief The alt operator for regular formulas
alt(const atermpp::aterm &term)
alt()
\brief Default constructor X3.
alt & operator=(alt &&) noexcept=default
const regular_formula & right() const
alt(const regular_formula &left, const regular_formula &right)
\brief Constructor Z14.
alt(const alt &) noexcept=default
Move semantics.
alt(alt &&) noexcept=default
alt & operator=(const alt &) noexcept=default
const regular_formula & left() const
regular_formula()
\brief Default constructor X3.
regular_formula(const action_formulas::action_formula &x)
\brief Constructor Z6.
regular_formula(const atermpp::aterm &term)
regular_formula(const regular_formula &) noexcept=default
Move semantics.
regular_formula(const data::data_expression &x)
\brief Constructor Z6.
regular_formula & operator=(const regular_formula &) noexcept=default
regular_formula(regular_formula &&) noexcept=default
regular_formula & operator=(regular_formula &&) noexcept=default
\brief The seq operator for regular formulas
seq(const regular_formula &left, const regular_formula &right)
\brief Constructor Z14.
const regular_formula & right() const
seq & operator=(const seq &) noexcept=default
seq(const seq &) noexcept=default
Move semantics.
const regular_formula & left() const
seq(seq &&) noexcept=default
seq()
\brief Default constructor X3.
seq & operator=(seq &&) noexcept=default
seq(const atermpp::aterm &term)
\brief The 'trans or nil' operator for regular formulas
trans_or_nil & operator=(trans_or_nil &&) noexcept=default
trans_or_nil & operator=(const trans_or_nil &) noexcept=default
trans_or_nil(const trans_or_nil &) noexcept=default
Move semantics.
trans_or_nil(const regular_formula &operand)
\brief Constructor Z14.
trans_or_nil()
\brief Default constructor X3.
trans_or_nil(trans_or_nil &&) noexcept=default
trans_or_nil(const atermpp::aterm &term)
const regular_formula & operand() const
\brief The trans operator for regular formulas
trans(const atermpp::aterm &term)
trans(trans &&) noexcept=default
const regular_formula & operand() const
trans & operator=(const trans &) noexcept=default
trans & operator=(trans &&) noexcept=default
trans()
\brief Default constructor X3.
trans(const trans &) noexcept=default
Move semantics.
trans(const regular_formula &operand)
\brief Constructor Z14.
\brief An untyped regular formula or action formula
untyped_regular_formula()
\brief Default constructor X3.
untyped_regular_formula & operator=(untyped_regular_formula &&) noexcept=default
untyped_regular_formula & operator=(const untyped_regular_formula &) noexcept=default
untyped_regular_formula(const std::string &name, const regular_formula &left, const regular_formula &right)
\brief Constructor Z2.
untyped_regular_formula(const core::identifier_string &name, const regular_formula &left, const regular_formula &right)
\brief Constructor Z14.
const core::identifier_string & name() const
untyped_regular_formula(const untyped_regular_formula &) noexcept=default
Move semantics.
untyped_regular_formula(untyped_regular_formula &&) noexcept=default
\brief The and operator for state formulas
and_(and_ &&) noexcept=default
const state_formula & right() const
and_(const atermpp::aterm &term)
and_(const and_ &) noexcept=default
Move semantics.
and_(const state_formula &left, const state_formula &right)
\brief Constructor Z14.
and_ & operator=(const and_ &) noexcept=default
and_()
\brief Default constructor X3.
and_ & operator=(and_ &&) noexcept=default
const state_formula & left() const
\brief The multiply operator for state formulas with values
const_multiply_alt & operator=(const const_multiply_alt &) noexcept=default
const state_formula & left() const
const_multiply_alt(const state_formula &left, const data::data_expression &right)
\brief Constructor Z14.
const_multiply_alt(const const_multiply_alt &) noexcept=default
Move semantics.
const_multiply_alt(const_multiply_alt &&) noexcept=default
const data::data_expression & right() const
const_multiply_alt(const atermpp::aterm &term)
const_multiply_alt & operator=(const_multiply_alt &&) noexcept=default
const_multiply_alt()
\brief Default constructor X3.
\brief The multiply operator for state formulas with values
const data::data_expression & left() const
const_multiply(const const_multiply &) noexcept=default
Move semantics.
const_multiply(const data::data_expression &left, const state_formula &right)
\brief Constructor Z14.
const_multiply()
\brief Default constructor X3.
const_multiply(const_multiply &&) noexcept=default
const_multiply & operator=(const const_multiply &) noexcept=default
const_multiply & operator=(const_multiply &&) noexcept=default
const_multiply(const atermpp::aterm &term)
const state_formula & right() const
\brief The timed delay operator for state formulas
delay_timed(const atermpp::aterm &term)
delay_timed()
\brief Default constructor X3.
delay_timed & operator=(const delay_timed &) noexcept=default
const data::data_expression & time_stamp() const
delay_timed(const data::data_expression &time_stamp)
\brief Constructor Z14.
delay_timed(const delay_timed &) noexcept=default
Move semantics.
delay_timed(delay_timed &&) noexcept=default
delay_timed & operator=(delay_timed &&) noexcept=default
\brief The delay operator for state formulas
delay & operator=(delay &&) noexcept=default
delay()
\brief Default constructor X3.
delay(const delay &) noexcept=default
Move semantics.
delay(delay &&) noexcept=default
delay(const atermpp::aterm &term)
delay & operator=(const delay &) noexcept=default
\brief The existential quantification operator for state formulas
exists(const data::variable_list &variables, const state_formula &body)
\brief Constructor Z14.
const state_formula & body() const
exists(const exists &) noexcept=default
Move semantics.
exists(exists &&) noexcept=default
exists & operator=(const exists &) noexcept=default
exists & operator=(exists &&) noexcept=default
exists()
\brief Default constructor X3.
exists(const atermpp::aterm &term)
const data::variable_list & variables() const
\brief The value false for state formulas
false_(false_ &&) noexcept=default
false_ & operator=(const false_ &) noexcept=default
false_ & operator=(false_ &&) noexcept=default
false_(const atermpp::aterm &term)
false_(const false_ &) noexcept=default
Move semantics.
false_()
\brief Default constructor X3.
\brief The universal quantification operator for state formulas
const state_formula & body() const
forall(const atermpp::aterm &term)
const data::variable_list & variables() const
forall & operator=(const forall &) noexcept=default
forall & operator=(forall &&) noexcept=default
forall(const forall &) noexcept=default
Move semantics.
forall(const data::variable_list &variables, const state_formula &body)
\brief Constructor Z14.
forall(forall &&) noexcept=default
forall()
\brief Default constructor X3.
\brief The implication operator for state formulas
imp()
\brief Default constructor X3.
imp(imp &&) noexcept=default
imp(const state_formula &left, const state_formula &right)
\brief Constructor Z14.
imp & operator=(const imp &) noexcept=default
const state_formula & left() const
const state_formula & right() const
imp(const atermpp::aterm &term)
imp(const imp &) noexcept=default
Move semantics.
imp & operator=(imp &&) noexcept=default
\brief The infimum over a data type for state formulas
infimum(const infimum &) noexcept=default
Move semantics.
infimum()
\brief Default constructor X3.
infimum(const data::variable_list &variables, const state_formula &body)
\brief Constructor Z14.
infimum & operator=(infimum &&) noexcept=default
const data::variable_list & variables() const
const state_formula & body() const
infimum(const atermpp::aterm &term)
infimum(infimum &&) noexcept=default
infimum & operator=(const infimum &) noexcept=default
\brief The may operator for state formulas
const state_formula & operand() const
may()
\brief Default constructor X3.
const regular_formulas::regular_formula & formula() const
may & operator=(const may &) noexcept=default
may & operator=(may &&) noexcept=default
may(const regular_formulas::regular_formula &formula, const state_formula &operand)
\brief Constructor Z14.
may(may &&) noexcept=default
may(const atermpp::aterm &term)
may(const may &) noexcept=default
Move semantics.
\brief The minus operator for state formulas
minus & operator=(minus &&) noexcept=default
minus(minus &&) noexcept=default
minus(const minus &) noexcept=default
Move semantics.
minus(const atermpp::aterm &term)
minus(const state_formula &operand)
\brief Constructor Z14.
const state_formula & operand() const
minus & operator=(const minus &) noexcept=default
minus()
\brief Default constructor X3.
\brief The mu operator for state formulas
const core::identifier_string & name() const
const data::assignment_list & assignments() const
mu(const mu &) noexcept=default
Move semantics.
mu(const std::string &name, const data::assignment_list &assignments, const state_formula &operand)
\brief Constructor Z2.
mu(const core::identifier_string &name, const data::assignment_list &assignments, const state_formula &operand)
\brief Constructor Z14.
mu & operator=(const mu &) noexcept=default
mu(mu &&) noexcept=default
mu & operator=(mu &&) noexcept=default
mu(const atermpp::aterm &term)
mu()
\brief Default constructor X3.
const state_formula & operand() const
\brief The must operator for state formulas
must(must &&) noexcept=default
must & operator=(must &&) noexcept=default
must(const atermpp::aterm &term)
must(const regular_formulas::regular_formula &formula, const state_formula &operand)
\brief Constructor Z14.
const regular_formulas::regular_formula & formula() const
must(const must &) noexcept=default
Move semantics.
const state_formula & operand() const
must()
\brief Default constructor X3.
must & operator=(const must &) noexcept=default
\brief The not operator for state formulas
not_(not_ &&) noexcept=default
not_(const not_ &) noexcept=default
Move semantics.
not_ & operator=(const not_ &) noexcept=default
not_ & operator=(not_ &&) noexcept=default
not_()
\brief Default constructor X3.
not_(const atermpp::aterm &term)
const state_formula & operand() const
not_(const state_formula &operand)
\brief Constructor Z14.
\brief The nu operator for state formulas
nu(const atermpp::aterm &term)
nu(nu &&) noexcept=default
nu(const core::identifier_string &name, const data::assignment_list &assignments, const state_formula &operand)
\brief Constructor Z14.
nu()
\brief Default constructor X3.
nu & operator=(const nu &) noexcept=default
nu & operator=(nu &&) noexcept=default
const core::identifier_string & name() const
nu(const std::string &name, const data::assignment_list &assignments, const state_formula &operand)
\brief Constructor Z2.
const state_formula & operand() const
nu(const nu &) noexcept=default
Move semantics.
const data::assignment_list & assignments() const
\brief The or operator for state formulas
or_(or_ &&) noexcept=default
or_()
\brief Default constructor X3.
or_(const or_ &) noexcept=default
Move semantics.
or_(const state_formula &left, const state_formula &right)
\brief Constructor Z14.
or_ & operator=(const or_ &) noexcept=default
const state_formula & right() const
or_ & operator=(or_ &&) noexcept=default
or_(const atermpp::aterm &term)
const state_formula & left() const
\brief The plus operator for state formulas with values
plus & operator=(plus &&) noexcept=default
plus & operator=(const plus &) noexcept=default
plus(const plus &) noexcept=default
Move semantics.
const state_formula & left() const
plus(const atermpp::aterm &term)
plus()
\brief Default constructor X3.
const state_formula & right() const
plus(plus &&) noexcept=default
plus(const state_formula &left, const state_formula &right)
\brief Constructor Z14.
state_formula(const state_formula &) noexcept=default
Move semantics.
state_formula()
\brief Default constructor X3.
state_formula(state_formula &&) noexcept=default
bool has_time() const
Returns true if the formula is timed.
state_formula(const data::untyped_data_parameter &x)
\brief Constructor Z6.
state_formula & operator=(state_formula &&) noexcept=default
state_formula(const data::data_expression &x)
\brief Constructor Z6.
state_formula(const atermpp::aterm &term)
state_formula & operator=(const state_formula &) noexcept=default
\brief The sum over a data type for state formulas
sum(const sum &) noexcept=default
Move semantics.
sum(sum &&) noexcept=default
sum(const atermpp::aterm &term)
sum(const data::variable_list &variables, const state_formula &body)
\brief Constructor Z14.
sum & operator=(sum &&) noexcept=default
sum()
\brief Default constructor X3.
const data::variable_list & variables() const
const state_formula & body() const
sum & operator=(const sum &) noexcept=default
\brief The supremum over a data type for state formulas
supremum & operator=(supremum &&) noexcept=default
supremum(supremum &&) noexcept=default
supremum(const atermpp::aterm &term)
supremum()
\brief Default constructor X3.
supremum(const supremum &) noexcept=default
Move semantics.
supremum & operator=(const supremum &) noexcept=default
const state_formula & body() const
const data::variable_list & variables() const
supremum(const data::variable_list &variables, const state_formula &body)
\brief Constructor Z14.
\brief The value true for state formulas
true_()
\brief Default constructor X3.
true_ & operator=(const true_ &) noexcept=default
true_(true_ &&) noexcept=default
true_(const true_ &) noexcept=default
Move semantics.
true_(const atermpp::aterm &term)
true_ & operator=(true_ &&) noexcept=default
\brief The state formula variable
variable & operator=(const variable &) noexcept=default
variable(const core::identifier_string &name, const data::data_expression_list &arguments)
\brief Constructor Z14.
variable(const variable &) noexcept=default
Move semantics.
variable(const std::string &name, const data::data_expression_list &arguments)
\brief Constructor Z2.
variable()
\brief Default constructor X3.
variable & operator=(variable &&) noexcept=default
const core::identifier_string & name() const
const data::data_expression_list & arguments() const
variable(variable &&) noexcept=default
variable(const atermpp::aterm &term)
\brief The timed yaled operator for state formulas
yaled_timed(yaled_timed &&) noexcept=default
yaled_timed & operator=(const yaled_timed &) noexcept=default
yaled_timed()
\brief Default constructor X3.
yaled_timed & operator=(yaled_timed &&) noexcept=default
yaled_timed(const yaled_timed &) noexcept=default
Move semantics.
yaled_timed(const data::data_expression &time_stamp)
\brief Constructor Z14.
yaled_timed(const atermpp::aterm &term)
const data::data_expression & time_stamp() const
\brief The yaled operator for state formulas
yaled()
\brief Default constructor X3.
yaled(const atermpp::aterm &term)
yaled & operator=(const yaled &) noexcept=default
yaled(const yaled &) noexcept=default
Move semantics.
yaled(yaled &&) noexcept=default
yaled & operator=(yaled &&) noexcept=default
#define BLOCK_NO_SEQNR
#define ONLY_IF_DEBUG(...)
include something in Debug mode
#define mCRL2log(LEVEL)
mCRL2log(LEVEL) provides the stream used to log.
Definition logger.h:393
global_function_symbol g_tree_node("@node@", 2)
global_function_symbol g_empty("@empty@", 0)
global_function_symbol g_single_tree_node("@single_node@", 1)
std::string pp(const term_balanced_tree< Term > t)
bool is_aterm_balanced_tree(const aterm &t)
void make_term_balanced_tree(term_balanced_tree< Term > &result, ForwardTraversalIterator p, std::size_t size, Transformer transformer)
void make_exists(atermpp::aterm &t, const ARGUMENTS &... args)
void swap(or_ &t1, or_ &t2) noexcept
\brief swap overload
std::string pp(const action_formulas::exists &x, bool arg0)
bool is_at(const atermpp::aterm &x)
void swap(forall &t1, forall &t2) noexcept
\brief swap overload
std::string pp(const action_formulas::imp &x, bool arg0)
std::ostream & operator<<(std::ostream &out, const or_ &x)
std::string pp(const action_formulas::at &x, bool arg0)
std::ostream & operator<<(std::ostream &out, const action_formula &x)
std::string pp(const action_formulas::forall &x, bool arg0)
void make_not_(atermpp::aterm &t, const ARGUMENTS &... args)
std::string pp(const action_formulas::or_ &x, bool arg0)
std::string pp(const action_formulas::action_formula &x, bool arg0)
std::ostream & operator<<(std::ostream &out, const true_ &x)
std::ostream & operator<<(std::ostream &out, const exists &x)
std::ostream & operator<<(std::ostream &out, const at &x)
std::string pp(const action_formulas::true_ &x, bool arg0)
std::set< data::variable > find_all_variables(const action_formulas::action_formula &x)
bool is_or(const atermpp::aterm &x)
void swap(action_formula &t1, action_formula &t2) noexcept
\brief swap overload
bool is_true(const atermpp::aterm &x)
bool is_forall(const atermpp::aterm &x)
void swap(not_ &t1, not_ &t2) noexcept
\brief swap overload
std::string pp(const action_formulas::not_ &x, bool arg0)
std::ostream & operator<<(std::ostream &out, const and_ &x)
void swap(true_ &t1, true_ &t2) noexcept
\brief swap overload
void make_and_(atermpp::aterm &t, const ARGUMENTS &... args)
std::ostream & operator<<(std::ostream &out, const false_ &x)
bool is_false(const atermpp::aterm &x)
bool is_not(const atermpp::aterm &x)
void swap(false_ &t1, false_ &t2) noexcept
\brief swap overload
void swap(and_ &t1, and_ &t2) noexcept
\brief swap overload
void make_imp(atermpp::aterm &t, const ARGUMENTS &... args)
bool is_imp(const atermpp::aterm &x)
bool is_and(const atermpp::aterm &x)
void make_forall(atermpp::aterm &t, const ARGUMENTS &... args)
void swap(multi_action &t1, multi_action &t2) noexcept
\brief swap overload
void swap(imp &t1, imp &t2) noexcept
\brief swap overload
void make_or_(atermpp::aterm &t, const ARGUMENTS &... args)
std::ostream & operator<<(std::ostream &out, const forall &x)
void swap(exists &t1, exists &t2) noexcept
\brief swap overload
std::ostream & operator<<(std::ostream &out, const imp &x)
std::ostream & operator<<(std::ostream &out, const multi_action &x)
void make_multi_action(atermpp::aterm &t, const ARGUMENTS &... args)
bool is_multi_action(const atermpp::aterm &x)
std::ostream & operator<<(std::ostream &out, const not_ &x)
std::string pp(const action_formulas::multi_action &x, bool arg0)
void swap(at &t1, at &t2) noexcept
\brief swap overload
void make_at(atermpp::aterm &t, const ARGUMENTS &... args)
std::string pp(const action_formulas::false_ &x, bool arg0)
bool is_exists(const atermpp::aterm &x)
std::string pp(const action_formulas::and_ &x, bool arg0)
bool is_action_formula(const atermpp::aterm &x)
static data_specification const & default_specification()
Definition parse.h:28
Namespace for system defined sort bool_.
Definition bool.h:29
const function_symbol & false_()
Constructor for function symbol false.
Definition bool.h:106
const function_symbol & true_()
Constructor for function symbol true.
Definition bool.h:74
Namespace for system defined sort int_.
application cint(const data_expression &arg0)
Application of function symbol @cInt.
Definition int1.h:101
const basic_sort & int_()
Constructor for sort expression Int.
Definition int1.h:44
Namespace for system defined sort nat.
const basic_sort & nat()
Constructor for sort expression Nat.
Definition nat1.h:43
application cnat(const data_expression &arg0)
Application of function symbol @cNat.
Definition nat1.h:161
Namespace for system defined sort pos.
const basic_sort & pos()
Constructor for sort expression Pos.
Definition pos1.h:42
Namespace for system defined sort real_.
data_expression & real_one()
application creal(const data_expression &arg0, const data_expression &arg1)
Application of function symbol @cReal.
Definition real1.h:129
data_expression & real_zero()
const basic_sort & real_()
Constructor for sort expression Real.
Definition real1.h:45
application plus(const data_expression &arg0, const data_expression &arg1)
Application of function symbol +.
Definition real1.h:1112
application minus(const data_expression &arg0, const data_expression &arg1)
Application of function symbol -.
Definition real1.h:1197
bool is_data_expression(const atermpp::aterm &x)
Test for a data_expression expression.
application less(const data_expression &arg0, const data_expression &arg1)
Application of function symbol <.
Definition standard.h:254
bool is_untyped_data_parameter(const atermpp::aterm &x)
application equal_to(const data_expression &arg0, const data_expression &arg1)
Application of function symbol ==.
Definition standard.h:140
std::pair< std::set< data::variable >, std::set< data::variable > > read_write_parameters(const lps::action_summand &summand, const std::set< data::variable > &process_parameters)
Computes the read and written process parameters for the given summand.
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
multi_action complete_multi_action(process::untyped_multi_action &x, const process::action_label_list &action_decls, const data::data_specification &data_spec=data::detail::default_specification())
Definition lps.cpp:148
void remove_common_divisor(std::size_t &enumerator, std::size_t &denominator)
void complete_action_rename_specification(action_rename_specification &x, const lps::stochastic_specification &spec)
Definition lps.cpp:166
process::untyped_multi_action parse_multi_action_new(const std::string &text)
Definition lps.cpp:130
multi_action complete_multi_action(process::untyped_multi_action &x, multi_action_type_checker &typechecker, const data::data_specification &data_spec=data::detail::default_specification())
Definition lps.cpp:140
std::size_t greatest_common_divisor(std::size_t x, std::size_t y)
action_rename_specification parse_action_rename_specification_new(const std::string &text)
Definition lps.cpp:156
The main namespace for the LPS library.
Definition constelm.h:18
specification parse_linear_process_specification(const std::string &text)
Parses a linear process specification from a string.
Definition parse.h:149
void complete_data_specification(stochastic_specification &spec)
Adds all sorts that appear in the process of l to the data specification of l.
multi_action parse_multi_action(const std::string &text, const process::action_label_list &action_decls, const data::data_specification &data_spec=data::detail::default_specification())
Parses a multi_action from a string.
Definition parse.h:67
void parse_lps(std::istream &, Specification &)
Definition parse.h:156
process::action parse_action(const std::string &text, const process::action_label_list &action_decls, const data::data_specification &data_spec=data::detail::default_specification())
Parses an action from a string.
Definition parse.h:208
void complete_data_specification(specification &spec)
Adds all sorts that appear in the process of l to the data specification of l.
std::string pp(const probabilistic_data_expression &l)
multi_action parse_multi_action(std::stringstream &in, multi_action_type_checker &typechecker, const data::data_specification &data_spec=data::detail::default_specification())
Parses a multi_action from an input stream.
Definition parse.h:53
action_rename_specification parse_action_rename_specification(std::istream &in, const lps::stochastic_specification &spec)
Parses a process specification from an input stream.
Definition parse.h:91
std::ostream & operator<<(std::ostream &out, const probabilistic_data_expression &x)
Pretty print to an outstream.
multi_action parse_multi_action(std::stringstream &in, const process::action_label_list &action_decls, const data::data_specification &data_spec=data::detail::default_specification())
Parses a multi_action from an input stream.
Definition parse.h:39
action_rename_specification parse_action_rename_specification(const std::string &spec_string, const lps::stochastic_specification &spec)
Parses an action rename specification. Parses an action rename specification. If the action rename sp...
Definition parse.h:107
void parse_lps< specification >(std::istream &from, specification &result)
Definition parse.h:163
void make_state(state &result, ForwardTraversalIterator p, const std::size_t size)
Definition state.h:33
void parse_lps< stochastic_specification >(std::istream &from, stochastic_specification &result)
Parses a stochastic linear process specification from an input stream.
Definition parse.h:180
std::string pp(const lps::state &x)
Definition state.h:44
multi_action parse_multi_action(const std::string &text, multi_action_type_checker &typechecker, const data::data_specification &data_spec=data::detail::default_specification())
Parses a multi_action from a string.
Definition parse.h:80
void parse_lps(const std::string &text, Specification &result)
Definition parse.h:194
specification parse_linear_process_specification(std::istream &spec_stream)
Parses a linear process specification from an input stream.
Definition parse.h:125
void make_state(state &result, ForwardTraversalIterator p, const std::size_t size, Transformer transformer)
Definition state.h:24
bool bisimulation_compare(const LTS_TYPE &l1, const LTS_TYPE &l2, bool branching=false, bool preserve_divergences=false, bool generate_counter_examples=false, const std::string &counter_example_file="", bool structured_output=false)
Checks whether the two initial states of two lts's are strong or branching bisimilar.
lts_type guess_format(std::string const &s, const bool be_verbose)
Determines the LTS format from a filename by its extension.
Definition liblts.cpp:26
static const std::array< std::string, 5 > extension_strings
Definition liblts.cpp:73
std::string supported_lts_formats_text(lts_type default_format, const std::set< lts_type > &supported)
Gives a textual list describing supported LTS formats.
Definition liblts.cpp:152
std::string supported_lts_formats_text(const std::set< lts_type > &supported)
Gives a textual list describing supported LTS formats.
Definition liblts.cpp:185
bool destructive_bisimulation_compare_minimal_depth(LTS_TYPE &l1, LTS_TYPE &l2, const std::string &counter_example_file)
std::string string_for_type(const lts_type type)
Gives a string representation of an LTS format.
Definition liblts.cpp:112
void unmark_explicit_divergence_transitions(LTS_TYPE &l, const std::size_t divergent_transition_label)
std::string mime_type_for_type(const lts_type type)
Gives the MIME type associated with an LTS format.
Definition liblts.cpp:122
void get_trans(const outgoing_transitions_per_state_t &begin, tree_set_store &tss, std::ptrdiff_t d, std::vector< transition > &d_trans, LTS_TYPE &aut)
lts_type parse_format(std::string const &s)
Determines the LTS format from a format specification string.
Definition liblts.cpp:91
static const std::array< std::string, 5 > type_strings
Definition liblts.cpp:71
std::string extension_for_type(const lts_type type)
Gives the filename extension associated with an LTS format.
Definition liblts.cpp:117
LABEL_TYPE make_divergence_label(const std::string &s)
const std::set< lts_type > & supported_lts_formats()
Gives the set of all supported LTS formats.
Definition liblts.cpp:139
std::string lts_extensions_as_string(const std::set< lts_type > &supported)
Gives a list of extensions for supported LTS formats.
Definition liblts.cpp:221
std::string lts_extensions_as_string(const std::string &sep, const std::set< lts_type > &supported)
Gives a list of extensions for supported LTS formats.
Definition liblts.cpp:190
std::size_t mark_explicit_divergence_transitions(LTS_TYPE &l)
bool destructive_bisimulation_compare(LTS_TYPE &l1, LTS_TYPE &l2, bool branching=false, bool preserve_divergences=false, bool generate_counter_examples=false, const std::string &counter_example_file="", bool structured_output=false)
Checks whether the two initial states of two lts's are strong or branching bisimilar.
void bisimulation_reduce(LTS_TYPE &l, bool branching=false, bool preserve_divergences=false)
Reduce transition system l with respect to strong or (divergence preserving) branching bisimulation.
bool lts_named_cmp(const std::array< std::string, Size > &N, T a, T b)
Definition liblts.cpp:147
static const std::array< std::string, 5 > type_desc_strings
Definition liblts.cpp:75
static const std::array< std::string, 5 > mime_type_strings
Definition liblts.cpp:84
static const std::set< lts_type > & initialise_supported_lts_formats()
Definition liblts.cpp:127
std::string pp(const state_label_dot &l)
Pretty print function for a state_label_dot. Only prints the label field.
Definition lts_dot.h:97
std::string pp(const state_label_lts &label)
Pretty print a state value of this LTS.
Definition lts_lts.h:106
bool is_deterministic(const LTS_TYPE &l)
Checks whether this LTS is deterministic.
outgoing_transitions_per_state_action_t transitions_per_outgoing_state_action_pair_reversed(const std::vector< transition > &trans)
Provide the transitions as a multimap accessible per from state and label, ordered backwardly.
action_label_lts parse_lts_action(const std::string &multi_action_string, const data::data_specification &data_spec, lps::multi_action_type_checker &typechecker)
Parse a string into an action label.
Definition lts_lts.h:201
void group_transitions_on_label(std::vector< transition > &transitions, std::function< std::size_t(const transition &)> get_label, const std::size_t number_of_labels, const std::size_t tau_label_index)
std::size_t to(const outgoing_pair_t &p)
Target state of a label state pair.
std::string pp(const state_label_fsm &label)
Pretty print an fsm state label.
Definition lts_fsm.h:75
outgoing_transitions_per_state_action_t transitions_per_outgoing_state_action_pair(const std::vector< transition > &trans)
Provide the transitions as a multimap accessible per from state and label.
void sort_transitions(std::vector< transition > &transitions, const std::set< transition::size_type > &hidden_label_set, transition_sort_style ts=src_lbl_tgt)
Sorts the transitions using a sort style.
void determinise(LTS_TYPE &l)
Determinises this LTS.
std::string pp(const probabilistic_state< STATE, PROBABILITY > &l)
std::ostream & operator<<(std::ostream &out, const probabilistic_state< STATE, PROBABILITY > &l)
Pretty print to an outstream.
void reduce(LTS_TYPE &l, lts_equivalence eq)
Applies a reduction algorithm to this LTS.
bool compare(const LTS_TYPE &l1, const LTS_TYPE &l2, lts_equivalence eq, bool generate_counter_examples=false, const std::string &counter_example_file="", bool structured_output=false)
Checks whether this LTS is equivalent to another LTS.
outgoing_transitions_per_state_action_t transitions_per_outgoing_state_action_pair_reversed(const std::vector< transition > &trans, const std::set< transition::size_type > &hide_label_set)
Provide the transitions as a multimap accessible per from state and label, ordered backwardly.
bool destructive_compare(LTS_TYPE &l1, LTS_TYPE &l2, const lts_equivalence eq, const bool generate_counter_examples=false, const std::string &counter_example_file=std::string(), const bool structured_output=false)
Checks whether this LTS is equivalent to another LTS.
std::string pp(const action_label_lts &l)
Print the action label to string.
Definition lts_lts.h:188
bool destructive_compare(LTS_TYPE &l1, LTS_TYPE &l2, lts_preorder pre, bool generate_counter_example, const std::string &counter_example_file="", bool structured_output=false, lps::exploration_strategy strategy=lps::es_breadth, bool preprocess=true)
Checks whether this LTS is smaller than another LTS according to a preorder.
outgoing_transitions_per_state_action_t transitions_per_outgoing_state_action_pair(const std::vector< transition > &trans, const std::set< transition::size_type > &hide_label_set)
Provide the transitions as a multimap accessible per from state and label.
void merge(LTS_TYPE &l1, const LTS_TYPE &l2)
Merge the second lts into the first lts.
bool reachability_check(lts< SL, AL, BASE > &l, bool remove_unreachable=false)
Checks whether all states in this LTS are reachable from the initial state and remove unreachable sta...
std::size_t label(const outgoing_pair_t &p)
Label of a pair of a label and target state.
std::size_t from(const outgoing_transitions_per_state_action_t::const_iterator &i)
From state of an iterator exploring transitions per outgoing state and action.
void group_transitions_on_label(const std::vector< transition >::iterator begin, const std::vector< transition >::iterator end, std::function< std::size_t(const transition &)> get_label, std::vector< std::pair< std::size_t, std::size_t > > &count_sum_transitions_per_action, const std::size_t tau_label_index=0, std::vector< std::size_t > &todo_stack=bogus_todo_stack)
bool reachability_check(probabilistic_lts< SL, AL, PROBABILISTIC_STATE, BASE > &l, bool remove_unreachable=false)
Checks whether all states in a probabilistic LTS are reachable from the initial state and remove unre...
bool compare(const LTS_TYPE &l1, const LTS_TYPE &l2, lts_preorder pre, bool generate_counter_example, const std::string &counter_example_file="", bool structured_output=false, lps::exploration_strategy strategy=lps::es_breadth, bool preprocess=true)
Checks whether this LTS is smaller than another LTS according to a preorder.
The main namespace for the Process library.
bool is_linear(const process_specification &p, bool verbose=false)
Returns true if the process specification is linear.
Definition is_linear.h:344
bool is_untyped_multi_action(const atermpp::aterm &x)
void swap(trans &t1, trans &t2) noexcept
\brief swap overload
bool is_alt(const atermpp::aterm &x)
bool is_untyped_regular_formula(const atermpp::aterm &x)
void make_trans(atermpp::aterm &t, const ARGUMENTS &... args)
std::ostream & operator<<(std::ostream &out, const regular_formula &x)
void make_seq(atermpp::aterm &t, const ARGUMENTS &... args)
void make_trans_or_nil(atermpp::aterm &t, const ARGUMENTS &... args)
bool is_trans(const atermpp::aterm &x)
std::string pp(const regular_formulas::trans &x, bool arg0)
void make_alt(atermpp::aterm &t, const ARGUMENTS &... args)
void make_untyped_regular_formula(atermpp::aterm &t, const ARGUMENTS &... args)
std::string pp(const regular_formulas::alt &x, bool arg0)
std::ostream & operator<<(std::ostream &out, const trans &x)
void swap(untyped_regular_formula &t1, untyped_regular_formula &t2) noexcept
\brief swap overload
bool is_trans_or_nil(const atermpp::aterm &x)
std::ostream & operator<<(std::ostream &out, const untyped_regular_formula &x)
bool is_regular_formula(const atermpp::aterm &x)
void swap(trans_or_nil &t1, trans_or_nil &t2) noexcept
\brief swap overload
std::ostream & operator<<(std::ostream &out, const trans_or_nil &x)
bool is_seq(const atermpp::aterm &x)
std::string pp(const regular_formulas::untyped_regular_formula &x, bool arg0)
std::string pp(const regular_formulas::seq &x, bool arg0)
std::string pp(const regular_formulas::trans_or_nil &x, bool arg0)
void swap(seq &t1, seq &t2) noexcept
\brief swap overload
std::ostream & operator<<(std::ostream &out, const seq &x)
void swap(regular_formula &t1, regular_formula &t2) noexcept
\brief swap overload
std::ostream & operator<<(std::ostream &out, const alt &x)
std::string pp(const regular_formulas::regular_formula &x, bool arg0)
void swap(alt &t1, alt &t2) noexcept
\brief swap overload
bool is_timed(const state_formula &x)
void swap(variable &t1, variable &t2) noexcept
\brief swap overload
bool is_infimum(const atermpp::aterm &x)
std::string pp(const state_formulas::nu &x, bool arg0)
std::string pp(const state_formulas::exists &x, bool arg0)
std::string pp(const state_formulas::not_ &x, bool arg0)
std::ostream & operator<<(std::ostream &out, const not_ &x)
bool is_and(const atermpp::aterm &x)
void swap(minus &t1, minus &t2) noexcept
\brief swap overload
std::ostream & operator<<(std::ostream &out, const sum &x)
std::string pp(const state_formulas::supremum &x, bool arg0)
bool is_delay_timed(const atermpp::aterm &x)
void swap(exists &t1, exists &t2) noexcept
\brief swap overload
bool is_const_multiply(const atermpp::aterm &x)
std::ostream & operator<<(std::ostream &out, const exists &x)
std::string pp(const state_formulas::must &x, bool arg0)
void swap(const_multiply_alt &t1, const_multiply_alt &t2) noexcept
\brief swap overload
bool is_minus(const atermpp::aterm &x)
void make_imp(atermpp::aterm &t, const ARGUMENTS &... args)
bool is_exists(const atermpp::aterm &x)
void swap(may &t1, may &t2) noexcept
\brief swap overload
void swap(mu &t1, mu &t2) noexcept
\brief swap overload
bool is_not(const atermpp::aterm &x)
std::string pp(const state_formulas::minus &x, bool arg0)
bool is_state_formula(const atermpp::aterm &x)
void swap(sum &t1, sum &t2) noexcept
\brief swap overload
std::ostream & operator<<(std::ostream &out, const const_multiply &x)
std::ostream & operator<<(std::ostream &out, const may &x)
void make_const_multiply(atermpp::aterm &t, const ARGUMENTS &... args)
std::ostream & operator<<(std::ostream &out, const nu &x)
void make_exists(atermpp::aterm &t, const ARGUMENTS &... args)
void swap(supremum &t1, supremum &t2) noexcept
\brief swap overload
bool is_supremum(const atermpp::aterm &x)
void swap(true_ &t1, true_ &t2) noexcept
\brief swap overload
std::ostream & operator<<(std::ostream &out, const minus &x)
bool is_must(const atermpp::aterm &x)
void swap(const_multiply &t1, const_multiply &t2) noexcept
\brief swap overload
std::set< data::variable > find_all_variables(const state_formulas::state_formula &x)
std::ostream & operator<<(std::ostream &out, const imp &x)
bool is_yaled(const atermpp::aterm &x)
std::ostream & operator<<(std::ostream &out, const mu &x)
void make_and_(atermpp::aterm &t, const ARGUMENTS &... args)
std::ostream & operator<<(std::ostream &out, const must &x)
std::ostream & operator<<(std::ostream &out, const supremum &x)
void swap(not_ &t1, not_ &t2) noexcept
\brief swap overload
std::set< data::variable > find_free_variables(const state_formulas::state_formula &x)
void swap(state_formula &t1, state_formula &t2) noexcept
\brief swap overload
bool is_true(const atermpp::aterm &x)
std::string pp(const state_formulas::true_ &x, bool arg0)
std::ostream & operator<<(std::ostream &out, const true_ &x)
std::string pp(const state_formulas::state_formula &x, bool arg0)
std::ostream & operator<<(std::ostream &out, const variable &x)
std::ostream & operator<<(std::ostream &out, const state_formula &x)
void swap(plus &t1, plus &t2) noexcept
\brief swap overload
std::string pp(const state_formulas::const_multiply &x, bool arg0)
void make_plus(atermpp::aterm &t, const ARGUMENTS &... args)
std::ostream & operator<<(std::ostream &out, const and_ &x)
std::string pp(const state_formulas::delay_timed &x, bool arg0)
void swap(yaled &t1, yaled &t2) noexcept
\brief swap overload
void swap(delay &t1, delay &t2) noexcept
\brief swap overload
bool is_variable(const atermpp::aterm &x)
void make_not_(atermpp::aterm &t, const ARGUMENTS &... args)
std::ostream & operator<<(std::ostream &out, const forall &x)
void make_infimum(atermpp::aterm &t, const ARGUMENTS &... args)
bool is_may(const atermpp::aterm &x)
std::ostream & operator<<(std::ostream &out, const yaled_timed &x)
bool is_yaled_timed(const atermpp::aterm &x)
bool is_imp(const atermpp::aterm &x)
void swap(yaled_timed &t1, yaled_timed &t2) noexcept
\brief swap overload
void make_delay_timed(atermpp::aterm &t, const ARGUMENTS &... args)
std::string pp(const state_formulas::imp &x, bool arg0)
std::ostream & operator<<(std::ostream &out, const or_ &x)
std::string pp(const state_formulas::mu &x, bool arg0)
void make_const_multiply_alt(atermpp::aterm &t, const ARGUMENTS &... args)
void make_may(atermpp::aterm &t, const ARGUMENTS &... args)
bool is_sum(const atermpp::aterm &x)
state_formulas::state_formula translate_user_notation(const state_formulas::state_formula &x)
void make_must(atermpp::aterm &t, const ARGUMENTS &... args)
state_formulas::state_formula normalize_sorts(const state_formulas::state_formula &x, const data::sort_specification &sortspec)
void swap(and_ &t1, and_ &t2) noexcept
\brief swap overload
bool is_nu(const atermpp::aterm &x)
void swap(false_ &t1, false_ &t2) noexcept
\brief swap overload
std::string pp(const state_formulas::delay &x, bool arg0)
std::ostream & operator<<(std::ostream &out, const false_ &x)
std::string pp(const state_formulas::forall &x, bool arg0)
void swap(forall &t1, forall &t2) noexcept
\brief swap overload
std::string pp(const state_formulas::sum &x, bool arg0)
void swap(delay_timed &t1, delay_timed &t2) noexcept
\brief swap overload
void swap(infimum &t1, infimum &t2) noexcept
\brief swap overload
std::ostream & operator<<(std::ostream &out, const plus &x)
std::string pp(const state_formulas::yaled &x, bool arg0)
bool is_delay(const atermpp::aterm &x)
std::ostream & operator<<(std::ostream &out, const infimum &x)
std::string pp(const state_formulas::infimum &x, bool arg0)
std::string pp(const state_formulas::or_ &x, bool arg0)
std::ostream & operator<<(std::ostream &out, const delay &x)
std::string pp(const state_formulas::may &x, bool arg0)
bool is_false(const atermpp::aterm &x)
void make_variable(atermpp::aterm &t, const ARGUMENTS &... args)
void make_nu(atermpp::aterm &t, const ARGUMENTS &... args)
void make_supremum(atermpp::aterm &t, const ARGUMENTS &... args)
void make_sum(atermpp::aterm &t, const ARGUMENTS &... args)
void swap(must &t1, must &t2) noexcept
\brief swap overload
bool is_plus(const atermpp::aterm &x)
std::ostream & operator<<(std::ostream &out, const delay_timed &x)
void swap(nu &t1, nu &t2) noexcept
\brief swap overload
std::string pp(const state_formulas::and_ &x, bool arg0)
void make_forall(atermpp::aterm &t, const ARGUMENTS &... args)
std::string pp(const state_formulas::false_ &x, bool arg0)
std::string pp(const state_formulas::const_multiply_alt &x, bool arg0)
bool is_mu(const atermpp::aterm &x)
bool is_forall(const atermpp::aterm &x)
void make_minus(atermpp::aterm &t, const ARGUMENTS &... args)
bool is_const_multiply_alt(const atermpp::aterm &x)
void swap(or_ &t1, or_ &t2) noexcept
\brief swap overload
std::string pp(const state_formulas::yaled_timed &x, bool arg0)
std::string pp(const state_formulas::plus &x, bool arg0)
bool is_or(const atermpp::aterm &x)
void make_or_(atermpp::aterm &t, const ARGUMENTS &... args)
void make_yaled_timed(atermpp::aterm &t, const ARGUMENTS &... args)
std::string pp(const state_formulas::variable &x, bool arg0)
void swap(imp &t1, imp &t2) noexcept
\brief swap overload
std::set< data::sort_expression > find_sort_expressions(const state_formulas::state_formula &x)
bool find_nil(const state_formulas::state_formula &x)
std::ostream & operator<<(std::ostream &out, const const_multiply_alt &x)
std::set< process::action_label > find_action_labels(const state_formulas::state_formula &x)
std::ostream & operator<<(std::ostream &out, const yaled &x)
void make_mu(atermpp::aterm &t, const ARGUMENTS &... args)
std::set< core::identifier_string > find_identifiers(const state_formulas::state_formula &x)
void swap(atermpp::term_balanced_tree< T > &t1, atermpp::term_balanced_tree< T > &t2) noexcept
Swaps two balanced trees.
static const atermpp::aterm StateMay
static const atermpp::aterm StateOr
static const atermpp::aterm UntypedRegFrm
static const atermpp::aterm StateFrm
static const atermpp::aterm StateYaled
static const atermpp::aterm RegAlt
static const atermpp::aterm ActNot
static const atermpp::aterm ActImp
static const atermpp::aterm ActTrue
static const atermpp::aterm StateInfimum
static const atermpp::aterm StateAnd
static const atermpp::aterm StateExists
static const atermpp::aterm RegTrans
static const atermpp::aterm ActOr
static const atermpp::aterm StateConstantMultiplyAlt
static const atermpp::aterm ActFrm
static const atermpp::aterm ActForall
static const atermpp::aterm StateYaledTimed
static const atermpp::aterm ActFalse
static const atermpp::aterm StateFalse
static const atermpp::aterm RegFrm
static const atermpp::aterm StateDelay
static const atermpp::aterm StatePlus
static const atermpp::aterm StateMinus
static const atermpp::aterm StateNu
static const atermpp::aterm ActAnd
static const atermpp::aterm StateDelayTimed
static const atermpp::aterm StateSupremum
static const atermpp::aterm StateSum
static const atermpp::aterm ActAt
static const atermpp::aterm ActExists
static const atermpp::aterm StateMu
static const atermpp::aterm RegTransOrNil
static const atermpp::aterm StateVar
static const atermpp::aterm StateImp
static const atermpp::aterm RegSeq
static const atermpp::aterm StateTrue
static const atermpp::aterm StateForall
static const atermpp::aterm StateMust
static const atermpp::aterm StateNot
static const atermpp::aterm ActMultAct
static const atermpp::aterm StateConstantMultiply
std::vector< transition > non_inert_transitions
std::vector< non_bottom_state > non_bottom_states
non_bottom_state(const state_type s, const std::vector< state_type > &it)
Converts a process expression into linear process format. Use the convert member functions for this.
lps::specification convert(const process_specification &p)
Converts a process_specification into a specification. Throws non_linear_process if a non-linear sub-...
Converts a process expression into linear process format. Use the convert member functions for this.
lps::stochastic_specification convert(const process_specification &p)
Converts a process_specification into a stochastic_specification. Throws non_linear_process if a non-...
std::size_t operator()(const atermpp::term_balanced_tree< T > &t) const
std::size_t operator()(const mcrl2::lps::probabilistic_data_expression &p) const
std::size_t operator()(const mcrl2::lps::state_probability_pair< STATE, PROBABILITY > &p) const
std::size_t operator()(const mcrl2::lts::action_label_lts &as) const
Definition lts_lts.h:424
std::size_t operator()(const mcrl2::lts::probabilistic_state< STATE, PROBABILITY > &p) const