12#ifndef MCRL2_LPS_REMOVE_H
13#define MCRL2_LPS_REMOVE_H
49 if (constructors.size() != 1)
76 void update(std::set<data::variable>& x)
90 std::vector<data::variable> result_vec;
95 result_vec.push_back(v);
107 std::vector<data::assignment> a(x.
begin(), x.
end());
108 a.erase(std::remove_if(a.begin(), a.end(), [&](
const data::assignment& y) { return contains(to_be_removed, y.lhs()); }), a.end());
138 std::vector<data::data_expression> result;
145 result.push_back(*ei);
189template <
typename Object>
198template <
typename Specification>
201 auto& v = spec.process().action_summands();
210template <
typename Specification>
214 std::set<data::variable> to_be_removed;
215 for (
const data::variable& v: spec.process().process_parameters())
219 sigma[v] = *spec.data().constructors(v.sort()).begin();
220 to_be_removed.insert(v);
223 lps::replace_variables(spec,
sigma);
233 std::vector<data::assignment> result;
236 if (a.lhs() != a.rhs() || contains(do_not_remove, a.lhs()))
246template <
typename Specification>
249 auto& summands = lpsspec.process().action_summands();
250 for (
auto i = summands.begin(); i != summands.end(); ++i)
size_type size() const
Returns the size of the term_list.
const_iterator end() const
Returns a const_iterator pointing to the end of the term_list.
const_iterator begin() const
Returns a const_iterator pointing to the beginning of the term_list.
\brief Assignment of a data expression to a variable
const function_symbol_vector & constructors() const
Gets all constructors including those that are system defined.
Generic substitution function. The substitution is stored as a mapping of variables to expressions....
const data::variable_list & process_parameters() const
Returns the sequence of process parameters.
data::data_expression_list expressions() const
const std::set< data::variable > & global_variables() const
Returns the declared free variables of the LPS.
const LinearProcess & process() const
Returns the linear process of the specification.
Linear process specification.
\brief A stochastic distribution
A stochastic process initializer.
const stochastic_distribution & distribution() const
Linear process specification.
Base class for LPS summands.
const data::data_expression & condition() const
Returns the condition expression.
static RewriterCompilingJitty::substitution_type & sigma(RewriterCompilingJitty *this_rewriter)
add your file description here.
const function_symbol & false_()
Constructor for function symbol false.
atermpp::term_list< data_expression > data_expression_list
\brief list of data_expressions
atermpp::term_list< variable > variable_list
\brief list of variables
bool is_function_sort(const atermpp::aterm &x)
Returns true if the term t is a function sort.
atermpp::term_list< assignment > assignment_list
\brief list of assignments
std::vector< deadlock_summand > deadlock_summand_vector
\brief vector of deadlock_summands
void remove_parameters(Object &x, const std::set< data::variable > &to_be_removed)
Rewrites an LPS data type.
void remove_singleton_sorts(Specification &spec)
Removes parameters with a singleton sort from a linear process specification.
data::assignment_list remove_redundant_assignments(const data::assignment_list &assignments, const data::variable_list &do_not_remove)
Removes assignments of the form x := x from v for variables x that are not contained in do_not_remove...
void remove_trivial_summands(Specification &spec)
Removes summands with condition equal to false from a linear process specification.
bool contains(const atermpp::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable > &c, const typename atermpp::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::key_type &v, const std::size_t thread_index=0)
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
void apply(T &result, const data::variable &x)
Function object that checks if a sort is a singleton sort. Note that it is an approximation,...
is_singleton_sort(const data::data_specification &data_spec)
bool operator()(const data::sort_expression &s) const
const data::data_specification & m_data_spec
Function object that checks if a summand has a false condition.
bool operator()(const summand_base &s) const
Traverser for removing parameters from LPS data types. These parameters can be either process paramet...
void apply(atermpp::term_list< T > &result, const data::assignment_list &x)
Removes parameters from a list of assignments. Assignments to removed parameters are removed.
void apply(T &result, const stochastic_process_initializer &x)
void apply(T &result, const process_initializer &x)
void update(std::set< data::variable > &x)
Removes parameters from a set container.
const std::set< data::variable > & to_be_removed
void apply(atermpp::term_list< T > &result, const data::variable_list &x)
Removes parameters from a list of variables.
void update(linear_process &x)
Removes parameters from a linear_process.
data_expression_builder< remove_parameters_builder > super
data::data_expression_list remove_expressions(const data::data_expression_list &e)
Removes expressions from e at the corresponding positions of process_parameters.
data::variable_list process_parameters
void update(stochastic_specification &x)
Removes parameters from a linear process specification.
void update(specification &x)
Removes parameters from a linear process specification.
remove_parameters_builder(const std::set< data::variable > &to_be_removed_)
void update(stochastic_linear_process &x)
Removes parameters from a linear_process.