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//
9/// \file mcrl2/data/detail/print_parse_check.h
10/// \brief add your file description here.
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::data::detail
19{
20
21inline
23{
24 std::string xtext = data::pp(x);
25 sort_expression y = data::parse_sort_expression(xtext, dataspec);
26 std::string ytext = data::pp(y);
27 if (xtext != ytext)
28 {
29 std::cerr << "--- ERROR: print_parse_check failed! ---\n";
30 std::cerr << "x = " << x << " " << xtext << "\n";
31 std::cerr << "y = " << y << " " << ytext << "\n";
32 }
33}
34
35inline
37{
38 std::string xtext = data::pp(x);
39 std::set<variable> v = data::find_free_variables(x);
40 data_expression y = data::parse_data_expression(xtext, v, dataspec);
41 std::string ytext = data::pp(y);
42 if (xtext != ytext)
43 {
44 std::cerr << "--- ERROR: print_parse_check failed! ---\n";
45 std::cerr << "x = " << x << " " << xtext << "\n";
46 std::cerr << "y = " << y << " " << ytext << "\n";
47 }
48}
49
50} // namespace mcrl2::data::detail
51
52#endif // MCRL2_DATA_DETAIL_PRINT_PARSE_CHECK_H
data_specification()=default
Default constructor. Generate a data specification that contains only booleans and positive numbers.
\brief A sort expression
void print_parse_check(const data_expression &x, const data_specification &dataspec=data_specification())
void print_parse_check(const sort_expression &x, const data_specification &dataspec=data_specification())