12#ifndef MCRL2_DATA_STRUCTURED_SORT_H
13#define MCRL2_DATA_STRUCTURED_SORT_H
77 template <
typename Container>
90 return atermpp::down_cast<structured_sort_constructor_list>((*
this)[0]);
114 return to_pos_function_;
120 return equal_arguments_function_;
126 return smaller_arguments_function_;
132 return smaller_equal_arguments_function_;
140 result.push_back(i.constructor_function(s));
162 for (function_symbol_vector::const_iterator j = projections.begin(); j != projections.end(); ++j)
164 result.push_back(*j);
177 result.push_back(i.recogniser_function(s));
193 std::size_t index = 1;
197 if (i->arguments().empty())
208 std::vector< variable > variables1;
209 std::vector< variable > variables2;
212 variables1.push_back(
variable(generator(
"v"), k.sort()));
213 variables2.push_back(
variable(generator(
"w"), k.sort()));
215 application instance1(i->constructor_function(s), variables1);
216 application instance2(i->constructor_function(s), variables2);
221 variable_vector::const_reverse_iterator
end(variables1.rend());
222 variable_vector::const_reverse_iterator k(variables1.rbegin());
223 variable_vector::const_reverse_iterator l(variables2.rbegin());
229 for (++l, ++k; k !=
end; ++l, ++k)
254 variables1.insert(variables1.end(),variables2.begin(),variables2.end());
299 if (!i.arguments().empty())
305 std::vector< variable > variables;
308 for (
const auto & argument : arguments)
310 variables.push_back(
variable(generator(
"v"), argument.sort()));
313 std::vector< variable >::const_iterator v = variables.begin();
320 (
application(i.constructor_function(s), variables)));
339 for (
const auto & j : cl)
345 if (i->arguments().empty())
347 result.push_back(
data_equation(j.recogniser_function(s)(i->constructor_function(s)), right));
359 for (
const auto & argument : arguments)
361 variables.push_back(
variable(generator(
"v"), argument.sort()));
364 result.push_back(
data_equation(variables, j.recogniser_function(s)(
365 application(i->constructor_function(s), variables)), right));
438template <
class... ARGUMENTS>
const_iterator end() const
Returns a const_iterator pointing past the last argument.
aterm()
Default constructor.
const_iterator begin() const
Returns an iterator pointing to the first argument.
bool empty() const
Returns true if the term has no arguments.
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 swap(unprotected_aterm_core &t) noexcept
Swaps this term with its argument.
An application of a data expression to a number of arguments.
Identifier generator that stores the identifiers of the context in a set. Using the operator()() and ...
\brief An argument of a constructor of a structured sort
\brief A constructor for a structured sort
const core::identifier_string & recogniser() const
data_equation_vector recogniser_equations() const
Generate equations for the recognisers of this sort, assuming that this sort is referred to with s.
function_symbol smaller_arguments_function(const sort_expression &s) const
function_symbol_vector recogniser_functions(const sort_expression &s) const
function_symbol to_pos_function(const sort_expression &s) const
structured_sort(const structured_sort &) noexcept=default
Move semantics.
function_symbol_vector constructor_functions(const sort_expression &s) const
data_equation_vector comparison_equations() const
Returns the equations for the functions used to implement comparison operators on this sort....
data_equation_vector constructor_equations(const sort_expression &s) const
data_equation_vector recogniser_equations(const sort_expression &s) const
static bool has_recogniser(structured_sort_constructor const &s)
data_equation_vector projection_equations() const
Generate equations for the projection functions of this sort.
function_symbol equal_arguments_function(const sort_expression &s) const
structured_sort(const Container &constructors, typename atermpp::enable_if_container< Container, structured_sort_constructor >::type *=nullptr)
\brief Constructor Z2.
const structured_sort_constructor_list & constructors() const
function_symbol_vector constructor_functions() const
Returns the constructor functions of this sort, such that the result can be used by the rewriter.
function_symbol_vector projection_functions() const
Returns the projection functions of this sort, such that the result can be used by the rewriter.
function_symbol_vector comparison_functions(const sort_expression &s) const
function_symbol_vector comparison_functions() const
Returns the additional functions of this sort, used to implement its comparison operators.
data_equation_vector comparison_equations(const sort_expression &s) const
structured_sort(const structured_sort_constructor_list &constructors)
\brief Constructor Z14.
function_symbol_vector recogniser_functions() const
Returns the recogniser functions of this sort, such that the result can be used by the rewriter.
function_symbol_vector projection_functions(const sort_expression &s) const
structured_sort()
\brief Default constructor X3.
structured_sort(structured_sort &&) noexcept=default
data_equation_vector projection_equations(const sort_expression &s) const
structured_sort(const atermpp::aterm &term)
data_equation_vector constructor_equations() const
Returns the equations for ==, < and <= for this sort, such that the result can be used by the rewrite...
function_symbol smaller_equal_arguments_function(const sort_expression &s) const
The main namespace for the aterm++ library.
void make_term_appl(Term &target, const function_symbol &sym, ForwardIterator begin, ForwardIterator end)
Constructor an aterm in a variable based on a function symbol and an forward iterator providing the a...
bool check_term_SortStruct(const Term &t)
const atermpp::function_symbol & function_symbol_SortStruct()
identifier_string empty_identifier_string()
Provides the empty identifier string.
const basic_sort & bool_()
Constructor for sort expression Bool.
const function_symbol & and_()
Constructor for function symbol &&.
const function_symbol & false_()
Constructor for function symbol false.
const function_symbol & or_()
Constructor for function symbol ||.
const function_symbol & true_()
Constructor for function symbol true.
function_symbol_vector fbag_generate_constructors_code(const sort_expression &s)
Give all system defined constructors for fbag.
function_symbol_vector fbag_generate_functions_code(const sort_expression &s)
Give all system defined mappings for fbag.
data_equation_vector fbag_generate_equations_code(const sort_expression &s)
Give all system defined equations for fbag.
function_symbol_vector fset_generate_constructors_code(const sort_expression &s)
Give all system defined constructors for fset.
function_symbol_vector fset_generate_functions_code(const sort_expression &s)
Give all system defined mappings for fset.
data_equation_vector fset_generate_equations_code(const sort_expression &s)
Give all system defined equations for fset.
const basic_sort & pos()
Constructor for sort expression Pos.
function_symbol less_equal(const sort_expression &s)
Constructor for function symbol <=.
void swap(abstraction &t1, abstraction &t2)
\brief swap overload
function_symbol not_equal_to(const sort_expression &s)
Constructor for function symbol !=.
function_symbol less(const sort_expression &s)
Constructor for function symbol <.
std::vector< data_equation > data_equation_vector
\brief vector of data_equations
std::vector< structured_sort > structured_sort_vector
\brief vector of structured_sorts
std::vector< variable > variable_vector
\brief vector of variables
function_sort make_function_sort_(const sort_expression &dom1, const sort_expression &codomain)
Convenience constructor for function sort with domain size 1.
std::string pp(const abstraction &x)
atermpp::term_list< structured_sort > structured_sort_list
\brief list of structured_sorts
function_symbol equal_to(const sort_expression &s)
Constructor for function symbol ==.
void make_structured_sort(atermpp::aterm &t, const ARGUMENTS &... args)
std::vector< function_symbol > function_symbol_vector
\brief vector of function_symbols
std::ostream & operator<<(std::ostream &out, const abstraction &x)
function_symbol greater(const sort_expression &s)
Constructor for function symbol >
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
The classes set_identifier_generator and multiset_identifier_generator.
Provides utilities for working with data expressions of standard sorts.
The classes structured_sort_constructor.