12#ifndef MCRL2_DATA_DETAIL_DATA_UTILITY_H
13#define MCRL2_DATA_DETAIL_DATA_UTILITY_H
31template <
typename Container>
35 for (
auto const& param: parameters)
45template <
class VariableContainer>
50 for (
auto const& var: variables)
66 std::set<variable> v(variables.
begin(), variables.
end());
69 if (!contains(v, a.lhs()))
81template <
typename SortContainer>
90 if (std::find(sorts.begin(), sorts.end(), sort) == sorts.end())
95 alias sort_alias(sort);
97 if (std::find(sorts.begin(), sorts.end(), sort_alias.
name()) == sorts.end())
102 if (std::find(sorts.begin(), sorts.end(), sort_reference) == sorts.end())
111 if (std::find(sorts.begin(), sorts.end(),
container_sort(sort_reference).element_sort()) == sorts.end())
135template <
typename Iterator,
typename SortContainer>
136bool check_sorts(Iterator first, Iterator last,
const SortContainer& sorts)
138 for (Iterator i = first; i != last; ++i)
152template <
typename VariableContainer,
typename SortContainer>
155 for (
typename VariableContainer::const_iterator i = variables.begin(); i != variables.end(); ++i)
176 if (contains(names, v.name()))
188template <
typename Container,
typename SortContainer >
192 for (
typename Container::const_iterator i = container.begin(); i != container.end(); ++i)
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.
void push_front(const Term &el)
Inserts a new element at the beginning of the current list.
const basic_sort & name() const
const sort_expression & reference() const
\brief Assignment of a data expression to a variable
Add your file description here.
term_list< Term > reverse(const term_list< Term > &l)
Returns the list with the elements in reversed order.
bool check_variable_sorts(const VariableContainer &variables, const SortContainer &sorts)
Returns true if the domain sorts and the range sort of the given variables are contained in sorts.
bool check_variable_names(variable_list const &variables, const std::set< core::identifier_string > &names)
Returns true if names of the given variables are not contained in names.
bool check_assignment_variables(assignment_list const &assignments, variable_list const &variables)
Returns true if the left hand sides of assignments are contained in variables.
bool check_sort(const sort_expression &s, const SortContainer &sorts)
Returns true if the domain sorts and the codomain sort of the given sort s are contained in sorts.
bool check_data_spec_sorts(const Container &container, const SortContainer &sorts)
Returns true if the domain sorts and range sort of the given functions are contained in sorts.
data::sort_expression_list parameter_sorts(const Container ¶meters)
Returns the sorts of a sequence of parameters.
std::set< core::identifier_string > variable_names(const std::set< data::variable > &variables)
Returns the names of a set of data variables.
bool check_sorts(Iterator first, Iterator last, const SortContainer &sorts)
Returns true if the domain sorts and the range sort of the sorts in the sequence [first,...
bool unique_names(const VariableContainer &variables)
Returns true if the names of the given variables are unique.
bool is_structured_sort(const atermpp::aterm &x)
Returns true if the term t is a structured sort.
bool is_system_defined(const sort_expression &s)
Returns true iff the expression represents a standard sort.
bool is_container_sort(const atermpp::aterm &x)
Returns true if the term t is a container sort.
std::set< data::sort_expression > find_sort_expressions(const data::data_equation &x)
bool is_function_sort(const atermpp::aterm &x)
Returns true if the term t is a function sort.
bool is_alias(const atermpp::aterm &x)
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)
void remove_if(ContainerT &items, const PredicateT &predicate)
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
Provides utilities for working with data expressions of standard sorts.