12#ifndef MCRL2_DATA_ANONYMIZE_H
13#define MCRL2_DATA_ANONYMIZE_H
25template <
typename Derived>
41 return static_cast<Derived&
>(*this);
49 if (std::isdigit(std::string(name)[0]))
51 substitution[name] = name;
54 if (!has_key(substitution, name))
69 for (
const auto& x: user_defined_sorts) { result.
add_sort(x); }
70 for (
const auto& x: user_defined_constructors) { result.
add_constructor(x); }
71 for (
const auto& x: user_defined_mappings) { result.
add_mapping(x); }
72 for (
const auto& x: user_defined_aliases) { result.
add_alias(x); }
73 for (
const auto& x: user_defined_equations) { result.
add_equation(x); }
79 std::set<sort_expression> system_defined_sorts;
80 std::set<function_symbol> system_defined_constructors;
81 std::set<function_symbol> system_defined_mappings;
85 for (
const auto& s: system_defined_sorts)
89 const auto& name = atermpp::down_cast<basic_sort>(s).name();
95 for (
const auto& f: system_defined_constructors)
99 for (
const auto& f: system_defined_mappings)
110 derived().update(user_defined_sorts );
111 derived().update(user_defined_constructors);
112 derived().update(user_defined_mappings );
113 derived().update(user_defined_aliases );
114 derived().update(user_defined_equations );
117 user_defined_constructors,
118 user_defined_mappings ,
119 user_defined_aliases ,
120 user_defined_equations
228 std::cout << dataspec << std::endl;
Term containing a string.
const basic_sort & name() const
const sort_expression & reference() const
const core::identifier_string & name() const
const function_symbol_vector & user_defined_constructors() const
Gets the constructors defined by the user, excluding those that are system defined.
void add_mapping(const function_symbol &f)
Adds a mapping to this specification.
void add_equation(const data_equation &e)
Adds an equation to this specification.
const function_symbol_vector & user_defined_mappings() const
Gets all user defined mappings in this specification.
const data_equation_vector & user_defined_equations() const
Gets all user defined equations.
void add_constructor(const function_symbol &f)
Adds a constructor to this specification.
void get_system_defined_sorts_constructors_and_mappings(std::set< sort_expression > &sorts, std::set< function_symbol > &constructors, std::set< function_symbol > &mappings) const
This function provides a sample of all system defined sorts, constructors and mappings that contains ...
const core::identifier_string & name() const
const sort_expression & sort() const
Identifier generator that stores the identifiers of the context in a set. Using the operator()() and ...
const basic_sort_vector & user_defined_sorts() const
Gets all sorts defined by a user (excluding the system defined sorts).
void add_alias(const alias &a)
Adds an alias (new name for a sort) to this specification.
void add_sort(const basic_sort &s)
Adds a sort to this specification.
const alias_vector & user_defined_aliases() const
Gets the user defined aliases.
\brief An argument of a constructor of a structured sort
const core::identifier_string & name() const
const sort_expression & sort() const
\brief A constructor for a structured sort
const core::identifier_string & name() const
const core::identifier_string & recogniser() const
const structured_sort_constructor_argument_list & arguments() const
const core::identifier_string & name() const
const sort_expression & sort() const
add your file description here.
add your file description here.
The class data_specification.
const aterm_string & empty_string()
Returns the empty aterm_string.
void make_function_symbol(atermpp::aterm &t, const ARGUMENTS &... args)
std::vector< alias > alias_vector
\brief vector of aliass
void make_basic_sort(atermpp::aterm &t, const ARGUMENTS &... args)
void make_variable(atermpp::aterm &t, const ARGUMENTS &... args)
std::vector< data_equation > data_equation_vector
\brief vector of data_equations
void make_alias(atermpp::aterm &t, const ARGUMENTS &... args)
bool is_basic_sort(const atermpp::aterm &x)
Returns true if the term t is a basic sort.
void anonymize(data_specification &dataspec)
std::vector< basic_sort > basic_sort_vector
vector of basic sorts
void make_structured_sort_constructor(atermpp::aterm &t, const ARGUMENTS &... args)
std::vector< function_symbol > function_symbol_vector
\brief vector of function_symbols
bool has_key(const std::map< Key, T > &c, const Key &v)
Returns the value corresponding to the given key in the set m. If the key is not present,...
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)
void add_name(const core::identifier_string &name, std::map< core::identifier_string, core::identifier_string > &substitution, const std::string &hint)
void apply(T &result, const structured_sort_constructor &x)
std::map< core::identifier_string, core::identifier_string > variable_name_substitution
void enter(const basic_sort &x)
data::set_identifier_generator id_generator
void apply(T &result, const alias &x)
data::sort_expression_builder< Derived > super
data_specification make_data_specification(const basic_sort_vector &user_defined_sorts, const function_symbol_vector &user_defined_constructors, const function_symbol_vector &user_defined_mappings, const alias_vector &user_defined_aliases, const data_equation_vector &user_defined_equations)
void apply(T &result, const function_symbol &x)
std::map< core::identifier_string, core::identifier_string > sort_name_substitution
void apply(T &result, const structured_sort_constructor_argument &x)
void enter(const structured_sort_constructor &x)
void enter(const function_symbol &x)
void apply(T &result, const variable &x)
void apply(T &result, const basic_sort &x)
std::map< core::identifier_string, core::identifier_string > function_symbol_name_substitution
void enter(const structured_sort_constructor_argument &x)
void update(data_specification &x)
void enter(const variable &x)