mCRL2
Loading...
Searching...
No Matches
decluster.h
Go to the documentation of this file.
1// Author(s): Jeroen Keiren
2// Copyright: see the accompanying file COPYING or copy at
3// https://github.com/mCRL2org/mCRL2/blob/master/COPYING
4//
5// Distributed under the Boost Software License, Version 1.0.
6// (See accompanying file LICENSE_1_0.txt or copy at
7// http://www.boost.org/LICENSE_1_0.txt)
8//
11
12#ifndef MCRL2_LPS_DECLUSTER_H
13#define MCRL2_LPS_DECLUSTER_H
14
15#include "mcrl2/data/join.h"
17
18namespace mcrl2
19{
20namespace lps
21{
22
23template <typename Specification>
24class decluster_algorithm: public detail::lps_algorithm<Specification>
25{
27 typedef typename Specification::process_type process_type;
28 typedef typename process_type::action_summand_type action_summand_type;
29 typedef std::vector<action_summand_type> action_summand_vector_type;
30 using super::m_spec;
31
32 protected:
33
34 template <typename SummandType, typename OutIter>
35 void decluster_summand(const SummandType& summand, OutIter& out)
36 {
37 for(const data::data_expression& disjunct: data::split_or(summand.condition()))
38 {
39 SummandType s(summand);
40 s.condition() = disjunct;
41 *out++ = s;
42 }
43 }
44
45 public:
46 decluster_algorithm(Specification& spec)
47 : detail::lps_algorithm<Specification>(spec)
48 {}
49
50 void run()
51 {
52 action_summand_vector_type declustered_action_summands;
53 std::back_insert_iterator<action_summand_vector_type> act_it(declustered_action_summands);
54 auto const& action_summands = m_spec.process().action_summands();
55 for (auto i = action_summands.begin(); i != action_summands.end(); ++i)
56 {
57 decluster_summand(*i, act_it);
58 }
59
60 deadlock_summand_vector declustered_deadlock_summands;
61 std::back_insert_iterator<deadlock_summand_vector> dl_it (declustered_deadlock_summands);
62 auto const& deadlock_summands = m_spec.process().deadlock_summands();
63 for (auto i = deadlock_summands.begin(); i != deadlock_summands.end(); ++i)
64 {
65 decluster_summand(*i, dl_it);
66 }
67
68 m_spec.process().action_summands() = declustered_action_summands;
69 m_spec.process().deadlock_summands() = declustered_deadlock_summands;
70 }
71
72}; // decluster_algorithm
73
74} // namespace lps
75} // namespace mcrl2
76
77#endif // MCRL2_LPS_DECLUSTER_H
78
Specification::process_type process_type
Definition decluster.h:27
process_type::action_summand_type action_summand_type
Definition decluster.h:28
void decluster_summand(const SummandType &summand, OutIter &out)
Definition decluster.h:35
decluster_algorithm(Specification &spec)
Definition decluster.h:46
detail::lps_algorithm< Specification > super
Definition decluster.h:26
std::vector< action_summand_type > action_summand_vector_type
Definition decluster.h:29
Algorithm class for algorithms on linear process specifications. It can be instantiated with lps::spe...
lps_algorithm(Specification &spec)
Constructor.
Specification & m_spec
The specification that is processed by the algorithm.
Join and split functions for data expressions.
Add your file description here.
std::set< data_expression > split_or(const data_expression &expr)
Splits a disjunction into a sequence of operands Given a data expression of the form p1 || p2 || ....
Definition join.h:53
std::vector< deadlock_summand > deadlock_summand_vector
\brief vector of deadlock_summands
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
Definition indexed_set.h:72