mCRL2
Loading...
Searching...
No Matches
pbes_rewriter_type.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/pbes/pbes_rewriter_type.h
10/// \brief add your file description here.
11
12#ifndef MCRL2_PBES_PBES_REWRITER_TYPE_H
13#define MCRL2_PBES_PBES_REWRITER_TYPE_H
14
15#include "mcrl2/utilities/exception.h"
16#include <string>
17
18namespace mcrl2::pbes_system
19{
20
21/// \brief An enumerated type for the available pbes rewriters
23{
29 prover,
30 pfnf,
31 ppg,
32 srf,
33 pre_srf,
37};
38
39/// \brief Parses a pbes rewriter type
41{
42 if (type == "simplify")
43 {
45 }
46 if (type == "quantifier-all")
47 {
49 }
50 if (type == "quantifier-finite")
51 {
53 }
54 if (type == "quantifier-inside")
55 {
57 }
58 if (type == "quantifier-one-point")
59 {
61 }
62 if (type == "prover")
63 {
65 }
66 if (type == "pfnf")
67 {
69 }
70 if (type == "ppg")
71 {
73 }
74 if (type == "srf")
75 {
77 }
78 if (type == "pre-srf")
79 {
81 }
82 if (type == "prune-dataspec")
83 {
85 }
86 if (type == "bqnf-quantifier")
87 {
89 }
90 if (type == "remove-cex-variables")
91 {
93 }
94 throw mcrl2::runtime_error("unknown pbes rewriter option " + type);
95}
96
97/// \brief Prints a pbes rewriter type
99{
100 switch (type)
101 {
102 case pbes_rewriter_type::simplify:
103 return "simplify";
104 case pbes_rewriter_type::quantifier_all:
105 return "quantifier-all";
106 case pbes_rewriter_type::quantifier_finite:
107 return "quantifier-finite";
108 case pbes_rewriter_type::quantifier_inside:
109 return "quantifier-inside";
110 case pbes_rewriter_type::quantifier_one_point:
111 return "quantifier-one-point";
112 case pbes_rewriter_type::prover:
113 return "prover";
114 case pbes_rewriter_type::pfnf:
115 return "pfnf";
116 case pbes_rewriter_type::ppg:
117 return "ppg";
118 case pbes_rewriter_type::bqnf_quantifier:
119 return "bqnf-quantifier";
120 case pbes_rewriter_type::srf:
121 return "srf";
122 case pbes_rewriter_type::pre_srf:
123 return "pre-srf";
124 case pbes_rewriter_type::remove_cex_variables:
125 return "remove-cex-variables";
126 case pbes_rewriter_type::prune_dataspec:
127 return "prune-dataspec";
128 }
129
130 return "unknown pbes rewriter";
131}
132
133/// \brief Returns a description of a pbes rewriter
134inline std::string description(const pbes_rewriter_type type)
135{
136 switch (type)
137 {
138 case pbes_rewriter_type::simplify:
139 return "for simplification";
140 case pbes_rewriter_type::quantifier_all:
141 return "for eliminating all quantifiers";
142 case pbes_rewriter_type::quantifier_finite:
143 return "for eliminating finite quantifier variables";
144 case pbes_rewriter_type::quantifier_inside:
145 return "for pushing quantifiers inside";
146 case pbes_rewriter_type::quantifier_one_point:
147 return "for one point rule quantifier elimination";
148 case pbes_rewriter_type::prover:
149 return "for rewriting using a prover";
150 case pbes_rewriter_type::pfnf:
151 return "for rewriting into PFNF normal form";
152 case pbes_rewriter_type::ppg:
153 return "for rewriting into Parameterised Parity Game form";
154 case pbes_rewriter_type::srf:
155 return "for rewriting into SRF normal form";
156 case pbes_rewriter_type::pre_srf:
157 return "for rewriting into pre-SRF normal form";
158 case pbes_rewriter_type::prune_dataspec:
159 return "for removing unused data equations and mappings";
160 case pbes_rewriter_type::bqnf_quantifier:
161 return "for rewriting quantifiers over conjuncts to conjuncts of quantifiers (experimental)";
162 case pbes_rewriter_type::remove_cex_variables:
163 return "for removing counterexample variables from the right-hand side of each equation, i.e., obtaining the core of a pbes";
164 }
165
166 throw mcrl2::runtime_error("unknown pbes rewriter");
167}
168
169/// \brief Stream operator for rewriter type
170/// \param is An input stream
171/// \param t A rewriter type
172/// \return The input stream
173inline std::istream& operator>>(std::istream& is, pbes_rewriter_type& t)
174{
175 std::string s;
176 is >> s;
177 try
178 {
179 t = parse_pbes_rewriter_type(s);
180 }
181 catch (const mcrl2::runtime_error&)
182 {
183 is.setstate(std::ios_base::failbit);
184 }
185 return is;
186}
187
188inline std::ostream& operator<<(std::ostream& os, const pbes_rewriter_type t)
189{
190 os << print_pbes_rewriter_type(t);
191 return os;
192}
193
194} // namespace mcrl2::pbes_system
195
196
197
198#endif // MCRL2_PBES_PBES_REWRITER_TYPE_H
Standard exception class for reporting runtime errors.
Definition exception.h:27
pbes_rewriter_type parse_pbes_rewriter_type(const std::string &type)
Parses a pbes rewriter type.
pbes_rewriter_type
An enumerated type for the available pbes rewriters.
std::istream & operator>>(std::istream &is, pbes_rewriter_type &t)
Stream operator for rewriter type.
std::string print_pbes_rewriter_type(const pbes_rewriter_type type)
Prints a pbes rewriter type.
std::string description(const pbes_rewriter_type type)
Returns a description of a pbes rewriter.
std::size_t operator()(const std::vector< X > &v) const