15#ifndef MCRL2_DATA_POS64_H
16#define MCRL2_DATA_POS64_H
46 const basic_sort&
pos()
56 bool is_pos(
const sort_expression& e)
60 return basic_sort(e) ==
pos();
93 return atermpp::down_cast<function_symbol>(e) ==
c1();
125 return atermpp::down_cast<function_symbol>(e) ==
succpos();
182 typedef std::map<function_symbol,std::pair<std::function<void(data_expression&,
const data_expression&)>, std::string> >
implementation_map;
281 return atermpp::down_cast<function_symbol>(e) ==
concat_digit();
345 return atermpp::down_cast<function_symbol>(e) ==
equals_one();
393 const function_symbol&
maximum()
407 return atermpp::down_cast<function_symbol>(e) ==
maximum();
418 application
maximum(
const data_expression& arg0,
const data_expression&
arg1)
429 void make_maximum(data_expression& result,
const data_expression& arg0,
const data_expression&
arg1)
471 return atermpp::down_cast<function_symbol>(e) ==
minimum();
482 application
minimum(
const data_expression& arg0,
const data_expression&
arg1)
493 void make_minimum(data_expression& result,
const data_expression& arg0,
const data_expression&
arg1)
535 return atermpp::down_cast<function_symbol>(e) ==
succ();
545 application
succ(
const data_expression& arg0)
555 void make_succ(data_expression& result,
const data_expression& arg0)
659 return atermpp::down_cast<function_symbol>(e) ==
plus();
670 application
plus(
const data_expression& arg0,
const data_expression&
arg1)
681 void make_plus(data_expression& result,
const data_expression& arg0,
const data_expression&
arg1)
723 return atermpp::down_cast<function_symbol>(e) ==
add_with_carry();
837 const function_symbol&
times()
851 return atermpp::down_cast<function_symbol>(e) ==
times();
862 application
times(
const data_expression& arg0,
const data_expression&
arg1)
873 void make_times(data_expression& result,
const data_expression& arg0,
const data_expression&
arg1)
915 return atermpp::down_cast<function_symbol>(e) ==
times_overflow();
981 return atermpp::down_cast<function_symbol>(e) ==
times_ordered();
1112 result.push_back(f);
1157 const data_expression&
arg(
const data_expression& e)
1160 return atermpp::down_cast<application>(e)[0];
1169 const data_expression&
arg1(
const data_expression& e)
1172 return atermpp::down_cast<application>(e)[0];
1181 const data_expression&
arg2(
const data_expression& e)
1184 return atermpp::down_cast<application>(e)[1];
1193 const data_expression&
left(
const data_expression& e)
1196 return atermpp::down_cast<application>(e)[0];
1205 const data_expression&
right(
const data_expression& e)
1208 return atermpp::down_cast<application>(e)[1];
1217 const data_expression&
arg3(
const data_expression& e)
1220 return atermpp::down_cast<application>(e)[2];
1229 variable vp(
"p",
pos());
1230 variable vp1(
"p1",
pos());
1231 variable vp2(
"p2",
pos());
1247 result.push_back(data_equation(
variable_list({vp1, vp2, vw1, vw2}),
equal_to(
concat_digit(vp1, vw1),
concat_digit(vp2, vw2)),
sort_bool::and_(
sort_machine_word::equal_word(vw1, vw2),
equal_to(vp1, vp2))));
1253 result.push_back(data_equation(
variable_list({vp1, vp2, vw1, vw2}),
less(
concat_digit(vp1, vw1),
concat_digit(vp2, vw2)),
if_(
sort_machine_word::less_word(vw1, vw2),
less_equal(vp1, vp2),
less(vp1, vp2))));
1260 result.push_back(data_equation(
variable_list({vp1, vp2, vw1, vw2}),
less_equal(
concat_digit(vp1, vw1),
concat_digit(vp2, vw2)),
if_(
sort_machine_word::less_equal_word(vw1, vw2),
less_equal(vp1, vp2),
less(vp1, vp2))));
1267 result.push_back(data_equation(
variable_list({vp, vw1}),
pos_predecessor(
concat_digit(vp, vw1)),
if_(
sort_machine_word::equals_zero_word(vw1),
if_(
equals_one(vp),
most_significant_digit(
sort_machine_word::max_word()),
concat_digit(
pos_predecessor(vp),
sort_machine_word::max_word())),
concat_digit(vp,
sort_machine_word::pred_word(vw1)))));
1269 result.push_back(data_equation(
variable_list({vw1, vw2}),
plus(
most_significant_digit(vw1),
most_significant_digit(vw2)),
if_(
sort_machine_word::add_overflow_word(vw1, vw2),
concat_digit(
most_significant_digit(
sort_machine_word::one_word()),
sort_machine_word::add_word(vw1, vw2)),
most_significant_digit(
sort_machine_word::add_word(vw1, vw2)))));
1270 result.push_back(data_equation(
variable_list({vw1, vw2}),
add_with_carry(
most_significant_digit(vw1),
most_significant_digit(vw2)),
if_(
sort_machine_word::add_with_carry_overflow_word(vw1, vw2),
concat_digit(
most_significant_digit(
sort_machine_word::one_word()),
sort_machine_word::add_with_carry_word(vw1, vw2)),
most_significant_digit(
sort_machine_word::add_with_carry_word(vw1, vw2)))));
1271 result.push_back(data_equation(
variable_list({vp1, vw1, vw2}),
plus(
concat_digit(vp1, vw1),
most_significant_digit(vw2)),
if_(
sort_machine_word::add_overflow_word(vw1, vw2),
concat_digit(
succpos(vp1),
sort_machine_word::add_word(vw1, vw2)),
concat_digit(vp1,
sort_machine_word::add_word(vw1, vw2)))));
1272 result.push_back(data_equation(
variable_list({vp1, vw1, vw2}),
add_with_carry(
concat_digit(vp1, vw1),
most_significant_digit(vw2)),
if_(
sort_machine_word::add_with_carry_overflow_word(vw1, vw2),
concat_digit(
succpos(vp1),
sort_machine_word::add_with_carry_word(vw1, vw2)),
concat_digit(vp1,
sort_machine_word::add_with_carry_word(vw1, vw2)))));
1273 result.push_back(data_equation(
variable_list({vp2, vw1, vw2}),
plus(
most_significant_digit(vw1),
concat_digit(vp2, vw2)),
if_(
sort_machine_word::add_overflow_word(vw1, vw2),
concat_digit(
succpos(vp2),
sort_machine_word::add_word(vw1, vw2)),
concat_digit(vp2,
sort_machine_word::add_word(vw1, vw2)))));
1274 result.push_back(data_equation(
variable_list({vp2, vw1, vw2}),
add_with_carry(
most_significant_digit(vw1),
concat_digit(vp2, vw2)),
if_(
sort_machine_word::add_with_carry_overflow_word(vw1, vw2),
concat_digit(
succpos(vp2),
sort_machine_word::add_with_carry_word(vw1, vw2)),
concat_digit(vp2,
sort_machine_word::add_with_carry_word(vw1, vw2)))));
1275 result.push_back(data_equation(
variable_list({vp1, vp2, vw1, vw2}),
plus(
concat_digit(vp1, vw1),
concat_digit(vp2, vw2)),
if_(
sort_machine_word::add_overflow_word(vw1, vw2),
concat_digit(
add_with_carry(vp1, vp2),
sort_machine_word::add_word(vw1, vw2)),
concat_digit(
plus(vp1, vp2),
sort_machine_word::add_word(vw1, vw2)))));
1276 result.push_back(data_equation(
variable_list({vp1, vp2, vw1, vw2}),
add_with_carry(
concat_digit(vp1, vw1),
concat_digit(vp2, vw2)),
if_(
sort_machine_word::add_with_carry_overflow_word(vw1, vw2),
concat_digit(
add_with_carry(vp1, vp2),
sort_machine_word::add_with_carry_word(vw1, vw2)),
concat_digit(
plus(vp1, vp2),
sort_machine_word::add_with_carry_word(vw1, vw2)))));
1281 result.push_back(data_equation(
variable_list({vp2, vw1, vw2}),
times(
most_significant_digit(vw1),
concat_digit(vp2, vw2)),
concat_digit(
times_overflow(vp2, vw1,
sort_machine_word::times_overflow_word(vw1, vw2)),
sort_machine_word::times_word(vw1, vw2))));
1282 result.push_back(data_equation(
variable_list({vp1, vw1, vw2}),
times(
concat_digit(vp1, vw1),
most_significant_digit(vw2)),
concat_digit(
times_overflow(vp1, vw2,
sort_machine_word::times_overflow_word(vw1, vw2)),
sort_machine_word::times_word(vw1, vw2))));
1283 result.push_back(data_equation(
variable_list({vp1, vp2, vw1, vw2}),
times(
concat_digit(vp1, vw1),
concat_digit(vp2, vw2)),
if_(
less(vp1, vp2),
times_ordered(
concat_digit(vp1, vw1),
concat_digit(vp2, vw2)),
times_ordered(
concat_digit(vp2, vw2),
concat_digit(vp1, vw1)))));
1284 result.push_back(data_equation(
variable_list({vp2, vw1, vw2}),
times_ordered(
most_significant_digit(vw1),
concat_digit(vp2, vw2)),
concat_digit(
times_overflow(vp2, vw1,
sort_machine_word::times_overflow_word(vw1, vw2)),
sort_machine_word::times_word(vw1, vw2))));
1285 result.push_back(data_equation(
variable_list({vp1, vp2, vw1}),
times_ordered(
concat_digit(vp1, vw1), vp2),
plus(
concat_digit(
times_ordered(vp1, vp2),
sort_machine_word::zero_word()),
times_overflow(vp2, vw1,
sort_machine_word::zero_word()))));
1287 result.push_back(data_equation(
variable_list({voverflow, vw1, vw2}),
times_overflow(
most_significant_digit(vw1), vw2, voverflow),
times_whr_mult_overflow(
sort_machine_word::times_with_carry_word(vw1, vw2, voverflow),
sort_machine_word::times_with_carry_overflow_word(vw1, vw2, voverflow))));
1288 result.push_back(data_equation(
variable_list({voverflow, vp1, vw1, vw2}),
times_overflow(
concat_digit(vp1, vw1), vw2, voverflow),
concat_digit(
times_overflow(vp1, vw2,
sort_machine_word::times_with_carry_overflow_word(vw1, vw2, voverflow)),
sort_machine_word::times_with_carry_word(vw1, vw2, voverflow))));
Term containing a string.
An application of a data expression to a number of arguments.
The class function symbol.
Exception classes for use in libraries and tools.
The standard sort machine_word.
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 head(const sort_expression &s)
Constructor for function symbol head.
const function_symbol & add_word()
Constructor for function symbol @add_word.
const function_symbol & pred_word()
Constructor for function symbol @pred_word.
const function_symbol & equals_max_word()
Constructor for function symbol @equals_max_word.
const function_symbol & equals_one_word()
Constructor for function symbol @equals_one_word.
const function_symbol & succ_word()
Constructor for function symbol @succ_word.
const function_symbol & less_word()
Constructor for function symbol @less.
const basic_sort & machine_word()
Constructor for sort expression @word.
const function_symbol & add_with_carry_word()
Constructor for function symbol @add_with_carry_word.
const function_symbol & equals_zero_word()
Constructor for function symbol @equals_zero_word.
const function_symbol & one_word()
Constructor for function symbol @one_word.
const function_symbol & max_word()
Constructor for function symbol @max_word.
const function_symbol & add_with_carry_overflow_word()
Constructor for function symbol @add_with_carry_overflow_word.
const function_symbol & times_with_carry_word()
Constructor for function symbol @times_with_carry_word.
const function_symbol & times_with_carry_overflow_word()
Constructor for function symbol @times_with_carry_overflow_word.
const function_symbol & times_overflow_word()
Constructor for function symbol @times_overflow_word.
const function_symbol & zero_word()
Constructor for function symbol @zero_word.
const function_symbol & equal_word()
Constructor for function symbol @equal.
const function_symbol & less_equal_word()
Constructor for function symbol @less_equal.
const function_symbol & times_word()
Constructor for function symbol @times_word.
const function_symbol & two_word()
Constructor for function symbol @two_word.
const function_symbol & add_overflow_word()
Constructor for function symbol @add_overflow_word.
const core::identifier_string & equals_one_name()
Generate identifier @equals_one.
bool is_pos_predecessor_function_symbol(const atermpp::aterm &e)
Recogniser for function @pospred.
const core::identifier_string & concat_digit_name()
Generate identifier @concat_digit.
bool is_add_with_carry_function_symbol(const atermpp::aterm &e)
Recogniser for function @addc.
void make_equals_one(data_expression &result, const data_expression &arg0)
Make an application of function symbol @equals_one.
const function_symbol & times_overflow()
Constructor for function symbol @times_overflow.
bool is_auxiliary_plus_pos_application(const atermpp::aterm &e)
Recogniser for application of @plus_pos.
const function_symbol & equals_one()
Constructor for function symbol @equals_one.
const data_expression & arg(const data_expression &e)
Function for projecting out argument. arg from an application.
void make_most_significant_digit(data_expression &result, const data_expression &arg0)
Make an application of function symbol @most_significant_digit.
void make_add_with_carry(data_expression &result, const data_expression &arg0, const data_expression &arg1, const data_expression &arg2)
Make an application of function symbol @addc.
void make_times(data_expression &result, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol *.
const function_symbol & times_ordered()
Constructor for function symbol @times_ordered.
bool is_times_overflow_function_symbol(const atermpp::aterm &e)
Recogniser for function @times_overflow.
bool is_maximum_function_symbol(const atermpp::aterm &e)
Recogniser for function max.
const core::identifier_string & times_whr_mult_overflow_name()
Generate identifier @times_whr_mult_overflow.
bool is_times_ordered_function_symbol(const atermpp::aterm &e)
Recogniser for function @times_ordered.
implementation_map pos_cpp_implementable_mappings()
Give all system defined mappings that are to be implemented in C++ code for pos.
void make_auxiliary_plus_pos(data_expression &result, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol @plus_pos.
void make_maximum(data_expression &result, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol max.
bool is_pos(const sort_expression &e)
Recogniser for sort expression Pos.
bool is_times_ordered_application(const atermpp::aterm &e)
Recogniser for application of @times_ordered.
const data_expression & arg3(const data_expression &e)
Function for projecting out argument. arg3 from an application.
bool is_succpos_application(const atermpp::aterm &e)
Recogniser for application of @succ_pos.
const function_symbol & auxiliary_plus_pos()
Constructor for function symbol @plus_pos.
const function_symbol & c1()
Constructor for function symbol @c1.
void make_times_whr_mult_overflow(data_expression &result, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol @times_whr_mult_overflow.
void make_succ(data_expression &result, const data_expression &arg0)
Make an application of function symbol succ.
const function_symbol & add_with_carry()
Constructor for function symbol @addc.
const data_expression & arg1(const data_expression &e)
Function for projecting out argument. arg1 from an application.
bool is_times_whr_mult_overflow_function_symbol(const atermpp::aterm &e)
Recogniser for function @times_whr_mult_overflow.
const core::identifier_string & times_overflow_name()
Generate identifier @times_overflow.
void make_minimum(data_expression &result, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol min.
function_symbol_vector pos_generate_functions_code()
Give all system defined mappings for pos.
void make_times_overflow(data_expression &result, const data_expression &arg0, const data_expression &arg1, const data_expression &arg2)
Make an application of function symbol @times_overflow.
bool is_times_whr_mult_overflow_application(const atermpp::aterm &e)
Recogniser for application of @times_whr_mult_overflow.
const function_symbol & pos_predecessor()
Constructor for function symbol @pospred.
bool is_auxiliary_plus_pos_function_symbol(const atermpp::aterm &e)
Recogniser for function @plus_pos.
const core::identifier_string & c1_name()
Generate identifier @c1.
const function_symbol & plus()
Constructor for function symbol +.
bool is_add_with_carry_application(const atermpp::aterm &e)
Recogniser for application of @addc.
const function_symbol & maximum()
Constructor for function symbol max.
const core::identifier_string & times_name()
Generate identifier *.
bool is_most_significant_digit_function_symbol(const atermpp::aterm &e)
Recogniser for function @most_significant_digit.
function_symbol_vector pos_mCRL2_usable_constructors()
Give all defined constructors which can be used in mCRL2 specs for pos.
bool is_c1_function_symbol(const atermpp::aterm &e)
Recogniser for function @c1.
const data_expression & arg2(const data_expression &e)
Function for projecting out argument. arg2 from an application.
const core::identifier_string & plus_name()
Generate identifier +.
const function_symbol & succpos()
Constructor for function symbol @succ_pos.
bool is_minimum_function_symbol(const atermpp::aterm &e)
Recogniser for function min.
const core::identifier_string & times_ordered_name()
Generate identifier @times_ordered.
const function_symbol & times_whr_mult_overflow()
Constructor for function symbol @times_whr_mult_overflow.
const data_expression & right(const data_expression &e)
Function for projecting out argument. right from an application.
implementation_map pos_cpp_implementable_constructors()
Give all system defined constructors which have an implementation in C++ and not in rewrite rules for...
bool is_times_application(const atermpp::aterm &e)
Recogniser for application of *.
const function_symbol & concat_digit()
Constructor for function symbol @concat_digit.
bool is_most_significant_digit_application(const atermpp::aterm &e)
Recogniser for application of @most_significant_digit.
bool is_times_function_symbol(const atermpp::aterm &e)
Recogniser for function *.
void make_plus(data_expression &result, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol +.
const core::identifier_string & add_with_carry_name()
Generate identifier @addc.
void make_succpos(data_expression &result, const data_expression &arg0)
Make an application of function symbol @succ_pos.
const function_symbol & times()
Constructor for function symbol *.
bool is_succpos_function_symbol(const atermpp::aterm &e)
Recogniser for function @succ_pos.
bool is_succ_function_symbol(const atermpp::aterm &e)
Recogniser for function succ.
bool is_plus_function_symbol(const atermpp::aterm &e)
Recogniser for function +.
bool is_concat_digit_application(const atermpp::aterm &e)
Recogniser for application of @concat_digit.
const core::identifier_string & auxiliary_plus_pos_name()
Generate identifier @plus_pos.
bool is_times_overflow_application(const atermpp::aterm &e)
Recogniser for application of @times_overflow.
const core::identifier_string & minimum_name()
Generate identifier min.
bool is_minimum_application(const atermpp::aterm &e)
Recogniser for application of min.
data_equation_vector pos_generate_equations_code()
Give all system defined equations for pos.
const function_symbol & most_significant_digit()
Constructor for function symbol @most_significant_digit.
bool is_succ_application(const atermpp::aterm &e)
Recogniser for application of succ.
void make_times_ordered(data_expression &result, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol @times_ordered.
bool is_equals_one_application(const atermpp::aterm &e)
Recogniser for application of @equals_one.
const basic_sort & pos()
Constructor for sort expression Pos.
const core::identifier_string & maximum_name()
Generate identifier max.
const core::identifier_string & pos_name()
const function_symbol & minimum()
Constructor for function symbol min.
const data_expression & left(const data_expression &e)
Function for projecting out argument. left from an application.
function_symbol_vector pos_generate_constructors_and_functions_code()
Give all system defined mappings and constructors for pos.
function_symbol_vector pos_generate_constructors_code()
Give all system defined constructors for pos.
bool is_concat_digit_function_symbol(const atermpp::aterm &e)
Recogniser for function @concat_digit.
bool is_maximum_application(const atermpp::aterm &e)
Recogniser for application of max.
bool is_equals_one_function_symbol(const atermpp::aterm &e)
Recogniser for function @equals_one.
const core::identifier_string & succpos_name()
Generate identifier @succ_pos.
bool is_pos_predecessor_application(const atermpp::aterm &e)
Recogniser for application of @pospred.
std::map< function_symbol, std::pair< std::function< void(data_expression &, const data_expression &)>, std::string > > implementation_map
bool is_plus_application(const atermpp::aterm &e)
Recogniser for application of +.
const function_symbol & succ()
Constructor for function symbol succ.
const core::identifier_string & pos_predecessor_name()
Generate identifier @pospred.
void make_concat_digit(data_expression &result, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol @concat_digit.
function_symbol_vector pos_mCRL2_usable_mappings()
Give all system defined mappings that can be used in mCRL2 specs for pos.
const core::identifier_string & succ_name()
Generate identifier succ.
const core::identifier_string & most_significant_digit_name()
Generate identifier @most_significant_digit.
void make_pos_predecessor(data_expression &result, const data_expression &arg0)
Make an application of function symbol @pospred.
function_symbol less_equal(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.
bool is_function_symbol(const atermpp::aterm &x)
Returns true if the term t is a function symbol.
bool is_basic_sort(const atermpp::aterm &x)
Returns true if the term t is a basic sort.
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.
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.