mCRL2
Loading...
Searching...
No Matches
txt2pbes.h
Go to the documentation of this file.
1// Author(s): Aad Mathijssen, 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/pbes/txt2pbes.h
10/// \brief Function for parsing a pbes specification.
11
12#ifndef MCRL2_PBES_TXT2PBES_H
13#define MCRL2_PBES_TXT2PBES_H
14
15#include "mcrl2/pbes/algorithms.h"
16#include "mcrl2/pbes/io.h"
17#include "mcrl2/pbes/parse.h"
18
19namespace mcrl2::pbes_system
20{
21
22/// \brief Parses a PBES specification from an input stream
23/// \param spec_stream A stream from which can be read
24/// \param normalize If true, the resulting PBES is normalized after reading.
25/// \return The parsed PBES
26inline
27pbes txt2pbes(std::istream& spec_stream, bool normalize = true)
28{
29 pbes result;
30 spec_stream >> result;
31 if (normalize)
32 {
33 mCRL2log(log::verbose) << "normalizing the PBES ..." << std::endl;
35 }
36 return result;
37}
38
39/// \brief Parses a PBES specification from a string
40/// \param text A string
41/// \param normalize If true, the resulting PBES is normalized after reading.
42/// \return The parsed PBES
43inline
44pbes txt2pbes(const std::string& text, bool normalize = true)
45{
46 std::stringstream from(text);
47 return txt2pbes(from, normalize);
48}
49
50} // namespace mcrl2::pbes_system
51
52#endif // MCRL2_PBES_TXT2PBES_H
parameterized boolean equation system
Definition pbes.h:54
#define mCRL2log(LEVEL)
mCRL2log(LEVEL) provides the stream used to log.
Definition logger.h:393
void normalize(pbes &x)
The function normalize brings (embedded) pbes expressions into positive normal form,...
The main namespace for the PBES library.
pbes txt2pbes(std::istream &spec_stream, bool normalize=true)
Parses a PBES specification from an input stream.
Definition txt2pbes.h:27
pbes txt2pbes(const std::string &text, bool normalize=true)
Parses a PBES specification from a string.
Definition txt2pbes.h:44