mCRL2
Loading...
Searching...
No Matches
lps_rewriter_tool.h
Go to the documentation of this file.
1// Author(s): Jan Friso Groote (based on mcrl2/bes/pbes_rewriter_tool.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_LPS_LPS_REWRITER_TOOL_H
13#define MCRL2_LPS_LPS_REWRITER_TOOL_H
14
15#include <set>
18
19namespace mcrl2
20{
21
22namespace lps
23{
24
25namespace tools
26{
27
29template <typename Tool>
30class lps_rewriter_tool: public Tool
31{
32 protected:
35
39 virtual std::set<lps::lps_rewriter_type> available_rewriters() const
40 {
41 std::set<lps::lps_rewriter_type> result;
42 result.insert(lps::simplify);
43 result.insert(lps::quantifier_one_point);
44 result.insert(lps::condition_one_point);
45 return result;
46 }
47
52 {
53 return lps::simplify;
54 }
55
59 void add_options(utilities::interface_description& desc)
60 {
61 Tool::add_options(desc);
62
63 utilities::interface_description::enum_argument<lps::lps_rewriter_type> arg(utilities::make_enum_argument<lps::lps_rewriter_type>("NAME"));
64
65 // Compute the available rewriters, and add the approriate arguments
67 {
68 arg.add_value(type, type==default_rewriter());
69 }
70
71 desc.add_option(
72 "lps-rewriter",
73 arg,
74 "use lps rewrite strategy NAME:",
75 'p'
76 );
77 }
78
81 void parse_options(const utilities::command_line_parser& parser)
82 {
83 Tool::parse_options(parser);
84 m_lps_rewriter_type = parser.option_argument_as<lps::lps_rewriter_type>("lps-rewriter");
85 }
86
87
88 public:
95 lps_rewriter_tool(const std::string& name,
96 const std::string& author,
97 const std::string& what_is,
98 const std::string& tool_description,
99 std::string known_issues = ""
100 )
101 : Tool(name, author, what_is, tool_description, known_issues)
102 {}
103
105 virtual ~lps_rewriter_tool() = default;
106
110 {
111 return m_lps_rewriter_type;
112 }
113};
114
115} // namespace tools
116
117} // namespace lps
118
119} // namespace mcrl2
120
121#endif // MCRL2_LPS_LPS_REWRITER_TOOL_H
Base class for filter tools that use a lps rewriter.
void parse_options(const utilities::command_line_parser &parser)
Parse non-standard options.
virtual std::set< lps::lps_rewriter_type > available_rewriters() const
Returns the types of rewriters that are available for this tool. Override this method to change the s...
virtual lps::lps_rewriter_type default_rewriter() const
Returns the default lps rewriter. Override this method to change the standard behavior.
virtual ~lps_rewriter_tool()=default
Destructor.
lps_rewriter_tool(const std::string &name, const std::string &author, const std::string &what_is, const std::string &tool_description, std::string known_issues="")
Constructor.
lps::lps_rewriter_type rewriter_type() const
Returns the rewriter type.
lps::lps_rewriter_type m_lps_rewriter_type
The type of the lps rewriter.
void add_options(utilities::interface_description &desc)
Add options to an interface description. Also includes rewriter options.
Components for command line interfaces of mCRL2 tools.
add your file description here.
lps_rewriter_type
An enumerated type for the available lps rewriters.
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
Definition indexed_set.h:72