12#ifndef MCRL2_LPS_SUMINST_H
13#define MCRL2_LPS_SUMINST_H
30 const std::set<data::sort_expression>& sorts = s.
sorts();
31 std::set<data::sort_expression> result;
43template<
typename DataRewriter,
typename Specification>
70 template <
typename SummandType,
typename Container>
74 std::size_t nr_summands = 0;
75 std::deque< variable > variables;
78 for (
const variable& v: s.summation_variables())
82 if (
m_spec.data().is_certainly_finite(v.sort()))
84 variables.push_front(v);
88 variables.push_back(v);
93 if (variables.empty())
103 const variable_list vl(variables.begin(),variables.end());
104 variable_list new_summation_variables = term_list_difference(s.summation_variables(), vl);
114 mutable_indexed_substitution<> sigma;
115 p.add_assignments(vl, sigma, m_rewriter);
116 mCRL2log(log::debug) <<
"substitutions: " << sigma << std::endl;
118 t.summation_variables() = new_summation_variables;
119 lps::rewrite(t, m_rewriter, sigma);
124 sort_bool::is_false_function_symbol
132 mCRL2log(
log::debug) <<
"An error occurred in enumeration, removing already added summands, and keeping the original" << std::endl;
135 result.resize(result.size() - nr_summands);
153 template <
typename SummandListType,
typename Container>
154 void run(
const SummandListType& list, Container& result)
156 for (
typename SummandListType::const_iterator i = list.
begin(); i != list.
end(); ++i)
172 result.push_back(*i);
176 <<
" summands (" <<
m_deleted <<
" were deleted)" << std::endl;
183 std::set<data::sort_expression> sorts = std::set<data::sort_expression>(),
184 bool tau_summands_only =
false)
196 mCRL2log(
log::info) <<
"an empty set of sorts to be unfolded was provided; defaulting to all finite sorts" << std::endl;
208 run(
m_spec.process().action_summands(), action_summands);
209 run(
m_spec.process().deadlock_summands(), deadlock_summands);
210 m_spec.process().action_summands().swap(action_summands);
211 m_spec.process().deadlock_summands().swap(deadlock_summands);
const_iterator end() const
Returns a const_iterator pointing past the last argument.
const_iterator begin() const
Returns an iterator pointing to the first argument.
bool is_certainly_finite(const sort_expression &s) const
Checks whether a sort is certainly finite.
An enumerator algorithm that generates solutions of a condition.
std::size_t enumerate(const EnumeratorListElement &p, MutableSubstitution &sigma, ReportSolution report_solution, Reject reject=Reject(), Accept accept=Accept()) const
Enumerates the element p. Solutions are reported using the callback function report_solution....
An element for the todo list of the enumerator that collects the substitution corresponding to the ex...
Generic substitution function.
const std::set< sort_expression > & sorts() const
Gets the normalised sort declarations including those that are system defined. This is the set with a...
LPS summand containing a deadlock.
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.
process_type::action_summand_type action_summand_type
DataRewriter m_rewriter
Rewriter.
void run(const SummandListType &list, Container &result)
std::set< data::sort_expression > m_sorts
Sorts to be instantiated.
detail::lps_algorithm< Specification > super
data::enumerator_identifier_generator m_id_generator
Specification::process_type process_type
data::enumerator_algorithm m_enumerator
std::vector< action_summand_type > action_summand_vector_type
std::size_t instantiate_summand(const SummandType &s, Container &result)
std::size_t m_processed
Statistiscs for verbose output.
bool must_instantiate(const action_summand_type &summand)
bool must_instantiate(const deadlock_summand &)
suminst_algorithm(Specification &spec, DataRewriter &r, std::set< data::sort_expression > sorts=std::set< data::sort_expression >(), bool tau_summands_only=false)
data::enumerator_list_element_with_substitution enumerator_element
bool m_tau_summands_only
Only instantiate tau summands.
Standard exception class for reporting runtime errors.
#define mCRL2log(LEVEL)
mCRL2log(LEVEL) provides the stream used to log.
Add your file description here.
std::string pp(const abstraction &x)
std::vector< deadlock_summand > deadlock_summand_vector
\brief vector of deadlock_summands
std::set< data::sort_expression > finite_sorts(const data::data_specification &s)
Return a set with all finite sorts in data specification s.
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
Set operations on term lists.