15#ifndef MCRL2_DATA_SET64_H
16#define MCRL2_DATA_SET64_H
42 container_sort
set_(
const sort_expression& s)
44 container_sort
set_(set_container(), s);
53 bool is_set(
const sort_expression& e)
57 return container_sort(e).container_name() == set_container();
101 application
constructor(
const sort_expression& s,
const data_expression& arg0,
const data_expression&
arg1)
112 void make_constructor(data_expression& result,
const sort_expression& s,
const data_expression& arg0,
const data_expression&
arg1)
157 static_cast< void >(s);
188 return atermpp::down_cast<function_symbol>(e).name() ==
set_fset_name();
198 application
set_fset(
const sort_expression& s,
const data_expression& arg0)
208 void make_set_fset(data_expression& result,
const sort_expression& s,
const data_expression& arg0)
260 application
set_comprehension(
const sort_expression& s,
const data_expression& arg0)
270 void make_set_comprehension(data_expression& result,
const sort_expression& s,
const data_expression& arg0)
296 function_symbol in(
const sort_expression& ,
const sort_expression& s0,
const sort_expression& s1)
312 return f.name() ==
in_name() && atermpp::down_cast<function_sort>(f.sort()).domain().
size() == 2;
323 application
in(
const sort_expression& s,
const data_expression& arg0,
const data_expression&
arg1)
334 void make_in(data_expression& result,
const sort_expression& s,
const data_expression& arg0,
const data_expression&
arg1)
376 return atermpp::down_cast<function_symbol>(e).name() ==
complement_name();
386 application
complement(
const sort_expression& s,
const data_expression& arg0)
396 void make_complement(data_expression& result,
const sort_expression& s,
const data_expression& arg0)
422 function_symbol union_(
const sort_expression& s,
const sort_expression& s0,
const sort_expression& s1)
435 throw mcrl2::runtime_error(
"Cannot compute target sort for union_ with domain sorts " +
pp(s0) +
", " +
pp(s1) +
". ");
451 return f.name() ==
union_name() && atermpp::down_cast<function_sort>(f.sort()).domain().
size() == 2;
462 application
union_(
const sort_expression& s,
const data_expression& arg0,
const data_expression&
arg1)
473 void make_union_(data_expression& result,
const sort_expression& s,
const data_expression& arg0,
const data_expression&
arg1)
520 throw mcrl2::runtime_error(
"Cannot compute target sort for intersection with domain sorts " +
pp(s0) +
", " +
pp(s1) +
". ");
536 return f.name() ==
intersection_name() && atermpp::down_cast<function_sort>(f.sort()).domain().
size() == 2;
547 application
intersection(
const sort_expression& s,
const data_expression& arg0,
const data_expression&
arg1)
558 void make_intersection(data_expression& result,
const sort_expression& s,
const data_expression& arg0,
const data_expression&
arg1)
601 throw mcrl2::runtime_error(
"Cannot compute target sort for difference with domain sorts " +
pp(s0) +
", " +
pp(s1) +
". ");
617 return f.name() ==
difference_name() && atermpp::down_cast<function_sort>(f.sort()).domain().
size() == 2;
628 application
difference(
const sort_expression& s,
const data_expression& arg0,
const data_expression&
arg1)
639 void make_difference(data_expression& result,
const sort_expression& s,
const data_expression& arg0,
const data_expression&
arg1)
691 application
false_function(
const sort_expression& s,
const data_expression& arg0)
701 void make_false_function(data_expression& result,
const sort_expression& s,
const data_expression& arg0)
753 application
true_function(
const sort_expression& s,
const data_expression& arg0)
763 void make_true_function(data_expression& result,
const sort_expression& s,
const data_expression& arg0)
815 application
not_function(
const sort_expression& s,
const data_expression& arg0)
825 void make_not_function(data_expression& result,
const sort_expression& s,
const data_expression& arg0)
878 application
and_function(
const sort_expression& s,
const data_expression& arg0,
const data_expression&
arg1)
889 void make_and_function(data_expression& result,
const sort_expression& s,
const data_expression& arg0,
const data_expression&
arg1)
942 application
or_function(
const sort_expression& s,
const data_expression& arg0,
const data_expression&
arg1)
953 void make_or_function(data_expression& result,
const sort_expression& s,
const data_expression& arg0,
const data_expression&
arg1)
995 return atermpp::down_cast<function_symbol>(e).name() ==
fset_union_name();
1008 application
fset_union(
const sort_expression& s,
const data_expression& arg0,
const data_expression&
arg1,
const data_expression&
arg2,
const data_expression&
arg3)
1021 void make_fset_union(data_expression& result,
const sort_expression& s,
const data_expression& arg0,
const data_expression&
arg1,
const data_expression&
arg2,
const data_expression&
arg3)
1076 application
fset_intersection(
const sort_expression& s,
const data_expression& arg0,
const data_expression&
arg1,
const data_expression&
arg2,
const data_expression&
arg3)
1089 void make_fset_intersection(data_expression& result,
const sort_expression& s,
const data_expression& arg0,
const data_expression&
arg1,
const data_expression&
arg2,
const data_expression&
arg3)
1139 result.push_back(f);
1181 static_cast< void >(s);
1190 const data_expression&
left(
const data_expression& e)
1193 return atermpp::down_cast<application>(e)[0];
1202 const data_expression&
right(
const data_expression& e)
1205 return atermpp::down_cast<application>(e)[1];
1214 const data_expression&
arg(
const data_expression& e)
1217 return atermpp::down_cast<application>(e)[0];
1226 const data_expression&
arg1(
const data_expression& e)
1229 return atermpp::down_cast<application>(e)[0];
1238 const data_expression&
arg2(
const data_expression& e)
1241 return atermpp::down_cast<application>(e)[1];
1250 const data_expression&
arg3(
const data_expression& e)
1253 return atermpp::down_cast<application>(e)[2];
1262 const data_expression&
arg4(
const data_expression& e)
1265 return atermpp::down_cast<application>(e)[3];
1280 variable vx(
"x",
set_(s));
1281 variable vy(
"y",
set_(s));
1287 result.push_back(data_equation(
variable_list({ve, vf, vs}),
in(s, ve,
constructor(s, vf, vs)),
not_equal_to(vf(ve),
in(s, ve, vs))));
1288 result.push_back(data_equation(
variable_list({vf, vg, vs, vt}),
equal_to(
constructor(s, vf, vs),
constructor(s, vg, vt)), forall(
variable_list({vc}),
equal_to(
equal_to(vf(vc), vg(vc)),
equal_to(
in(s, vc, vs),
in(s, vc, vt))))));
1297 result.push_back(data_equation(
variable_list({vf, vg, vs, vt}),
union_(s,
constructor(s, vf, vs),
constructor(s, vg, vt)),
constructor(s,
or_function(s, vf, vg),
fset_union(s, vf, vg, vs, vt))));
1303 result.push_back(data_equation(
variable_list({vf, vg, vs, vt}),
intersection(s,
constructor(s, vf, vs),
constructor(s, vg, vt)),
constructor(s,
and_function(s, vf, vg),
fset_intersection(s, vf, vg, vs, vt))));
1305 result.push_back(data_equation(
variable_list({vd, vs, vx}),
intersection(s,
sort_fset::cons_(s, vd, vs), vx),
if_(
in(s, vd, vx),
sort_fset::cons_(s, vd,
intersection(s, vs, vx)),
intersection(s, vs, vx))));
1329 result.push_back(data_equation(
variable_list({vd, vf, vg, vs}),
fset_union(s, vf, vg,
sort_fset::cons_(s, vd, vs),
sort_fset::empty(s)),
sort_fset::cinsert(s, vd,
sort_bool::not_(vg(vd)),
fset_union(s, vf, vg, vs,
sort_fset::empty(s)))));
1330 result.push_back(data_equation(
variable_list({ve, vf, vg, vt}),
fset_union(s, vf, vg,
sort_fset::empty(s),
sort_fset::cons_(s, ve, vt)),
sort_fset::cinsert(s, ve,
sort_bool::not_(vf(ve)),
fset_union(s, vf, vg,
sort_fset::empty(s), vt))));
1331 result.push_back(data_equation(
variable_list({vd, vf, vg, vs, vt}),
fset_union(s, vf, vg,
sort_fset::cons_(s, vd, vs),
sort_fset::cons_(s, vd, vt)),
sort_fset::cinsert(s, vd,
equal_to(vf(vd), vg(vd)),
fset_union(s, vf, vg, vs, vt))));
1332 result.push_back(data_equation(
variable_list({vd, ve, vf, vg, vs, vt}),
less(vd, ve),
fset_union(s, vf, vg,
sort_fset::cons_(s, vd, vs),
sort_fset::cons_(s, ve, vt)),
sort_fset::cinsert(s, vd,
sort_bool::not_(vg(vd)),
fset_union(s, vf, vg, vs,
sort_fset::cons_(s, ve, vt)))));
1333 result.push_back(data_equation(
variable_list({vd, ve, vf, vg, vs, vt}),
less(ve, vd),
fset_union(s, vf, vg,
sort_fset::cons_(s, vd, vs),
sort_fset::cons_(s, ve, vt)),
sort_fset::cinsert(s, ve,
sort_bool::not_(vf(ve)),
fset_union(s, vf, vg,
sort_fset::cons_(s, vd, vs), vt))));
1335 result.push_back(data_equation(
variable_list({vd, vf, vg, vs}),
fset_intersection(s, vf, vg,
sort_fset::cons_(s, vd, vs),
sort_fset::empty(s)),
sort_fset::cinsert(s, vd, vg(vd),
fset_intersection(s, vf, vg, vs,
sort_fset::empty(s)))));
1336 result.push_back(data_equation(
variable_list({ve, vf, vg, vt}),
fset_intersection(s, vf, vg,
sort_fset::empty(s),
sort_fset::cons_(s, ve, vt)),
sort_fset::cinsert(s, ve, vf(ve),
fset_intersection(s, vf, vg,
sort_fset::empty(s), vt))));
1337 result.push_back(data_equation(
variable_list({vd, vf, vg, vs, vt}),
fset_intersection(s, vf, vg,
sort_fset::cons_(s, vd, vs),
sort_fset::cons_(s, vd, vt)),
sort_fset::cinsert(s, vd,
equal_to(vf(vd), vg(vd)),
fset_intersection(s, vf, vg, vs, vt))));
1338 result.push_back(data_equation(
variable_list({vd, ve, vf, vg, vs, vt}),
less(vd, ve),
fset_intersection(s, vf, vg,
sort_fset::cons_(s, vd, vs),
sort_fset::cons_(s, ve, vt)),
sort_fset::cinsert(s, vd, vg(vd),
fset_intersection(s, vf, vg, vs,
sort_fset::cons_(s, ve, vt)))));
1339 result.push_back(data_equation(
variable_list({vd, ve, vf, vg, vs, vt}),
less(ve, vd),
fset_intersection(s, vf, vg,
sort_fset::cons_(s, vd, vs),
sort_fset::cons_(s, ve, vt)),
sort_fset::cinsert(s, ve, vf(ve),
fset_intersection(s, vf, vg,
sort_fset::cons_(s, vd, vs), vt))));
size_type size() const
Returns the number of arguments of this term.
sort_expression sort() const
Returns the sort of the data expression.
Standard exception class for reporting runtime errors.
The class container_sort.
The class function symbol.
Exception classes for use in libraries and tools.
atermpp::aterm_string identifier_string
String type of the LPS library. Identifier strings are represented internally as ATerms.
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 & not_()
Constructor for function symbol !.
const function_symbol & true_()
Constructor for function symbol true.
function_symbol cinsert(const sort_expression &s)
Constructor for function symbol @fset_cinsert.
function_symbol cons_(const sort_expression &s)
Constructor for function symbol @fset_cons.
function_symbol empty(const sort_expression &s)
Constructor for function symbol {}.
container_sort fset(const sort_expression &s)
Constructor for sort expression FSet(S)
function_symbol head(const sort_expression &s)
Constructor for function symbol head.
const core::identifier_string & fset_intersection_name()
Generate identifier @fset_inter.
void make_in(data_expression &result, const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol in.
function_symbol true_function(const sort_expression &s)
Constructor for function symbol @true_.
const core::identifier_string & or_function_name()
Generate identifier @or_.
bool is_set_comprehension_application(const atermpp::aterm &e)
Recogniser for application of @setcomp.
const core::identifier_string & constructor_name()
Generate identifier @set.
bool is_false_function_function_symbol(const atermpp::aterm &e)
Recogniser for function @false_.
bool is_difference_function_symbol(const atermpp::aterm &e)
Recogniser for function -.
bool is_not_function_application(const atermpp::aterm &e)
Recogniser for application of @not_.
bool is_and_function_application(const atermpp::aterm &e)
Recogniser for application of @and_.
void make_or_function(data_expression &result, const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol @or_.
function_symbol_vector set_generate_constructors_and_functions_code(const sort_expression &s)
Give all system defined mappings and constructors for set_.
bool is_fset_intersection_function_symbol(const atermpp::aterm &e)
Recogniser for function @fset_inter.
bool is_set(const sort_expression &e)
Recogniser for sort expression Set(s)
function_symbol or_function(const sort_expression &s)
Constructor for function symbol @or_.
void make_complement(data_expression &result, const sort_expression &s, const data_expression &arg0)
Make an application of function symbol !.
bool is_union_application(const atermpp::aterm &e)
Recogniser for application of +.
const core::identifier_string & false_function_name()
Generate identifier @false_.
bool is_in_function_symbol(const atermpp::aterm &e)
Recogniser for function in.
const data_expression & arg4(const data_expression &e)
Function for projecting out argument. arg4 from an application.
bool is_true_function_function_symbol(const atermpp::aterm &e)
Recogniser for function @true_.
bool is_complement_application(const atermpp::aterm &e)
Recogniser for application of !.
bool is_or_function_function_symbol(const atermpp::aterm &e)
Recogniser for function @or_.
function_symbol fset_intersection(const sort_expression &s)
Constructor for function symbol @fset_inter.
std::map< function_symbol, std::pair< std::function< void(data_expression &, const data_expression &)>, std::string > > implementation_map
const core::identifier_string & set_comprehension_name()
Generate identifier @setcomp.
void make_fset_union(data_expression &result, const sort_expression &s, const data_expression &arg0, const data_expression &arg1, const data_expression &arg2, const data_expression &arg3)
Make an application of function symbol @fset_union.
bool is_fset_union_application(const atermpp::aterm &e)
Recogniser for application of @fset_union.
bool is_false_function_application(const atermpp::aterm &e)
Recogniser for application of @false_.
const data_expression & left(const data_expression &e)
Function for projecting out argument. left from an application.
bool is_not_function_function_symbol(const atermpp::aterm &e)
Recogniser for function @not_.
function_symbol and_function(const sort_expression &s)
Constructor for function symbol @and_.
bool is_set_comprehension_function_symbol(const atermpp::aterm &e)
Recogniser for function @setcomp.
bool is_in_application(const atermpp::aterm &e)
Recogniser for application of in.
const core::identifier_string & not_function_name()
Generate identifier @not_.
const core::identifier_string & in_name()
Generate identifier in.
function_symbol_vector set_generate_constructors_code(const sort_expression &s)
Give all system defined constructors for set_.
implementation_map set_cpp_implementable_mappings(const sort_expression &s)
Give all system defined mappings that are to be implemented in C++ code for set_.
bool is_fset_intersection_application(const atermpp::aterm &e)
Recogniser for application of @fset_inter.
bool is_difference_application(const atermpp::aterm &e)
Recogniser for application of -.
function_symbol not_function(const sort_expression &s)
Constructor for function symbol @not_.
const data_expression & arg(const data_expression &e)
Function for projecting out argument. arg from an application.
bool is_constructor_application(const atermpp::aterm &e)
Recogniser for application of @set.
const core::identifier_string & fset_union_name()
Generate identifier @fset_union.
bool is_set_fset_application(const atermpp::aterm &e)
Recogniser for application of @setfset.
implementation_map set_cpp_implementable_constructors(const sort_expression &s)
Give all system defined constructors which have an implementation in C++ and not in rewrite rules for...
void make_intersection(data_expression &result, const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol *.
const core::identifier_string & complement_name()
Generate identifier !.
function_symbol intersection(const sort_expression &s, const sort_expression &s0, const sort_expression &s1)
const core::identifier_string & and_function_name()
Generate identifier @and_.
bool is_fset_union_function_symbol(const atermpp::aterm &e)
Recogniser for function @fset_union.
const data_expression & arg2(const data_expression &e)
Function for projecting out argument. arg2 from an application.
function_symbol fset_union(const sort_expression &s)
Constructor for function symbol @fset_union.
void make_and_function(data_expression &result, const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol @and_.
container_sort set_(const sort_expression &s)
Constructor for sort expression Set(S)
bool is_set_fset_function_symbol(const atermpp::aterm &e)
Recogniser for function @setfset.
const core::identifier_string & intersection_name()
Generate identifier *.
void make_fset_intersection(data_expression &result, const sort_expression &s, const data_expression &arg0, const data_expression &arg1, const data_expression &arg2, const data_expression &arg3)
Make an application of function symbol @fset_inter.
function_symbol constructor(const sort_expression &s)
Constructor for function symbol @set.
const data_expression & arg3(const data_expression &e)
Function for projecting out argument. arg3 from an application.
const data_expression & right(const data_expression &e)
Function for projecting out argument. right from an application.
function_symbol false_function(const sort_expression &s)
Constructor for function symbol @false_.
void make_constructor(data_expression &result, const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol @set.
const core::identifier_string & set_fset_name()
Generate identifier @setfset.
const core::identifier_string & union_name()
Generate identifier +.
bool is_complement_function_symbol(const atermpp::aterm &e)
Recogniser for function !.
function_symbol in(const sort_expression &, const sort_expression &s0, const sort_expression &s1)
function_symbol union_(const sort_expression &s, const sort_expression &s0, const sort_expression &s1)
bool is_constructor_function_symbol(const atermpp::aterm &e)
Recogniser for function @set.
function_symbol_vector set_generate_functions_code(const sort_expression &s)
Give all system defined mappings for set_.
function_symbol_vector set_mCRL2_usable_constructors(const sort_expression &s)
Give all defined constructors which can be used in mCRL2 specs for set_.
const core::identifier_string & difference_name()
Generate identifier -.
void make_set_comprehension(data_expression &result, const sort_expression &s, const data_expression &arg0)
Make an application of function symbol @setcomp.
void make_not_function(data_expression &result, const sort_expression &s, const data_expression &arg0)
Make an application of function symbol @not_.
bool is_or_function_application(const atermpp::aterm &e)
Recogniser for application of @or_.
const core::identifier_string & true_function_name()
Generate identifier @true_.
void make_false_function(data_expression &result, const sort_expression &s, const data_expression &arg0)
Make an application of function symbol @false_.
void make_true_function(data_expression &result, const sort_expression &s, const data_expression &arg0)
Make an application of function symbol @true_.
function_symbol difference(const sort_expression &s, const sort_expression &s0, const sort_expression &s1)
bool is_union_function_symbol(const atermpp::aterm &e)
Recogniser for function +.
function_symbol complement(const sort_expression &s)
Constructor for function symbol !.
bool is_true_function_application(const atermpp::aterm &e)
Recogniser for application of @true_.
function_symbol set_fset(const sort_expression &s)
Constructor for function symbol @setfset.
void make_difference(data_expression &result, const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol -.
void make_union_(data_expression &result, const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol +.
function_symbol set_comprehension(const sort_expression &s)
Constructor for function symbol @setcomp.
bool is_intersection_application(const atermpp::aterm &e)
Recogniser for application of *.
data_equation_vector set_generate_equations_code(const sort_expression &s)
Give all system defined equations for set_.
function_symbol_vector set_mCRL2_usable_mappings(const sort_expression &s)
Give all system defined mappings that can be used in mCRL2 specs for set_.
bool is_and_function_function_symbol(const atermpp::aterm &e)
Recogniser for function @and_.
void make_set_fset(data_expression &result, const sort_expression &s, const data_expression &arg0)
Make an application of function symbol @setfset.
bool is_intersection_function_symbol(const atermpp::aterm &e)
Recogniser for function *.
const data_expression & arg1(const data_expression &e)
Function for projecting out argument. arg1 from an application.
function_symbol less_equal(const sort_expression &s)
Constructor for function symbol <=.
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
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)
bool is_container_sort(const atermpp::aterm &x)
Returns true if the term t is a container sort.
bool is_function_symbol(const atermpp::aterm &x)
Returns true if the term t is a function symbol.
atermpp::term_list< variable > variable_list
\brief list of variables
function_symbol equal_to(const sort_expression &s)
Constructor for function symbol ==.
bool is_application(const atermpp::aterm &x)
Returns true if the term t is an application.
std::vector< function_symbol > function_symbol_vector
\brief vector of function_symbols
function_symbol if_(const sort_expression &s)
Constructor for function symbol if.
void make_application(atermpp::aterm &result)
Make function for an application.
data::sort_expression target_sort(const data::sort_expression &s)
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
Standard functions that are available for all sorts.