mCRL2
Loading...
Searching...
No Matches
prover_tool.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/data/prover_tool.h
10/// \brief Base class for tools that use a data rewriter.
11
12#ifndef MCRL2_DATA_PROVER_TOOL_H
13#define MCRL2_DATA_PROVER_TOOL_H
14
15#include "mcrl2/data/detail/prover/solver_type.h"
16#include "mcrl2/utilities/command_line_interface.h"
17
18namespace mcrl2::data::tools
19{
20
21/// \brief Base class for tools that use a rewriter.
22template <typename Tool>
23class prover_tool: public Tool
24{
25 protected:
27
28 /// The data rewriter strategy
30
31 /// \brief Add options to an interface description. Also includes
32 /// rewriter options.
33 /// \param desc An interface description
35 {
36 Tool::add_options(desc, true); // The parameter true suppresses messages allowing the jittyp rewriter.
37
38 desc.add_option("smt-solver", utilities::make_enum_argument< smt_solver_type >("SOLVER")
39 .add_value(data::detail::smt_solver_type::solver_type_cvc)
40 .add_value(data::detail::smt_solver_type::solver_type_z3),
41 "use SOLVER to remove inconsistent paths from the internally used "
42 "BDDs (by default, no path elimination is applied):",
43 'z');
44 }
45
46 /// \brief Parse non-standard options
47 /// \param parser A command line parser
48 void parse_options(const utilities::command_line_parser& parser) override
49 {
50 Tool::parse_options(parser);
51
52 if (0 < parser.options.count("smt-solver"))
53 {
54 m_solver_type = parser.option_argument_as< smt_solver_type >("smt-solver");
55 }
56 }
57
58 public:
59
60 /// \brief Constructor.
61 prover_tool(const std::string& name,
62 const std::string& author,
63 const std::string& what_is,
64 const std::string& tool_description,
65 std::string known_issues = ""
66 )
68 {}
69
70 /// \brief Returns the rewrite strategy
71 /// \return The rewrite strategy
73 {
74 return m_solver_type;
75 }
76};
77
78} // namespace mcrl2::data::tools
79
80#endif // MCRL2_DATA_PROVER_TOOL_H
Base class for tools that use a rewriter.
Definition prover_tool.h:24
smt_solver_type solver_type() const
Returns the rewrite strategy.
Definition prover_tool.h:72
void add_options(utilities::interface_description &desc) override
Add options to an interface description. Also includes rewriter options.
Definition prover_tool.h:34
void parse_options(const utilities::command_line_parser &parser) override
Parse non-standard options.
Definition prover_tool.h:48
smt_solver_type m_solver_type
The data rewriter strategy.
Definition prover_tool.h:29
prover_tool(const std::string &name, const std::string &author, const std::string &what_is, const std::string &tool_description, std::string known_issues="")
Constructor.
Definition prover_tool.h:61
Main parsing component for command line strings as well as interface to the results of parsing....
Command line interface description component.