mCRL2
Loading...
Searching...
No Matches
rewrite_strategy.h
Go to the documentation of this file.
1#ifndef MCRL2_DATA_REWRITE_STRATEGY_H
2#define MCRL2_DATA_REWRITE_STRATEGY_H
3
5#include <string>
6
7namespace mcrl2
8{
9namespace data
10{
11
14{
16#ifdef MCRL2_ENABLE_JITTYC
17 jitty_compiling,
19 jitty_compiling_prover
20#else
22#endif
23};
24
26inline
28{
29 if(s == "jitty")
30 return jitty;
31 else if (s == "jittyp")
32 return jitty_prover;
33
34#ifdef MCRL2_ENABLE_JITTYC
35 if (s == "jittyc")
36 return jitty_compiling;
37 else if (s == "jittycp")
38 return jitty_compiling_prover;
39#endif //MCRL2_ENABLE_JITTYC
40
41 throw mcrl2::runtime_error("unknown rewrite strategy " + s);
42}
43
45inline std::istream& operator>>(std::istream& is, rewrite_strategy& s)
46{
47 try
48 {
49 std::stringbuf buffer;
50 is >> &buffer;
51 s = parse_rewrite_strategy(buffer.str());
52 }
54 {
55 is.setstate(std::ios_base::failbit);
56 }
57
58 return is;
59}
60
63inline std::string pp(const rewrite_strategy s)
64{
65 switch (s)
66 {
67 case jitty: return "jitty";
68#ifdef MCRL2_ENABLE_JITTYC
69 case jitty_compiling: return "jittyc";
70#endif
71 case jitty_prover: return "jittyp";
72#ifdef MCRL2_ENABLE_JITTYC
73 case jitty_compiling_prover: return "jittycp";
74#endif
75 default: throw mcrl2::runtime_error("unknown rewrite_strategy");
76 }
77}
78
80inline std::ostream& operator<<(std::ostream& os, const rewrite_strategy s)
81{
82 os << pp(s);
83 return os;
84}
85
87inline std::string description(const rewrite_strategy s)
88{
89 switch (s)
90 {
91 case jitty: return "jitty rewriting";
92#ifdef MCRL2_ENABLE_JITTYC
93 case jitty_compiling: return "compiled jitty rewriting";
94#endif
95 case jitty_prover: return "jitty rewriting with prover";
96#ifdef MCRL2_ENABLE_JITTYC
97 case jitty_compiling_prover: return "compiled jitty rewriting with prover";
98#endif
99 default: throw mcrl2::runtime_error("unknown rewrite_strategy");
100 }
101}
102
103} // namespace data
104} // namespace mcrl2
105
106#endif // MCRL2_DATA_REWRITE_STRATEGY_H
Standard exception class for reporting runtime errors.
Definition exception.h:27
Exception classes for use in libraries and tools.
std::string description(const rewrite_strategy s)
standard descriptions for rewrite strategies
rewrite_strategy
The strategy of the rewriter.
@ jitty_prover
JITty.
std::string pp(const abstraction &x)
Definition data.cpp:39
atermpp::aterm_istream & operator>>(atermpp::aterm_istream &stream, data_specification &spec)
Reads a data specification from a stream.
Definition data_io.cpp:66
rewrite_strategy parse_rewrite_strategy(const std::string &s)
standard conversion from string to rewrite strategy
std::ostream & operator<<(std::ostream &out, const abstraction &x)
Definition abstraction.h:94
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
Definition indexed_set.h:72