mCRL2
Loading...
Searching...
No Matches
print_parse_check.h
Go to the documentation of this file.
1// Author(s): Wieger Wesselink
2// Copyright: see the accompanying file COPYING or copy at
3// https://github.com/mCRL2org/mCRL2/blob/master/COPYING
4//
5// Distributed under the Boost Software License, Version 1.0.
6// (See accompanying file LICENSE_1_0.txt or copy at
7// http://www.boost.org/LICENSE_1_0.txt)
8//
11
12#ifndef MCRL2_DATA_DETAIL_PRINT_PARSE_CHECK_H
13#define MCRL2_DATA_DETAIL_PRINT_PARSE_CHECK_H
14
15#include "mcrl2/data/parse.h"
16#include "mcrl2/data/print.h"
17
18namespace mcrl2 {
19
20namespace data {
21
22namespace detail {
23
24inline
26{
27 std::string xtext = data::pp(x);
29 std::string ytext = data::pp(y);
30 if (xtext != ytext)
31 {
32 std::cerr << "--- ERROR: print_parse_check failed! ---\n";
33 std::cerr << "x = " << x << " " << xtext << "\n";
34 std::cerr << "y = " << y << " " << ytext << "\n";
35 }
36}
37
38inline
40{
41 std::string xtext = data::pp(x);
42 std::set<variable> v = data::find_free_variables(x);
43 data_expression y = data::parse_data_expression(xtext, v, dataspec);
44 std::string ytext = data::pp(y);
45 if (xtext != ytext)
46 {
47 std::cerr << "--- ERROR: print_parse_check failed! ---\n";
48 std::cerr << "x = " << x << " " << xtext << "\n";
49 std::cerr << "y = " << y << " " << ytext << "\n";
50 }
51}
52
53} // namespace detail
54
55} // namespace data
56
57} // namespace mcrl2
58
59#endif // MCRL2_DATA_DETAIL_PRINT_PARSE_CHECK_H
\brief A sort expression
Parser for data specifications.
Provides utilities for pretty printing.
void print_parse_check(const sort_expression &x, const data_specification &dataspec=data_specification())
data_expression parse_data_expression(std::istream &in, const VariableContainer &variables, const data_specification &dataspec=detail::default_specification(), bool type_check=true, bool translate_user_notation=true, bool normalize_sorts=true)
Parses and type checks a data expression.
Definition parse.h:276
sort_expression parse_sort_expression(std::istream &in, const data_specification &data_spec=detail::default_specification())
Parses and type checks a sort expression.
Definition parse.h:380
std::string pp(const abstraction &x)
Definition data.cpp:39
std::set< data::variable > find_free_variables(const data::data_expression &x)
Definition data.cpp:99
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
Definition indexed_set.h:72