12#ifndef MCRL2_DATA_PRINT_H
13#define MCRL2_DATA_PRINT_H
33#ifdef MCRL2_ENABLE_MACHINENUMBERS
53#ifndef MCRL2_ENABLE_MACHINENUMBERS
141#ifndef MCRL2_ENABLE_MACHINENUMBERS
385#ifndef MCRL2_ENABLE_MACHINENUMBERS
406 return core::detail::max_precedence;
424 return core::detail::max_precedence;
440 const auto& x_ = atermpp::down_cast<application>(x);
447template <
typename Derived>
455 using super::derived;
456 using super::print_expression;
457 using super::print_unary_operand;
458 using super::print_list;
506 data::detail::equal_symbol::is_symbol(name) ||
507 data::detail::not_equal_symbol::is_symbol(name) ||
508 data::detail::less_symbol::is_symbol(name) ||
509 data::detail::less_equal_symbol::is_symbol(name) ||
510 data::detail::greater_symbol::is_symbol(name) ||
511 data::detail::greater_equal_symbol::is_symbol(name) ||
543 return generator(prefix);
546 template <
typename Container>
548 int container_precedence = -1,
549 const std::string& separator =
", ",
550 const std::string& open_bracket =
"(",
551 const std::string& close_bracket =
")"
554 for (
auto i = container.begin(); i != container.end(); ++i)
556 if (i != container.begin())
558 derived().print(separator);
560 bool print_brackets = (container.size() > 1) && (
precedence(*i) < container_precedence);
563 derived().print(open_bracket);
568 derived().print(close_bracket);
573 template <
typename Variable>
579 derived().print(
": ");
580 derived().apply(x.sort());
586 template <
typename T>
593 template <
typename Container,
typename SortAccessor>
595 bool print_sorts =
true,
596 bool join_sorts =
true,
597 bool maximally_shared =
false,
598 const std::string& opener =
"(",
599 const std::string& closer =
")",
600 const std::string& separator =
", ",
604 auto first = container.
begin();
605 auto last = container.
end();
611 derived().print(opener);
613 if (maximally_shared)
615 typedef typename Container::value_type T;
618 std::map<sort_expression, std::vector<T> > sort_map;
622 std::vector<sort_expression> sorts;
624 for (
auto i = container.begin(); i != container.end(); ++i)
626 if (sort_map.find(i->sort()) == sort_map.end())
628 sorts.push_back(i->sort());
630 sort_map[i->sort()].push_back(*i);
634 for (
auto i = sorts.begin(); i != sorts.end(); ++i)
636 if (i != sorts.begin())
638 derived().print(separator);
640 const std::vector<T>& v = sort_map[*i];
641 print_list(v,
"",
"",
",");
642 derived().print(
": ");
648 while (first != last)
650 if (first != container.
begin())
652 derived().print(separator);
655 if (print_sorts && join_sorts)
665 while (i != last && i->
sort() == first->
sort());
667 for (
auto j = first; j != i; ++j)
671 derived().print(
",");
679 derived().print(
": ");
680 derived().apply(get_sort(*first));
688 derived().apply(*first);
693 derived().print(
": ");
694 derived().apply(get_sort(*first));
702 derived().print(closer);
705 template <
typename Container>
707 bool print_sorts =
true,
708 bool join_sorts =
true,
709 bool maximally_shared =
false,
710 const std::string& opener =
"(",
711 const std::string& closer =
")",
712 const std::string& separator =
", "
718 template <
typename Container>
720 bool print_lhs =
true,
721 const std::string& opener =
"",
722 const std::string& closer =
"",
723 const std::string& separator =
", ",
724 const std::string& assignment_symbol =
" = "
727 if (container.empty())
731 derived().print(opener);
732 for (
typename Container::iterator i = container.begin(); i != container.end(); ++i)
734 if (i != container.begin())
736 derived().print(separator);
740 derived().apply(i->lhs());
741 derived().print(assignment_symbol);
743 derived().apply(i->rhs());
745 derived().print(closer);
748 template <
typename T>
753 print_expression(x,
true);
754 derived().print(arrow);
758 template <
typename Container>
760 const std::string& opener =
"(",
761 const std::string& closer =
")",
762 const std::string& separator =
", "
765 if (container.empty())
769 derived().print(opener);
770 for (
auto i = container.begin(); i != container.end(); ++i)
772 if (i != container.begin())
774 derived().print(separator);
779 derived().print(
"(");
784 derived().print(
")");
787 derived().print(closer);
792 derived().print(
"[");
794 derived().print(
"]");
799 derived().print(
"{ ");
801 derived().print(
" }");
806 derived().print(
"{ ");
812 derived().print(
", ");
814 derived().apply(*i++);
815 derived().print(
": ");
816 derived().apply(*i++);
818 derived().print(
" }");
823 derived().print(
"{ ");
825 derived().print(
" | ");
826 derived().apply(x.
body());
827 derived().print(
" }");
927 derived().print(
"[");
929 derived().print(
"]");
940 derived().print(
"[");
942 derived().print(
"]");
953 derived().print(
"{");
955 derived().print(
"}");
964 derived().print(
"{:}");
968 derived().print(
"@bagfbag(");
969 derived().apply(
variable(y).name());
970 derived().print(
")");
988 derived().print(
"{ ");
990 derived().print(
" | ");
991 derived().apply(body);
992 derived().print(
" }");
1006 derived().print(
"{ ");
1008 derived().print(
" | ");
1009 derived().apply(body);
1010 derived().print(
" }");
1023 derived().print(
"{ ");
1025 derived().print(
" | ");
1026 derived().apply(body);
1027 derived().print(
" }");
1032 std::vector<std::pair<data_expression, data_expression> > arguments;
1042#ifdef MCRL2_ENABLE_MACHINENUMBERS
1055 print_list(arguments,
"{",
"}");
1060 derived().print(
"!");
1068 derived().print(
"{}");
1079 derived().print(
"{ ");
1081 derived().print(
" | ");
1082 derived().apply(left.body());
1083 derived().print(
" }");
1098 derived().print(
"!");
1104 const sort_expression& s = atermpp::down_cast<function_sort>(sort).domain().front();
1108 derived().print(
"{ ");
1110 derived().print(
" | ");
1111 derived().apply(body);
1112 derived().print(
" }");
1123 derived().print(op);
1132 derived().print(
"!");
1141 derived().print(
"{ ");
1143 derived().print(
" | ");
1144 derived().apply(body);
1145 derived().print(
" }");
1159 derived().print(
"{ ");
1161 derived().print(
" | ");
1162 derived().apply(body);
1163 derived().print(
" }");
1173 derived().print(
"{ ");
1175 derived().print(
" | ");
1176 derived().apply(body);
1177 derived().print(
" }");
1181 template <
typename Abstraction>
1185 derived().print(op +
" ");
1187 derived().print(
". ");
1188 derived().apply(x.body());
1221 derived().print(
" ");
1222 derived().apply(x.
head());
1223 derived().print(
" ");
1230 if (print_parentheses)
1232 derived().print(
"(");
1234 derived().apply(x.
head());
1235 if (print_parentheses)
1237 derived().print(
")");
1241 print_parentheses = !x.
empty();
1245 if (name ==
"!" || name ==
"#")
1247 print_parentheses =
precedence(*x.
begin()) < core::detail::max_precedence;
1250 if (print_parentheses)
1252 derived().print(
"(");
1255 if (print_parentheses)
1257 derived().print(
")");
1262 void apply(
const std::pair<data_expression, data_expression>& x)
1264 derived().apply(x.first);
1265 derived().print(
": ");
1266 derived().apply(x.second);
1299 derived().apply(x.
lhs());
1300 derived().print(
" = ");
1301 derived().apply(x.
rhs());
1309 print_list(x,
"",
"",
", ",
false);
1316 derived().apply(x.
name());
1317 print_list(x.
arguments(),
"(",
")",
", ");
1324 derived().apply(x.
lhs());
1325 derived().print(
"=");
1326 derived().apply(x.
rhs());
1371 derived().apply(x.
name());
1372 derived().print(
": ");
1374 derived().apply(x.
sort());
1381 derived().apply(x.
name());
1382 print_list(x.
arguments(),
"(",
")",
", ");
1385 derived().print(
"?");
1394 derived().apply(x.
name());
1395 derived().print(
" = ");
1403 derived().print(
"List");
1410 derived().print(
"Set");
1417 derived().print(
"Bag");
1424 derived().print(
"FSet");
1431 derived().print(
"FBag");
1438 derived().apply(x.
name());
1446 derived().print(
"(");
1448 derived().print(
")");
1470 derived().print(
"untyped_sort");
1477 derived().print(
"@untyped_possible_sorts[");
1478 derived().apply(x.
sorts());
1479 derived().print(
"]");
1486 derived().print(
"@s");
1487 derived().apply(x.
value());
1494 derived().apply(x.
name());
1501 derived().apply(x.
name());
1510 derived().print(
"0");
1514 derived().print(
"1");
1518 derived().print(
"{:}");
1522 derived().print(
"{}");
1526 derived().print(x.
name());
1590#ifdef MCRL2_ENABLE_MACHINENUMBERS
1609 derived().print(
"((");
1611 derived().print(
" + 1) mod ");
1613 derived().print(
" )");
1617 derived().print(
"((");
1619 derived().print(
" + ");
1621 derived().print(
") mod ");
1623 derived().print(
" )");
1627 derived().print(
"((");
1629 derived().print(
" + ");
1631 derived().print(
") div ");
1633 derived().print(
" )");
1637 derived().print(
"((");
1639 derived().print(
" * ");
1641 derived().print(
") mod ");
1643 derived().print(
" )");
1647 derived().print(
"((");
1649 derived().print(
" * ");
1651 derived().print(
") div ");
1653 derived().print(
" )");
1697#ifdef MCRL2_ENABLE_MACHINENUMBERS
1710 derived().print(
") + ");
1722 std::vector<char>
number = data::detail::string_to_vector_number(
"1");
1734#ifdef MCRL2_ENABLE_MACHINENUMBERS
1752 derived().apply(
if_(b, x1, x2));
1766#ifdef MCRL2_ENABLE_MACHINENUMBERS
1778 derived().print(
" div ");
1793 derived().print(
" mod ");
1801 const auto& y = atermpp::down_cast<application>(
sort_nat::arg(x));
1814 const auto& y = atermpp::down_cast<application>(
sort_nat::arg(x));
1830#ifdef MCRL2_ENABLE_MACHINENUMBERS
1843 derived().print(
") + ");
1854 derived().apply(*x.
begin());
1893 derived().apply(*x.
begin());
1934 derived().apply(numerator);
1943 derived().apply(*x.
begin());
1947 derived().apply(*x.
begin());
1951 derived().apply(*x.
begin());
2008 derived().print(
"#");
2059 derived().print(
"{}");
2063 derived().print(
"@setfset(");
2064 derived().apply(
variable(y).name());
2065 derived().print(
")");
2078 derived().print(
"{ ");
2080 derived().print(
" | ");
2081 derived().apply(body);
2082 derived().print(
" }");
2128 derived().print(
" - ");
2134 derived().print(
" + ");
2140 derived().print(
" * ");
2145 derived().print(
"#");
2177 derived().print(
"{:}");
2181 derived().print(
"@bagfbag(");
2182 derived().apply(
variable(y).name());
2183 derived().print(
")");
2196 derived().print(
"{ ");
2198 derived().print(
" | ");
2199 derived().apply(body);
2200 derived().print(
" }");
2247 derived().print(
"#");
2260 if (print_parentheses)
2262 derived().print(
"(");
2264 derived().apply(x1);
2265 if (print_parentheses)
2267 derived().print(
")");
2269 derived().print(
"[");
2270 derived().apply(x2);
2271 derived().print(
" -> ");
2272 derived().apply(x3);
2273 derived().print(
"]");
2282 derived().print(
"(");
2284 derived().apply(x.
head());
2287 derived().print(
")(");
2292 derived().print(
")");
2308 derived().print(std::to_string(x.
value()));
2314 derived().apply(x.
body());
2315 derived().print(
" whr ");
2319 if (i != declarations.
begin())
2321 derived().print(
", ");
2323 derived().apply(*i);
2325 derived().print(
" end");
2348 derived().apply(x.
lhs());
2349 derived().print(
" = ");
2350 derived().apply(x.
rhs());
2356 std::vector<variable>& variables,
2357 std::map<core::identifier_string, variable>& variable_map,
2358 std::set<core::identifier_string>& function_symbol_names
2363 function_symbol_names.insert(f.name());
2367 std::pair<std::map<core::identifier_string, variable>::iterator,
bool> k = variable_map.insert(std::make_pair(v.name(), v));
2370 variables.push_back(v);
2376 const std::map<core::identifier_string, variable>& variable_map
2381 auto j = variable_map.find(v.name());
2382 if (j != variable_map.end() && v != j->second)
2395 template <
typename Iter>
2398 std::map<core::identifier_string, variable> variable_map;
2399 std::set<core::identifier_string> function_symbol_names;
2400 for (Iter i = first; i != last; ++i)
2414 template <
typename AliasContainer,
typename SortContainer>
2416 const SortContainer& sorts,
2417 const std::string& opener =
"(",
2418 const std::string& closer =
")",
2419 const std::string& separator =
", "
2422 if (aliases.empty() && sorts.empty())
2426 bool first_element =
true;
2427 derived().print(opener);
2430 for (
auto i = sorts.begin(); i != sorts.end(); ++i)
2434 derived().print(separator);
2436 derived().apply(*i);
2437 first_element =
false;
2441 for (
auto i = aliases.begin(); i != aliases.end(); ++i)
2445 derived().print(separator);
2447 derived().apply(*i);
2448 first_element =
false;
2451 derived().print(closer);
2454 template <
typename Container>
2457 const std::string& opener =
"(",
2458 const std::string& closer =
")",
2459 const std::string& separator =
", "
2462 auto first = equations.
begin();
2463 auto last = equations.
end();
2465 Container normalized_equations = equations;
2468 while (first != last)
2470 std::vector<variable> variables;
2476 auto first1 = normalized_equations.begin() + (first - equations.
begin());
2477 auto i1 = normalized_equations.begin() + (i - equations.begin());
2478 print_list(std::vector<data_equation>(first1, i1), opener, closer, separator);
2500 derived().apply(atermpp::down_cast<data::forall>(x));
2504 derived().apply(atermpp::down_cast<data::exists>(x));
2508 derived().apply(atermpp::down_cast<data::lambda>(x));
2531 template <
typename T>
2534 core::detail::apply_printer<data::detail::printer> printer(out);
2540template <
typename T>
2541std::string
pp(
const T& x)
2543 std::ostringstream out;
Term containing a string.
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 Term & front() const
Returns the first element of the list.
const_iterator begin() const
Returns a const_iterator pointing to the beginning of the term_list.
An abstraction expression.
const variable_list & variables() const
const data_expression & body() const
const basic_sort & name() const
const sort_expression & reference() const
An application of a data expression to a number of arguments.
const_iterator end() const
Returns an iterator pointing past the last argument of the application.
const_iterator begin() const
Returns an iterator pointing to the first argument of the application.
const data_expression & head() const
Get the function at the head of this expression.
\brief Assignment of a data expression to a variable
const data_expression & rhs() const
const variable & lhs() const
\brief Binder for bag comprehension
universal quantification.
\brief Container type for bags
const core::identifier_string & name() const
const container_type & container_name() const
const sort_expression & element_sort() const
const data_expression & lhs() const
const data_expression & condition() const
const data_expression & rhs() const
const variable_list & variables() const
sort_expression sort() const
Returns the sort of the data expression.
const_iterator end() const
const_iterator begin() const
const function_symbol_vector & user_defined_constructors() const
Gets the constructors defined by the user, excluding those that are system defined.
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.
\brief Binder for existential quantification
existential quantification.
\brief Container type for finite bags
\brief Binder for universal quantification
universal quantification.
\brief Container type for finite sets
const sort_expression & codomain() const
const sort_expression_list & domain() const
const core::identifier_string & name() const
const sort_expression & sort() const
\brief Binder for lambda abstraction
\brief Container type for lists
std::size_t value() const
\brief Binder for set comprehension
universal quantification.
\brief Container type for sets
Identifier generator that stores the identifiers of the context in a set. Using the operator()() and ...
void add_identifier(const core::identifier_string &s) override
Adds the identifier s to the context.
const basic_sort_vector & user_defined_sorts() const
Gets all sorts defined by a user (excluding the system defined sorts).
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 structured_sort_constructor_list & constructors() const
\brief An untyped parameter
const core::identifier_string & name() const
const data_expression_list & arguments() const
\brief Assignment of a data expression to a string
const core::identifier_string & lhs() const
const data_expression & rhs() const
\brief An untyped identifier
const core::identifier_string & name() const
\brief Multiple possible sorts
const sort_expression_list & sorts() const
\brief Binder for untyped set or bag comprehension
\brief Untyped sort variable
const atermpp::aterm_int & value() const
\brief Unknown sort expression
const core::identifier_string & name() const
\brief A where expression
const data_expression & body() const
const assignment_expression_list & declarations() const
add your file description here.
The class data_specification.
add your file description here.
identifier_string empty_identifier_string()
Provides the empty identifier string.
bool is_greater(const application &x)
bool is_minus(const application &x)
bool is_equal_to(const application &x)
bool is_snoc_list(data_expression x)
bool is_in(const application &x)
bool head_matches_undefined_symbol(const data_expression &x, const core::identifier_string &s)
bool is_bag_intersection(const application &x)
bool is_set_difference(const application &x)
bool is_not_equal_to(const application &x)
bool is_numeric_cast(const data_expression &x)
bool is_divides(const application &x)
bool is_set_union(const application &x)
bool is_bag_difference(const application &x)
bool is_less_equal(const application &x)
bool is_set_intersection(const application &x)
bool is_plus(const application &x)
bool is_or(const application &x)
bool is_greater_equal(const application &x)
data_expression reconstruct_pos_mult(const data_expression &x, const std::vector< char > &result)
bool is_untyped(const data_expression &x)
bool is_one(const data_expression &x)
std::string pp(const detail::lhs_t &lhs)
bool is_element_at(const application &x)
bool is_bag_join(const application &x)
bool is_concat(const application &x)
bool is_and(const application &x)
bool look_through_numeric_casts(const data_expression &x, std::function< bool(const data_expression &)> f)
bool is_snoc(const application &x)
bool is_implies(const application &x)
bool is_cons_list(data_expression x)
bool is_mod(const application &x)
bool is_divmod(const application &x)
bool is_div(const application &x)
bool is_times(const application &x)
bool is_cons(const application &x)
bool is_less(const application &x)
const data_expression & right(const data_expression &e)
Function for projecting out argument. right from an application.
function_symbol bag_fbag(const sort_expression &s)
Constructor for function symbol @bagfbag.
bool is_difference_application(const atermpp::aterm &e)
Recogniser for application of -.
bool is_bag_fbag_application(const atermpp::aterm &e)
Recogniser for application of @bagfbag.
bool is_union_application(const atermpp::aterm &e)
Recogniser for application of +.
function_symbol count(const sort_expression &, const sort_expression &s0, const sort_expression &s1)
bool is_in_application(const atermpp::aterm &e)
Recogniser for application of in.
const data_expression & left(const data_expression &e)
Function for projecting out argument. left from an application.
const core::identifier_string & intersection_name()
Generate identifier *.
bool is_bag_enumeration_application(const atermpp::aterm &e)
Recogniser for application of bag_enumeration.
bool is_constructor_application(const atermpp::aterm &e)
Recogniser for application of @bag.
bool is_zero_function_function_symbol(const atermpp::aterm &e)
Recogniser for function @zero_.
bool is_bag_comprehension_application(const atermpp::aterm &e)
Recogniser for application of @bagcomp.
const core::identifier_string & union_name()
Generate identifier +.
bool is_intersection_application(const atermpp::aterm &e)
Recogniser for application of *.
const data_expression & arg(const data_expression &e)
Function for projecting out argument. arg from an application.
const core::identifier_string & difference_name()
Generate identifier -.
bool is_one_function_function_symbol(const atermpp::aterm &e)
Recogniser for function @one_.
bool is_or_application(const atermpp::aterm &e)
Recogniser for application of ||.
bool is_bool(const sort_expression &e)
Recogniser for sort expression Bool.
const core::identifier_string & implies_name()
Generate identifier =>.
const core::identifier_string & or_name()
Generate identifier ||.
bool is_implies_application(const atermpp::aterm &e)
Recogniser for application of =>.
const function_symbol & and_()
Constructor for function symbol &&.
const function_symbol & false_()
Constructor for function symbol false.
bool is_and_application(const atermpp::aterm &e)
Recogniser for application of &&.
bool is_true_function_symbol(const atermpp::aterm &e)
Recogniser for function true.
bool is_not_application(const atermpp::aterm &e)
Recogniser for application of !.
const function_symbol & not_()
Constructor for function symbol !.
const function_symbol & true_()
Constructor for function symbol true.
const core::identifier_string & and_name()
Generate identifier &&.
bool is_empty_function_symbol(const atermpp::aterm &e)
Recogniser for function {:}.
bool is_union_application(const atermpp::aterm &e)
Recogniser for application of +.
const data_expression & arg3(const data_expression &e)
Function for projecting out argument. arg3 from an application.
const data_expression & arg(const data_expression &e)
Function for projecting out argument. arg from an application.
bool is_intersection_application(const atermpp::aterm &e)
Recogniser for application of *.
bool is_in_application(const atermpp::aterm &e)
Recogniser for application of in.
const core::identifier_string & difference_name()
Generate identifier -.
bool is_difference_application(const atermpp::aterm &e)
Recogniser for application of -.
bool is_cons_application(const atermpp::aterm &e)
Recogniser for application of @fbag_cons.
const data_expression & arg2(const data_expression &e)
Function for projecting out argument. arg2 from an application.
bool is_count_all_application(const atermpp::aterm &e)
Recogniser for application of #.
bool is_cinsert_application(const atermpp::aterm &e)
Recogniser for application of @fbag_cinsert.
const core::identifier_string & union_name()
Generate identifier +.
bool is_insert_application(const atermpp::aterm &e)
Recogniser for application of @fbag_insert.
const data_expression & arg1(const data_expression &e)
Function for projecting out argument. arg1 from an application.
bool is_empty_function_symbol(const atermpp::aterm &e)
Recogniser for function {}.
bool is_in_application(const atermpp::aterm &e)
Recogniser for application of in.
const core::identifier_string & difference_name()
Generate identifier -.
const data_expression & right(const data_expression &e)
Function for projecting out argument. right from an application.
const data_expression & left(const data_expression &e)
Function for projecting out argument. left from an application.
bool is_difference_application(const atermpp::aterm &e)
Recogniser for application of -.
const core::identifier_string & union_name()
Generate identifier +.
bool is_count_application(const atermpp::aterm &e)
Recogniser for application of #.
bool is_cons_application(const atermpp::aterm &e)
Recogniser for application of @fset_cons.
bool is_intersection_application(const atermpp::aterm &e)
Recogniser for application of *.
const data_expression & arg(const data_expression &e)
Function for projecting out argument. arg from an application.
bool is_union_application(const atermpp::aterm &e)
Recogniser for application of +.
bool is_insert_application(const atermpp::aterm &e)
Recogniser for application of @fset_insert.
const data_expression & right(const data_expression &e)
Function for projecting out argument. right from an application.
const function_symbol & pos2int()
Constructor for function symbol Pos2Int.
const data_expression & arg(const data_expression &e)
Function for projecting out argument. arg from an application.
bool is_mod_application(const atermpp::aterm &e)
Recogniser for application of mod.
bool is_int(const sort_expression &e)
Recogniser for sort expression Int.
bool is_times_application(const atermpp::aterm &e)
Recogniser for application of *.
bool is_cneg_application(const atermpp::aterm &e)
Recogniser for application of @cNeg.
bool is_cint_application(const atermpp::aterm &e)
Recogniser for application of @cInt.
bool is_plus_application(const atermpp::aterm &e)
Recogniser for application of +.
const core::identifier_string & mod_name()
Generate identifier mod.
bool is_negate_application(const atermpp::aterm &e)
Recogniser for application of -.
function_symbol negate(const sort_expression &s0)
bool is_div_application(const atermpp::aterm &e)
Recogniser for application of div.
const core::identifier_string & minus_name()
Generate identifier -.
const core::identifier_string & div_name()
Generate identifier div.
bool is_nat2int_application(const atermpp::aterm &e)
Recogniser for application of Nat2Int.
bool is_minus_application(const atermpp::aterm &e)
Recogniser for application of -.
bool is_pos2int_application(const atermpp::aterm &e)
Recogniser for application of Pos2Int.
const core::identifier_string & times_name()
Generate identifier *.
const data_expression & left(const data_expression &e)
Function for projecting out argument. left from an application.
const core::identifier_string & snoc_name()
Generate identifier <|.
bool is_list_enumeration_application(const atermpp::aterm &e)
Recogniser for application of list_enumeration.
const core::identifier_string & in_name()
Generate identifier in.
bool is_concat_application(const atermpp::aterm &e)
Recogniser for application of ++.
const core::identifier_string & cons_name()
Generate identifier |>.
const core::identifier_string & concat_name()
Generate identifier ++.
bool is_in_application(const atermpp::aterm &e)
Recogniser for application of in.
const core::identifier_string & element_at_name()
Generate identifier ..
bool is_cons_application(const atermpp::aterm &e)
Recogniser for application of |>.
bool is_snoc_application(const atermpp::aterm &e)
Recogniser for application of <|.
bool is_element_at_application(const atermpp::aterm &e)
Recogniser for application of ..
const data_expression & left(const data_expression &e)
Function for projecting out argument. left from an application.
bool is_count_application(const atermpp::aterm &e)
Recogniser for application of #.
const data_expression & arg(const data_expression &e)
Function for projecting out argument. arg from an application.
const data_expression & right(const data_expression &e)
Function for projecting out argument. right from an application.
bool is_empty_function_symbol(const atermpp::aterm &e)
Recogniser for function [].
const machine_number & one_word()
const machine_number & max_word()
const machine_number & zero_word()
bool is_zero_word_function_symbol(const atermpp::aterm &e)
Recogniser for function @zero_word.
bool is_add_word_application(const atermpp::aterm &e)
Recogniser for application of @add_word.
bool is_max_word_function_symbol(const atermpp::aterm &e)
Recogniser for function @max_word.
bool is_succ_word_application(const atermpp::aterm &e)
Recogniser for application of @succ_word.
bool is_one_word_function_symbol(const atermpp::aterm &e)
Recogniser for function @one_word.
const data_expression & right(const data_expression &e)
Function for projecting out argument. right from an application.
bool is_times_overflow_word_application(const atermpp::aterm &e)
Recogniser for application of @times_overflow_word.
bool is_times_word_application(const atermpp::aterm &e)
Recogniser for application of @times_word.
const data_expression & arg(const data_expression &e)
Function for projecting out argument. arg from an application.
const data_expression & left(const data_expression &e)
Function for projecting out argument. left from an application.
bool is_add_overflow_word_application(const atermpp::aterm &e)
Recogniser for application of @add_overflow_word.
const data_expression & right(const data_expression &e)
Function for projecting out argument. right from an application.
bool is_cnat_application(const atermpp::aterm &e)
Recogniser for application of @cNat.
bool is_div_application(const atermpp::aterm &e)
Recogniser for application of div.
bool is_pos2nat_application(const atermpp::aterm &e)
Recogniser for application of Pos2Nat.
const function_symbol & cnat()
Constructor for function symbol @cNat.
const basic_sort & nat()
Constructor for sort expression Nat.
const function_symbol & swap_zero()
Constructor for function symbol @swap_zero.
bool is_nat(const sort_expression &e)
Recogniser for sort expression Nat.
std::string natural_constant_as_string(const data_expression &n_in)
Return the string representation of a natural number.
const data_expression & left(const data_expression &e)
Function for projecting out argument. left from an application.
bool is_mod_application(const atermpp::aterm &e)
Recogniser for application of mod.
bool is_last_application(const atermpp::aterm &e)
Recogniser for application of @last.
bool is_first_application(const atermpp::aterm &e)
Recogniser for application of @first.
bool is_c0_function_symbol(const atermpp::aterm &e)
Recogniser for function @c0.
const data_expression & arg2(const data_expression &e)
Function for projecting out argument. arg2 from an application.
const data_expression & arg1(const data_expression &e)
Function for projecting out argument. arg1 from an application.
bool is_concat_digit_application(const atermpp::aterm &e)
Recogniser for application of @concat_digit.
const data_expression & arg(const data_expression &e)
Function for projecting out argument. arg from an application.
bool is_plus_application(const atermpp::aterm &e)
Recogniser for application of +.
bool is_divmod_aux_application(const atermpp::aterm &e)
Recogniser for application of @divmod_aux.
bool is_times_application(const atermpp::aterm &e)
Recogniser for application of *.
const function_symbol & pos2nat()
Constructor for function symbol Pos2Nat.
bool is_natural_constant(const data_expression &n)
Determines whether n is a natural constant.
bool is_most_significant_digit_nat_application(const atermpp::aterm &e)
Recogniser for application of @most_significant_digitNat.
bool is_divmod_application(const atermpp::aterm &e)
Recogniser for application of @divmod.
std::string positive_constant_as_string(const data_expression &n_in)
Return the string representation of a positive number.
const data_expression & arg(const data_expression &e)
Function for projecting out argument. arg from an application.
bool is_positive_constant(const data_expression &n)
Determines whether n is a positive constant.
bool is_pos(const sort_expression &e)
Recogniser for sort expression Pos.
const data_expression & arg3(const data_expression &e)
Function for projecting out argument. arg3 from an application.
const data_expression & arg1(const data_expression &e)
Function for projecting out argument. arg1 from an application.
bool is_cdub_application(const atermpp::aterm &e)
Recogniser for application of @cDub.
const function_symbol & plus()
Constructor for function symbol +.
bool is_add_with_carry_application(const atermpp::aterm &e)
Recogniser for application of @addc.
const core::identifier_string & times_name()
Generate identifier *.
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 data_expression & right(const data_expression &e)
Function for projecting out argument. right from an application.
bool is_times_application(const atermpp::aterm &e)
Recogniser for application of *.
bool is_most_significant_digit_application(const atermpp::aterm &e)
Recogniser for application of @most_significant_digit.
bool is_concat_digit_application(const atermpp::aterm &e)
Recogniser for application of @concat_digit.
const basic_sort & pos()
Constructor for sort expression Pos.
const data_expression & left(const data_expression &e)
Function for projecting out argument. left from an application.
bool is_plus_application(const atermpp::aterm &e)
Recogniser for application of +.
const function_symbol & succ()
Constructor for function symbol succ.
function_symbol plus(const sort_expression &s0, const sort_expression &s1)
const core::identifier_string & minus_name()
Generate identifier -.
function_symbol divides(const sort_expression &s0, const sort_expression &s1)
bool is_int2real_application(const atermpp::aterm &e)
Recogniser for application of Int2Real.
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 /.
const core::identifier_string & divides_name()
Generate identifier /.
bool is_reduce_fraction_where_application(const atermpp::aterm &e)
Recogniser for application of @redfracwhr.
bool is_creal_application(const atermpp::aterm &e)
Recogniser for application of @cReal.
bool is_real(const sort_expression &e)
Recogniser for sort expression Real.
const data_expression & right(const data_expression &e)
Function for projecting out argument. right from an application.
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 +.
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 *.
bool is_reduce_fraction_application(const atermpp::aterm &e)
Recogniser for application of @redfrac.
bool is_negate_application(const atermpp::aterm &e)
Recogniser for application of -.
bool is_minus_application(const atermpp::aterm &e)
Recogniser for application of -.
const data_expression & arg3(const data_expression &e)
Function for projecting out argument. arg3 from an application.
const function_symbol & int2real()
Constructor for function symbol Int2Real.
bool is_pos2real_application(const atermpp::aterm &e)
Recogniser for application of Pos2Real.
bool is_nat2real_application(const atermpp::aterm &e)
Recogniser for application of Nat2Real.
bool is_set_comprehension_application(const atermpp::aterm &e)
Recogniser for application of @setcomp.
bool is_false_function_function_symbol(const atermpp::aterm &e)
Recogniser for function @false_.
bool is_union_application(const atermpp::aterm &e)
Recogniser for application of +.
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_fset_union_application(const atermpp::aterm &e)
Recogniser for application of @fset_union.
const data_expression & left(const data_expression &e)
Function for projecting out argument. left from an application.
bool is_in_application(const atermpp::aterm &e)
Recogniser for application of in.
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 -.
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.
bool is_set_fset_application(const atermpp::aterm &e)
Recogniser for application of @setfset.
const data_expression & arg2(const data_expression &e)
Function for projecting out argument. arg2 from an application.
const core::identifier_string & intersection_name()
Generate identifier *.
bool is_set_enumeration_application(const atermpp::aterm &e)
Recogniser for application of set_enumeration.
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.
const core::identifier_string & union_name()
Generate identifier +.
function_symbol in(const sort_expression &, const sort_expression &s0, const sort_expression &s1)
const core::identifier_string & difference_name()
Generate identifier -.
function_symbol set_fset(const sort_expression &s)
Constructor for function symbol @setfset.
bool is_intersection_application(const atermpp::aterm &e)
Recogniser for application of *.
const data_expression & arg1(const data_expression &e)
Function for projecting out argument. arg1 from an application.
bool is_greater_application(const DataExpression &e)
Recogniser for application of >
bool is_set_container(const atermpp::aterm &x)
int precedence(const data_expression &x)
data_expression number(const sort_expression &s, const std::string &n)
Construct numeric expression from a string representing a number in decimal notation.
function_symbol not_equal_to(const sort_expression &s)
Constructor for function symbol !=.
const data_expression & arg1(const data_expression &e)
Function for projecting out argument. arg1 from an application.
bool is_list_container(const atermpp::aterm &x)
bool is_if_application(const DataExpression &e)
Recogniser for application of if.
bool is_not_equal_to_application(const DataExpression &e)
Recogniser for application of !=.
std::set< data::variable > find_all_variables(const data::data_expression &x)
bool is_where_clause(const atermpp::aterm &x)
Returns true if the term t is a where clause.
bool is_greater_equal_application(const DataExpression &e)
Recogniser for application of >=.
bool is_abstraction(const atermpp::aterm &x)
Returns true if the term t is an abstraction.
bool is_untyped_identifier(const atermpp::aterm &x)
Returns true if the term t is an identifier.
bool is_left_associative(const data_expression &x)
std::vector< data_expression > data_expression_vector
\brief vector of data_expressions
std::string pp(const abstraction &x)
bool is_right_associative(const data_expression &x)
bool is_forall(const atermpp::aterm &x)
Returns true if the term t is a universal quantification.
bool is_function_symbol(const atermpp::aterm &x)
Returns true if the term t is a function symbol.
bool is_fset_container(const atermpp::aterm &x)
bool is_function_update_stable_application(const atermpp::aterm &e)
Recogniser for application of @func_update_stable.
std::set< data::function_symbol > find_function_symbols(const data::data_equation &x)
bool is_untyped_set_or_bag_comprehension(const atermpp::aterm &x)
Returns true if the term t is a set/bag comprehension.
bool is_exists(const atermpp::aterm &x)
Returns true if the term t is an existential quantification.
bool is_function_sort(const atermpp::aterm &x)
Returns true if the term t is a function sort.
data_expression normalize_sorts(const data_expression &x, const data::sort_specification &sortspec)
bool is_bag_comprehension(const atermpp::aterm &x)
Returns true if the term t is a bag comprehension.
bool is_set_comprehension(const atermpp::aterm &x)
Returns true if the term t is a set comprehension.
std::string max_machine_number_string()
A string representation indicating the maximal machine number + 1.
bool is_bag_container(const atermpp::aterm &x)
bool is_machine_number(const atermpp::aterm &x)
Returns true if the term t is a machine_number.
bool is_function_update_application(const atermpp::aterm &e)
Recogniser for application of @func_update.
bool is_fbag_container(const atermpp::aterm &x)
bool is_lambda(const atermpp::aterm &x)
Returns true if the term t is a lambda abstraction.
bool is_less_application(const DataExpression &e)
Recogniser for application of <.
const data_expression & arg3(const data_expression &e)
Function for projecting out argument. arg3 from an application.
bool is_application(const atermpp::aterm &x)
Returns true if the term t is an application.
bool is_less_equal_application(const DataExpression &e)
Recogniser for application of <=.
const data_expression & arg2(const data_expression &e)
Function for projecting out argument. arg2 from an application.
function_symbol if_(const sort_expression &s)
Constructor for function symbol if.
bool is_equal_to_application(const DataExpression &e)
Recogniser for application of ==.
bool is_variable(const atermpp::aterm &x)
Returns true if the term t is a variable.
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
Provides utilities for working with data expressions of standard container sorts.
void apply(const data::variable &x)
sort_expression operator()(const T &t) const
void print_condition(const T &x, const std::string &arrow=" -> ")
void apply(const data::untyped_set_or_bag_comprehension_binder &x)
void apply(const data::untyped_sort_variable &x)
void apply(const data::application &x)
bool is_cons_list(data_expression x) const
void apply(const machine_number &x)
void print_container(const Container &container, int container_precedence=-1, const std::string &separator=", ", const std::string &open_bracket="(", const std::string &close_bracket=")")
void apply(const data::untyped_identifier &x)
void print_sort_list(const Container &container, const std::string &opener="(", const std::string &closer=")", const std::string &separator=", ")
void print_fset_default(const data_expression &x)
void apply(const data::bag_comprehension_binder &x)
void apply(const data::set_container &x)
void apply(const data::set_comprehension_binder &x)
void print_set_enumeration(const application &x)
void print_binary_data_operation(const application &x, const std::string &op)
void print_cons_list(data_expression x)
void print_sort_declarations(const AliasContainer &aliases, const SortContainer &sorts, const std::string &opener="(", const std::string &closer=")", const std::string &separator=", ")
void update_mappings(const data_equation &eqn, std::vector< variable > &variables, std::map< core::identifier_string, variable > &variable_map, std::set< core::identifier_string > &function_symbol_names)
bool is_fbag_cons_list(data_expression x)
Returns true if x is a list composed of cons, insert and cinsert applications.
void print_assignments(const Container &container, bool print_lhs=true, const std::string &opener="", const std::string &closer="", const std::string &separator=", ", const std::string &assignment_symbol=" = ")
void apply(const data::list_container &x)
void apply(const data::exists &x)
void apply(const data::fbag_container &x)
void apply(const data::function_sort &x)
void print_fset_lambda(const data_expression &x)
core::identifier_string generate_identifier(const std::string &prefix, const data_expression &context) const
void apply(const data::data_equation &x)
void apply(const data::alias &x)
void print_sorted_declarations(const Container &container, bool print_sorts=true, bool join_sorts=true, bool maximally_shared=false, const std::string &opener="(", const std::string &closer=")", const std::string &separator=", ", SortAccessor get_sort=get_sort_default())
void apply(const data::where_clause &x)
void apply(const data::data_specification &x)
bool is_fbag_zero(const data_expression &x)
void apply(const data::structured_sort &x)
void apply(const data::untyped_identifier_assignment &x)
void print_equations(const Container &equations, const data_specification &data_spec, const std::string &opener="(", const std::string &closer=")", const std::string &separator=", ")
bool is_fset_false(const data_expression &x)
bool is_abstraction_application(const application &x) const
void apply(const data::lambda_binder &x)
void apply(const data::structured_sort_constructor_argument &x)
void apply(const data::variable &x)
void apply(const data::container_type &x)
bool is_fbag_one(const data_expression &x)
void apply(const data::basic_sort &x)
bool is_snoc_list(data_expression x) const
void print_fbag_one(const data_expression &x)
bool is_fbag_lambda(const data_expression &x)
void print_abstraction(const Abstraction &x, const std::string &op)
void apply(const data::function_symbol &x)
void apply(const data::exists_binder &x)
void apply(const data::fset_container &x)
bool has_conflict(const data_equation &eqn, const std::map< core::identifier_string, variable > &variable_map)
bool is_numeric_expression(const application &x)
bool is_infix_operation(const application &x) const
void print_fbag_lambda(const data_expression &x)
void apply(const data::untyped_data_parameter &x)
void apply(const data::abstraction &x)
void apply(const data::untyped_sort &x)
void apply(const data::container_sort &x)
void apply(const data::assignment &x)
void print_fbag_zero(const data_expression &x)
data::add_traverser_sort_expressions< core::detail::printer, Derived > super
bool is_fset_lambda(const data_expression &x)
void print_snoc_list(data_expression x)
void print_fset_false(const data_expression &x)
void print_fbag_cons_list(data_expression x)
bool is_standard_sort(const sort_expression &x)
void apply(const data::untyped_possible_sorts &x)
void print_unary_data_operation(const application &x, const std::string &op)
bool is_fset_cons_list(data_expression x)
void print_setbag_comprehension(const abstraction &x)
void print_fset_cons_list(data_expression x)
void print_bag_enumeration(const application &x)
void print_variables(const Container &container, bool print_sorts=true, bool join_sorts=true, bool maximally_shared=false, const std::string &opener="(", const std::string &closer=")", const std::string &separator=", ")
void apply(const data::bag_container &x)
void print_function_application(const application &x)
void print_fbag_default(const data_expression &x)
Iter find_conflicting_equation(Iter first, Iter last, std::vector< variable > &variables)
Searches in the range of equations [first, last) for the first equation that conflicts with one of th...
void print_variable(const Variable &x, bool print_sort=false)
void apply(const data::variable_list &x)
void apply(const std::pair< data_expression, data_expression > &x)
void print_binary_data_operation(const application &x, const data_expression &x1, const data_expression &x2, const std::string &op)
void print_list_enumeration(const application &x)
void apply(const data::structured_sort_constructor &x)
void apply(const data::forall &x)
void apply(const data::forall_binder &x)
void apply(const data::lambda &x)
void print_fset_set_operation(const data_expression &x, const std::string &op)
void print_fset_true(const data_expression &x)
bool is_fset_true(const data_expression &x)
Prints the object x to a stream.
void operator()(const T &x, std::ostream &out)