mCRL2
Loading...
Searching...
No Matches
txt2pbes.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_PBES_TOOLS_TXT2PBES_H
13#define MCRL2_PBES_TOOLS_TXT2PBES_H
14
15#include "mcrl2/pbes/txt2pbes.h"
16
17namespace mcrl2 {
18
19namespace pbes_system {
20
21void txt2pbes(const std::string& input_filename,
22 const std::string& output_filename,
23 const utilities::file_format& output_format,
24 bool normalize
25 )
26{
27 pbes p;
28 if (input_filename.empty())
29 {
30 //parse specification from stdin
31 mCRL2log(log::verbose) << "reading input from stdin..." << std::endl;
32 p = txt2pbes(std::cin, normalize);
33 }
34 else
35 {
36 //parse specification from input filename
37 mCRL2log(log::verbose) << "reading input from file '" << input_filename << "'..." << std::endl;
38 std::ifstream instream(input_filename.c_str(), std::ifstream::in|std::ifstream::binary);
39 if (!instream)
40 {
41 throw mcrl2::runtime_error("cannot open input file: " + input_filename);
42 }
43 p = txt2pbes(instream, normalize);
44 instream.close();
45 }
46 save_pbes(p, output_filename, output_format);
47}
48
49} // namespace pbes_system
50
51} // namespace mcrl2
52
53#endif // MCRL2_PBES_TOOLS_TXT2PBES_H
parameterized boolean equation system
Definition pbes.h:58
Standard exception class for reporting runtime errors.
Definition exception.h:27
#define mCRL2log(LEVEL)
mCRL2log(LEVEL) provides the stream used to log.
Definition logger.h:391
@ verbose
Definition logger.h:37
void txt2pbes(const std::string &input_filename, const std::string &output_filename, const utilities::file_format &output_format, bool normalize)
Definition txt2pbes.h:21
void save_pbes(const pbes &pbes, std::ostream &stream, utilities::file_format format=utilities::file_format())
Save a PBES in the format specified.
Definition io.cpp:49
void normalize(T &x, typename std::enable_if< !std::is_base_of< atermpp::aterm, T >::value >::type *=nullptr)
The function normalize brings (embedded) pbes expressions into positive normal form,...
Definition normalize.h:177
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
Definition indexed_set.h:72
Function for parsing a pbes specification.