mCRL2
Loading...
Searching...
No Matches
solver_type.h
Go to the documentation of this file.
1// Author(s): Jeroen Keiren
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_DATA_DETAIL_PROVER_SOLVER_TYPE_H
13#define MCRL2_DATA_DETAIL_PROVER_SOLVER_TYPE_H
14
16#include <string>
17
18namespace mcrl2
19{
20namespace data
21{
22namespace detail
23{
24
27{
30};
31
33inline
35{
36 if(s == "cvc") return solver_type_cvc;
37 else if(s == "z3") return solver_type_z3;
38 else throw mcrl2::runtime_error("unknown solver type " + s);
39}
40
42inline
43std::istream& operator>>(std::istream& is, smt_solver_type& s)
44{
45 try
46 {
47 std::string str;
48 is >> str;
49 s = parse_solver_type(str);
50 }
52 {
53 is.setstate(std::ios_base::failbit);
54 }
55 return is;
56}
57
59inline
61{
62 switch(s)
63 {
64 case solver_type_cvc: return "cvc";
65 case solver_type_z3: return "z3";
66 default: throw mcrl2::runtime_error("unknown solver type");
67 }
68}
69
71inline std::ostream& operator<<(std::ostream& os,smt_solver_type s)
72{
73 os << print_solver_type(s);
74 return os;
75}
76
78inline
79std::string description(const smt_solver_type s)
80{
81 switch(s)
82 {
83 case solver_type_cvc: return "the SMT solver CVC3";
84 case solver_type_z3: return "the SMT solver Z3";
85 default: throw mcrl2::runtime_error("unknown solver type");
86 }
87}
88
89} // namespace detail
90} // namespace data
91} // namespace mcrl2
92
93#endif // MCRL2_DATA_DETAIL_PROVER_SOLVER_TYPE_H
Standard exception class for reporting runtime errors.
Definition exception.h:27
Exception classes for use in libraries and tools.
smt_solver_type
The enumeration type smt_solver_type enumerates all available SMT solvers.
Definition solver_type.h:27
std::string print_solver_type(const smt_solver_type s)
standard conversion from solver type to string
Definition solver_type.h:60
std::istream & operator>>(std::istream &is, smt_solver_type &s)
standard conversion from stream to solver type
Definition solver_type.h:43
std::string description(const smt_solver_type s)
description of solver type
Definition solver_type.h:79
std::ostream & operator<<(std::ostream &os, smt_solver_type s)
standard conversion from solvert type to stream
Definition solver_type.h:71
smt_solver_type parse_solver_type(const std::string &s)
standard conversion from string to solver type
Definition solver_type.h:34
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
Definition indexed_set.h:72