12#ifndef MCRL2_DATA_SELECTION_H
13#define MCRL2_DATA_SELECTION_H
49 template <
typename Range >
66 std::set< sort_expression > sorts(specification.
sorts().begin(),specification.
sorts().end());
77 const container_sort &s = atermpp::down_cast<container_sort>(sort);
86 std::map< data_equation, std::set< function_symbol > > symbols_for_equation;
90 std::set< function_symbol > used_symbols;
92 data::detail::make_find_function_symbols_traverser<data::data_expression_traverser>(std::inserter(used_symbols, used_symbols.end())).apply(equation.lhs());
93 symbols_for_equation[equation].swap(used_symbols);
98 std::vector<bool> equations_of_which_symbols_have_been_added(specification.
equations().size(),
false);
103 std::size_t equation_count=0;
106 if (!equations_of_which_symbols_have_been_added[equation_count] &&
111 equations_of_which_symbols_have_been_added[equation_count]=
true;
139 std::set< function_symbol > used_symbols;
141 data::detail::make_find_function_symbols_traverser<data::data_expression_traverser>(std::inserter(used_symbols, used_symbols.end())).apply(e.
lhs());
148 data::detail::make_find_function_symbols_traverser<data::data_expression_traverser>(std::inserter(
m_used_symbols,
m_used_symbols.end())).apply(t);
157 template <
typename Range>
166 const std::set<function_symbol>& function_symbols,
167 const std::set<data::variable>& global_variables,
168 const bool do_not_remove_function_symbols
169 ):
add_all(do_not_remove_function_symbols)
172 for (
const variable& global_variable: global_variables)
177 m_used_symbols.insert(function_symbols.begin(), function_symbols.end());
const sort_expression & element_sort() const
const data_expression & lhs() const
const std::set< data_equation > & equations() const
Gets all equations in this specification including those that are system defined.
const function_symbol_vector & constructors() const
Gets all constructors including those that are system defined.
const function_symbol_vector & mappings() const
Gets all mappings in this specification including those that are system defined.
const std::set< sort_expression > & sorts() const
Gets the normalised sort declarations including those that are system defined. This is the set with a...
Component for selecting a subset of equations that are actually used in an encompassing specification...
used_data_equation_selector(const data_specification &specification, const std::set< function_symbol > &function_symbols, const std::set< data::variable > &global_variables, const bool do_not_remove_function_symbols)
void add_symbols(Range const &r)
void add_data_specification_symbols(const data_specification &specification)
used_data_equation_selector()
default constructor
used_data_equation_selector(const data_specification &)
select all equations
void add_function_symbols(const data_expression &t)
used_data_equation_selector(data_specification const &data_spec, Range const &context)
context is a range of function symbols
void add_symbol(const function_symbol &f)
bool operator()(const data_equation &e) const
Check whether data equation relates to used symbols, and therefore is important.
bool operator()(const data::function_symbol &f) const
Check whether the symbol is used.
std::set< function_symbol > m_used_symbols
Search functions of the data library.
The class data_specification.
const basic_sort & bool_()
Constructor for sort expression Bool.
const function_symbol & and_()
Constructor for function symbol &&.
const function_symbol & or_()
Constructor for function symbol ||.
const function_symbol & not_()
Constructor for function symbol !.
function_symbol insert(const sort_expression &s)
Constructor for function symbol @fset_insert.
bool is_fset(const sort_expression &e)
Recogniser for sort expression FSet(s)
function_symbol not_equal_to(const sort_expression &s)
Constructor for function symbol !=.
function_symbol equal_to(const sort_expression &s)
Constructor for function symbol ==.
function_symbol if_(const sort_expression &s)
Constructor for function symbol if.
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...