mCRL2
Loading...
Searching...
No Matches
pres_rewriter_type.h
Go to the documentation of this file.
1// Author(s): Jan Friso Groote. Based on pbes/pbes_rewriter_type.h by 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_PRES_PRES_REWRITER_TYPE_H
13#define MCRL2_PRES_PRES_REWRITER_TYPE_H
14
15#include <string>
17
18namespace mcrl2 {
19
20namespace pres_system {
21
24{
30
31};
32
34inline
36{
37 if (type == "simplify")
38 {
39 return simplify;
40 }
41 if (type == "quantifier-all")
42 {
43 return quantifier_all;
44 }
45 if (type == "quantifier-finite")
46 {
47 return quantifier_finite;
48 }
49 if (type == "quantifier-inside")
50 {
51 return quantifier_inside;
52 }
53 if (type == "quantifier-one-point")
54 {
56 }
57 throw mcrl2::runtime_error("unknown pres rewriter option " + type);
58}
59
61inline
63{
64 switch (type)
65 {
66 case simplify:
67 return "simplify";
68 case quantifier_all:
69 return "quantifier-all";
71 return "quantifier-finite";
73 return "quantifier-inside";
75 return "quantifier-one-point";
76 default:
77 return "unknown pres rewriter";
78 }
79}
80
82inline
83std::string description(const pres_rewriter_type type)
84{
85 switch (type)
86 {
87 case simplify :
88 return "for simplification";
89 case quantifier_all :
90 return "for eliminating all quantifiers";
92 return "for eliminating finite quantifier variables";
94 return "for pushing quantifiers inside";
96 return "for one point rule quantifier elimination";
97
98 }
99 throw mcrl2::runtime_error("unknown pres rewriter");
100}
101
106inline
107std::istream& operator>>(std::istream& is, pres_rewriter_type& t)
108{
109 std::string s;
110 is >> s;
111 try
112 {
114 }
115 catch (const mcrl2::runtime_error&)
116 {
117 is.setstate(std::ios_base::failbit);
118 }
119 return is;
120}
121
122inline
123std::ostream& operator<<(std::ostream& os, const pres_rewriter_type t)
124{
126 return os;
127}
128
129} // namespace pres_system
130
131} // namespace mcrl2
132
133#endif // MCRL2_PRES_PRES_REWRITER_TYPE_H
Standard exception class for reporting runtime errors.
Definition exception.h:27
Exception classes for use in libraries and tools.
std::string print_pres_rewriter_type(const pres_rewriter_type type)
Prints a pres rewriter type.
pres_rewriter_type
An enumerated type for the available pres rewriters.
std::string description(const pres_rewriter_type type)
Returns a description of a pres rewriter.
atermpp::aterm_istream & operator>>(atermpp::aterm_istream &stream, pres &pres)
Reads a pres from a stream.
Definition io.cpp:238
pres_rewriter_type parse_pres_rewriter_type(const std::string &type)
Parses a pres rewriter type.
atermpp::aterm_ostream & operator<<(atermpp::aterm_ostream &stream, const pres &pres)
Writes the pres to a stream.
Definition io.cpp:225
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
Definition indexed_set.h:72