15#ifndef MCRL2_DATA_REAL64_H
16#define MCRL2_DATA_REAL64_H
48 const basic_sort&
real_()
58 bool is_real(
const sort_expression& e)
62 return basic_sort(e) ==
real_();
121 return atermpp::down_cast<function_symbol>(e) ==
creal();
132 application
creal(
const data_expression& arg0,
const data_expression&
arg1)
143 void make_creal(data_expression& result,
const data_expression& arg0,
const data_expression&
arg1)
185 return atermpp::down_cast<function_symbol>(e) ==
pos2real();
195 application
pos2real(
const data_expression& arg0)
205 void make_pos2real(data_expression& result,
const data_expression& arg0)
247 return atermpp::down_cast<function_symbol>(e) ==
nat2real();
257 application
nat2real(
const data_expression& arg0)
267 void make_nat2real(data_expression& result,
const data_expression& arg0)
309 return atermpp::down_cast<function_symbol>(e) ==
int2real();
319 application
int2real(
const data_expression& arg0)
329 void make_int2real(data_expression& result,
const data_expression& arg0)
371 return atermpp::down_cast<function_symbol>(e) ==
real2pos();
381 application
real2pos(
const data_expression& arg0)
391 void make_real2pos(data_expression& result,
const data_expression& arg0)
433 return atermpp::down_cast<function_symbol>(e) ==
real2nat();
443 application
real2nat(
const data_expression& arg0)
453 void make_real2nat(data_expression& result,
const data_expression& arg0)
495 return atermpp::down_cast<function_symbol>(e) ==
real2int();
505 application
real2int(
const data_expression& arg0)
515 void make_real2int(data_expression& result,
const data_expression& arg0)
586 throw mcrl2::runtime_error(
"Cannot compute target sort for maximum with domain sorts " +
pp(s0) +
", " +
pp(s1) +
". ");
602 return f.name() ==
maximum_name() && atermpp::down_cast<function_sort>(f.sort()).domain().
size() == 2 && (f ==
maximum(
real_(),
real_()) || f ==
maximum(
sort_pos::pos(),
sort_int::int_()) || f ==
maximum(
sort_int::int_(),
sort_pos::pos()) || f ==
maximum(
sort_nat::nat(),
sort_int::int_()) || f ==
maximum(
sort_int::int_(),
sort_nat::nat()) || f ==
maximum(
sort_int::int_(),
sort_int::int_()) || f ==
maximum(
sort_pos::pos(),
sort_nat::nat()) || f ==
maximum(
sort_nat::nat(),
sort_pos::pos()) || f ==
maximum(
sort_nat::nat(),
sort_nat::nat()) || f ==
maximum(
sort_pos::pos(),
sort_pos::pos()));
613 application
maximum(
const data_expression& arg0,
const data_expression&
arg1)
624 void make_maximum(data_expression& result,
const data_expression& arg0,
const data_expression&
arg1)
671 throw mcrl2::runtime_error(
"Cannot compute target sort for minimum with domain sorts " +
pp(s0) +
", " +
pp(s1) +
". ");
698 application
minimum(
const data_expression& arg0,
const data_expression&
arg1)
709 void make_minimum(data_expression& result,
const data_expression& arg0,
const data_expression&
arg1)
774 application
abs(
const data_expression& arg0)
784 void make_abs(data_expression& result,
const data_expression& arg0)
857 application
negate(
const data_expression& arg0)
867 void make_negate(data_expression& result,
const data_expression& arg0)
940 application
succ(
const data_expression& arg0)
950 void make_succ(data_expression& result,
const data_expression& arg0)
1023 application
pred(
const data_expression& arg0)
1033 void make_pred(data_expression& result,
const data_expression& arg0)
1088 throw mcrl2::runtime_error(
"Cannot compute target sort for plus with domain sorts " +
pp(s0) +
", " +
pp(s1) +
". ");
1115 application
plus(
const data_expression& arg0,
const data_expression&
arg1)
1126 void make_plus(data_expression& result,
const data_expression& arg0,
const data_expression&
arg1)
1173 throw mcrl2::runtime_error(
"Cannot compute target sort for minus with domain sorts " +
pp(s0) +
", " +
pp(s1) +
". ");
1200 application
minus(
const data_expression& arg0,
const data_expression&
arg1)
1211 void make_minus(data_expression& result,
const data_expression& arg0,
const data_expression&
arg1)
1258 throw mcrl2::runtime_error(
"Cannot compute target sort for times with domain sorts " +
pp(s0) +
", " +
pp(s1) +
". ");
1285 application
times(
const data_expression& arg0,
const data_expression&
arg1)
1296 void make_times(data_expression& result,
const data_expression& arg0,
const data_expression&
arg1)
1343 throw mcrl2::runtime_error(
"Cannot compute target sort for exp with domain sorts " +
pp(s0) +
", " +
pp(s1) +
". ");
1370 application
exp(
const data_expression& arg0,
const data_expression&
arg1)
1381 void make_exp(data_expression& result,
const data_expression& arg0,
const data_expression&
arg1)
1434 application
divides(
const data_expression& arg0,
const data_expression&
arg1)
1445 void make_divides(data_expression& result,
const data_expression& arg0,
const data_expression&
arg1)
1487 return atermpp::down_cast<function_symbol>(e) ==
floor();
1497 application
floor(
const data_expression& arg0)
1507 void make_floor(data_expression& result,
const data_expression& arg0)
1549 return atermpp::down_cast<function_symbol>(e) ==
ceil();
1559 application
ceil(
const data_expression& arg0)
1569 void make_ceil(data_expression& result,
const data_expression& arg0)
1611 return atermpp::down_cast<function_symbol>(e) ==
round();
1621 application
round(
const data_expression& arg0)
1631 void make_round(data_expression& result,
const data_expression& arg0)
1883 result.push_back(f);
1941 const data_expression&
left(
const data_expression& e)
1944 return atermpp::down_cast<application>(e)[0];
1953 const data_expression&
right(
const data_expression& e)
1956 return atermpp::down_cast<application>(e)[1];
1965 const data_expression&
arg(
const data_expression& e)
1968 return atermpp::down_cast<application>(e)[0];
1977 const data_expression&
arg1(
const data_expression& e)
1980 return atermpp::down_cast<application>(e)[0];
1989 const data_expression&
arg2(
const data_expression& e)
1992 return atermpp::down_cast<application>(e)[1];
2001 const data_expression&
arg3(
const data_expression& e)
2004 return atermpp::down_cast<application>(e)[2];
2018 variable vr(
"r",
real_());
2019 variable vs(
"s",
real_());
2022 result.push_back(data_equation(
variable_list({vp, vq, vx, vy}),
equal_to(
creal(vx, vp),
creal(vy, vq)),
equal_to(
times(vx,
sort_int::cint(
sort_nat::pos2nat(vq))),
times(vy,
sort_int::cint(
sort_nat::pos2nat(vp))))));
2023 result.push_back(data_equation(
variable_list({vp, vq, vx, vy}),
less(
creal(vx, vp),
creal(vy, vq)),
less(
times(vx,
sort_int::cint(
sort_nat::pos2nat(vq))),
times(vy,
sort_int::cint(
sort_nat::pos2nat(vp))))));
2024 result.push_back(data_equation(
variable_list({vp, vq, vx, vy}),
less_equal(
creal(vx, vp),
creal(vy, vq)),
less_equal(
times(vx,
sort_int::cint(
sort_nat::pos2nat(vq))),
times(vy,
sort_int::cint(
sort_nat::pos2nat(vp))))));
2037 result.push_back(data_equation(
variable_list({vp, vq, vx, vy}),
plus(
creal(vx, vp),
creal(vy, vq)),
reduce_fraction(
plus(
times(vx,
sort_int::cint(
sort_nat::pos2nat(vq))),
times(vy,
sort_int::cint(
sort_nat::pos2nat(vp)))),
sort_int::cint(
sort_nat::pos2nat(
times(vp, vq))))));
2038 result.push_back(data_equation(
variable_list({vp, vq, vx, vy}),
minus(
creal(vx, vp),
creal(vy, vq)),
reduce_fraction(
minus(
times(vx,
sort_int::cint(
sort_nat::pos2nat(vq))),
times(vy,
sort_int::cint(
sort_nat::pos2nat(vp)))),
sort_int::cint(
sort_nat::pos2nat(
times(vp, vq))))));
2039 result.push_back(data_equation(
variable_list({vp, vq, vx, vy}),
times(
creal(vx, vp),
creal(vy, vq)),
reduce_fraction(
times(vx, vy),
sort_int::cint(
sort_nat::pos2nat(
times(vp, vq))))));
2042 result.push_back(data_equation(
variable_list({vp, vq, vx, vy}),
not_equal_to(vy,
sort_int::cint(
sort_nat::c0())),
divides(
creal(vx, vp),
creal(vy, vq)),
reduce_fraction(
times(vx,
sort_int::cint(
sort_nat::pos2nat(vq))),
times(vy,
sort_int::cint(
sort_nat::pos2nat(vp))))));
2047 result.push_back(data_equation(
variable_list({vp, vq, vx}),
not_equal_to(vx,
sort_int::cint(
sort_nat::c0())),
exp(
creal(vx, vp),
sort_int::cneg(vq)),
reduce_fraction(
sort_int::cint(
sort_nat::pos2nat(
exp(vp,
sort_nat::pos2nat(vq)))),
exp(vx,
sort_nat::pos2nat(vq)))));
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 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 function_symbol & int2nat()
Constructor for function symbol Int2Nat.
const function_symbol & cneg()
Constructor for function symbol @cNeg.
const function_symbol & int2pos()
Constructor for function symbol Int2Pos.
const function_symbol & cint()
Constructor for function symbol @cInt.
function_symbol mod(const sort_expression &s0, const sort_expression &s1)
function_symbol div(const sort_expression &s0, const sort_expression &s1)
const basic_sort & int_()
Constructor for sort expression Int.
function_symbol head(const sort_expression &s)
Constructor for function symbol head.
const function_symbol & c0()
Constructor for function symbol @c0.
const basic_sort & nat()
Constructor for sort expression Nat.
const function_symbol & not_equals_zero()
Constructor for function symbol @not_equals_zero.
const function_symbol & nat2pos()
Constructor for function symbol Nat2Pos.
const function_symbol & equals_zero()
Constructor for function symbol @equals_zero.
const function_symbol & pos2nat()
Constructor for function symbol Pos2Nat.
const function_symbol & c1()
Constructor for function symbol @c1.
const basic_sort & pos()
Constructor for sort expression Pos.
function_symbol minimum(const sort_expression &s0, const sort_expression &s1)
void make_abs(data_expression &result, const data_expression &arg0)
Make an application of function symbol abs.
function_symbol plus(const sort_expression &s0, const sort_expression &s1)
bool is_real2int_function_symbol(const atermpp::aterm &e)
Recogniser for function Real2Int.
void make_minus(data_expression &result, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol -.
const function_symbol & creal()
Constructor for function symbol @cReal.
void make_reduce_fraction(data_expression &result, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol @redfrac.
const core::identifier_string & maximum_name()
Generate identifier max.
void make_negate(data_expression &result, const data_expression &arg0)
Make an application of function symbol -.
const core::identifier_string & minus_name()
Generate identifier -.
bool is_succ_function_symbol(const atermpp::aterm &e)
Recogniser for function succ.
const core::identifier_string & real_name()
const function_symbol & pos2real()
Constructor for function symbol Pos2Real.
const core::identifier_string & reduce_fraction_where_name()
Generate identifier @redfracwhr.
const function_symbol & round()
Constructor for function symbol round.
bool is_plus_function_symbol(const atermpp::aterm &e)
Recogniser for function +.
function_symbol times(const sort_expression &s0, const sort_expression &s1)
bool is_abs_application(const atermpp::aterm &e)
Recogniser for application of abs.
function_symbol divides(const sort_expression &s0, const sort_expression &s1)
const core::identifier_string & int2real_name()
Generate identifier Int2Real.
const function_symbol & real2nat()
Constructor for function symbol Real2Nat.
bool is_divides_function_symbol(const atermpp::aterm &e)
Recogniser for function /.
const core::identifier_string & creal_name()
Generate identifier @cReal.
void make_succ(data_expression &result, const data_expression &arg0)
Make an application of function symbol succ.
bool is_exp_application(const atermpp::aterm &e)
Recogniser for application of exp.
const data_expression & arg(const data_expression &e)
Function for projecting out argument. arg from an application.
bool is_int2real_application(const atermpp::aterm &e)
Recogniser for application of Int2Real.
const function_symbol & ceil()
Constructor for function symbol ceil.
const data_expression & arg2(const data_expression &e)
Function for projecting out argument. arg2 from an application.
bool is_plus_application(const atermpp::aterm &e)
Recogniser for application of +.
bool is_divides_application(const atermpp::aterm &e)
Recogniser for application of /.
bool is_reduce_fraction_function_symbol(const atermpp::aterm &e)
Recogniser for function @redfrac.
bool is_maximum_function_symbol(const atermpp::aterm &e)
Recogniser for function max.
void make_exp(data_expression &result, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol exp.
const core::identifier_string & divides_name()
Generate identifier /.
bool is_real2int_application(const atermpp::aterm &e)
Recogniser for application of Real2Int.
const core::identifier_string & ceil_name()
Generate identifier ceil.
bool is_creal_function_symbol(const atermpp::aterm &e)
Recogniser for function @cReal.
void make_real2nat(data_expression &result, const data_expression &arg0)
Make an application of function symbol Real2Nat.
bool is_minus_function_symbol(const atermpp::aterm &e)
Recogniser for function -.
bool is_reduce_fraction_where_application(const atermpp::aterm &e)
Recogniser for application of @redfracwhr.
function_symbol succ(const sort_expression &s0)
bool is_floor_function_symbol(const atermpp::aterm &e)
Recogniser for function floor.
void make_int2real(data_expression &result, const data_expression &arg0)
Make an application of function symbol Int2Real.
void make_divides(data_expression &result, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol /.
const core::identifier_string & floor_name()
Generate identifier floor.
const core::identifier_string & times_name()
Generate identifier *.
bool is_abs_function_symbol(const atermpp::aterm &e)
Recogniser for function abs.
bool is_ceil_application(const atermpp::aterm &e)
Recogniser for application of ceil.
const function_symbol & real2int()
Constructor for function symbol Real2Int.
bool is_maximum_application(const atermpp::aterm &e)
Recogniser for application of max.
const function_symbol & reduce_fraction()
Constructor for function symbol @redfrac.
bool is_creal_application(const atermpp::aterm &e)
Recogniser for application of @cReal.
bool is_pred_application(const atermpp::aterm &e)
Recogniser for application of pred.
const core::identifier_string & negate_name()
Generate identifier -.
void make_reduce_fraction_helper(data_expression &result, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol @redfrachlp.
void make_pos2real(data_expression &result, const data_expression &arg0)
Make an application of function symbol Pos2Real.
function_symbol pred(const sort_expression &s0)
bool is_round_function_symbol(const atermpp::aterm &e)
Recogniser for function round.
const core::identifier_string & succ_name()
Generate identifier succ.
const function_symbol & reduce_fraction_helper()
Constructor for function symbol @redfrachlp.
const core::identifier_string & abs_name()
Generate identifier abs.
data_equation_vector real_generate_equations_code()
Give all system defined equations for real_.
bool is_times_function_symbol(const atermpp::aterm &e)
Recogniser for function *.
const core::identifier_string & round_name()
Generate identifier round.
bool is_negate_function_symbol(const atermpp::aterm &e)
Recogniser for function -.
function_symbol minus(const sort_expression &s0, const sort_expression &s1)
const basic_sort & real_()
Constructor for sort expression Real.
bool is_minimum_function_symbol(const atermpp::aterm &e)
Recogniser for function min.
const function_symbol & floor()
Constructor for function symbol floor.
void make_minimum(data_expression &result, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol min.
void make_times(data_expression &result, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol *.
const core::identifier_string & reduce_fraction_helper_name()
Generate identifier @redfrachlp.
function_symbol_vector real_mCRL2_usable_constructors()
Give all defined constructors which can be used in mCRL2 specs for real_.
bool is_real2pos_function_symbol(const atermpp::aterm &e)
Recogniser for function Real2Pos.
void make_real2int(data_expression &result, const data_expression &arg0)
Make an application of function symbol Real2Int.
function_symbol_vector real_generate_constructors_code()
Give all system defined constructors for real_.
void make_nat2real(data_expression &result, const data_expression &arg0)
Make an application of function symbol Nat2Real.
void make_maximum(data_expression &result, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol max.
bool is_floor_application(const atermpp::aterm &e)
Recogniser for application of floor.
bool is_real(const sort_expression &e)
Recogniser for sort expression Real.
const function_symbol & reduce_fraction_where()
Constructor for function symbol @redfracwhr.
implementation_map real_cpp_implementable_mappings()
Give all system defined mappings that are to be implemented in C++ code for real_.
bool is_ceil_function_symbol(const atermpp::aterm &e)
Recogniser for function ceil.
const core::identifier_string & pred_name()
Generate identifier pred.
const function_symbol & nat2real()
Constructor for function symbol Nat2Real.
const core::identifier_string & minimum_name()
Generate identifier min.
const data_expression & right(const data_expression &e)
Function for projecting out argument. right from an application.
bool is_succ_application(const atermpp::aterm &e)
Recogniser for application of succ.
void make_round(data_expression &result, const data_expression &arg0)
Make an application of function symbol round.
bool is_pos2real_function_symbol(const atermpp::aterm &e)
Recogniser for function Pos2Real.
function_symbol_vector real_mCRL2_usable_mappings()
Give all system defined mappings that can be used in mCRL2 specs for real_.
const data_expression & arg1(const data_expression &e)
Function for projecting out argument. arg1 from an application.
const core::identifier_string & plus_name()
Generate identifier +.
function_symbol abs(const sort_expression &s0)
const data_expression & left(const data_expression &e)
Function for projecting out argument. left from an application.
bool is_times_application(const atermpp::aterm &e)
Recogniser for application of *.
void make_ceil(data_expression &result, const data_expression &arg0)
Make an application of function symbol ceil.
const core::identifier_string & reduce_fraction_name()
Generate identifier @redfrac.
function_symbol negate(const sort_expression &s0)
bool is_real2pos_application(const atermpp::aterm &e)
Recogniser for application of Real2Pos.
bool is_reduce_fraction_application(const atermpp::aterm &e)
Recogniser for application of @redfrac.
bool is_int2real_function_symbol(const atermpp::aterm &e)
Recogniser for function Int2Real.
bool is_negate_application(const atermpp::aterm &e)
Recogniser for application of -.
std::map< function_symbol, std::pair< std::function< void(data_expression &, const data_expression &)>, std::string > > implementation_map
bool is_reduce_fraction_helper_function_symbol(const atermpp::aterm &e)
Recogniser for function @redfrachlp.
bool is_minimum_application(const atermpp::aterm &e)
Recogniser for application of min.
bool is_minus_application(const atermpp::aterm &e)
Recogniser for application of -.
const core::identifier_string & pos2real_name()
Generate identifier Pos2Real.
bool is_round_application(const atermpp::aterm &e)
Recogniser for application of round.
const data_expression & arg3(const data_expression &e)
Function for projecting out argument. arg3 from an application.
const core::identifier_string & exp_name()
Generate identifier exp.
bool is_real2nat_function_symbol(const atermpp::aterm &e)
Recogniser for function Real2Nat.
const core::identifier_string & real2nat_name()
Generate identifier Real2Nat.
const core::identifier_string & real2int_name()
Generate identifier Real2Int.
const function_symbol & int2real()
Constructor for function symbol Int2Real.
bool is_pred_function_symbol(const atermpp::aterm &e)
Recogniser for function pred.
const core::identifier_string & nat2real_name()
Generate identifier Nat2Real.
function_symbol exp(const sort_expression &s0, const sort_expression &s1)
void make_pred(data_expression &result, const data_expression &arg0)
Make an application of function symbol pred.
bool is_real2nat_application(const atermpp::aterm &e)
Recogniser for application of Real2Nat.
bool is_pos2real_application(const atermpp::aterm &e)
Recogniser for application of Pos2Real.
void make_plus(data_expression &result, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol +.
bool is_reduce_fraction_helper_application(const atermpp::aterm &e)
Recogniser for application of @redfrachlp.
void make_floor(data_expression &result, const data_expression &arg0)
Make an application of function symbol floor.
const function_symbol & real2pos()
Constructor for function symbol Real2Pos.
implementation_map real_cpp_implementable_constructors()
Give all system defined constructors which have an implementation in C++ and not in rewrite rules for...
function_symbol maximum(const sort_expression &s0, const sort_expression &s1)
function_symbol_vector real_generate_functions_code()
Give all system defined mappings for real_.
void make_reduce_fraction_where(data_expression &result, const data_expression &arg0, const data_expression &arg1, const data_expression &arg2)
Make an application of function symbol @redfracwhr.
function_symbol_vector real_generate_constructors_and_functions_code()
Give all system defined mappings and constructors for real_.
const core::identifier_string & real2pos_name()
Generate identifier Real2Pos.
void make_real2pos(data_expression &result, const data_expression &arg0)
Make an application of function symbol Real2Pos.
bool is_exp_function_symbol(const atermpp::aterm &e)
Recogniser for function exp.
void make_creal(data_expression &result, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol @cReal.
bool is_reduce_fraction_where_function_symbol(const atermpp::aterm &e)
Recogniser for function @redfracwhr.
bool is_nat2real_function_symbol(const atermpp::aterm &e)
Recogniser for function Nat2Real.
bool is_nat2real_application(const atermpp::aterm &e)
Recogniser for application of Nat2Real.
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_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.
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.