@@ -12,109 +12,53 @@ Author: Daniel Kroening, Peter Schrammel
12
12
#ifndef CPROVER_GOTO_CHECKER_SOLVER_FACTORY_H
13
13
#define CPROVER_GOTO_CHECKER_SOLVER_FACTORY_H
14
14
15
- #include < list>
16
- #include < map>
17
15
#include < memory>
18
16
19
- #include < util/options.h>
20
-
21
- #include < goto-symex/symex_target_equation.h>
22
- #include < solvers/prop/prop.h>
23
- #include < solvers/prop/prop_conv.h>
24
- #include < solvers/sat/cnf.h>
25
- #include < solvers/sat/satcheck.h>
26
17
#include < solvers/smt2/smt2_dec.h>
27
18
19
+ class message_handlert ;
20
+ class namespacet ;
21
+ class optionst ;
22
+ class propt ;
23
+ class prop_convt ;
24
+ class symbol_tablet ;
25
+
28
26
class solver_factoryt
29
27
{
30
28
public:
31
29
solver_factoryt (
32
30
const optionst &_options,
33
31
const symbol_tablet &_symbol_table,
34
32
message_handlert &_message_handler,
35
- bool _output_xml_in_refinement)
36
- : options(_options),
37
- symbol_table (_symbol_table),
38
- ns(_symbol_table),
39
- message_handler(_message_handler),
40
- output_xml_in_refinement(_output_xml_in_refinement)
41
- {
42
- }
33
+ bool _output_xml_in_refinement);
43
34
44
35
// The solver class,
45
36
// which owns a variety of allocated objects.
46
37
class solvert
47
38
{
48
39
public:
49
- solvert ()
50
- {
51
- }
52
-
53
- explicit solvert (std::unique_ptr<prop_convt> p)
54
- : prop_conv_ptr(std::move(p))
55
- {
56
- }
57
-
58
- solvert (std::unique_ptr<prop_convt> p1, std::unique_ptr<propt> p2)
59
- : prop_ptr(std::move(p2)), prop_conv_ptr(std::move(p1))
60
- {
61
- }
62
-
63
- solvert (std::unique_ptr<prop_convt> p1, std::unique_ptr<std::ofstream> p2)
64
- : ofstream_ptr(std::move(p2)), prop_conv_ptr(std::move(p1))
65
- {
66
- }
67
-
68
- prop_convt &prop_conv () const
69
- {
70
- PRECONDITION (prop_conv_ptr != nullptr );
71
- return *prop_conv_ptr;
72
- }
73
-
74
- propt &prop () const
75
- {
76
- PRECONDITION (prop_ptr != nullptr );
77
- return *prop_ptr;
78
- }
79
-
80
- void set_prop_conv (std::unique_ptr<prop_convt> p)
81
- {
82
- prop_conv_ptr = std::move (p);
83
- }
84
-
85
- void set_prop (std::unique_ptr<propt> p)
86
- {
87
- prop_ptr = std::move (p);
88
- }
89
-
90
- void set_ofstream (std::unique_ptr<std::ofstream> p)
91
- {
92
- ofstream_ptr = std::move (p);
93
- }
40
+ solvert () = default ;
41
+ explicit solvert (std::unique_ptr<prop_convt> p);
42
+ solvert (std::unique_ptr<prop_convt> p1, std::unique_ptr<propt> p2);
43
+ solvert (std::unique_ptr<prop_convt> p1, std::unique_ptr<std::ofstream> p2);
44
+
45
+ prop_convt &prop_conv () const ;
46
+ propt &prop () const ;
47
+
48
+ void set_prop_conv (std::unique_ptr<prop_convt> p);
49
+ void set_prop (std::unique_ptr<propt> p);
50
+ void set_ofstream (std::unique_ptr<std::ofstream> p);
94
51
95
52
// the objects are deleted in the opposite order they appear below
96
53
std::unique_ptr<std::ofstream> ofstream_ptr;
97
54
std::unique_ptr<propt> prop_ptr;
98
55
std::unique_ptr<prop_convt> prop_conv_ptr;
99
56
};
100
57
101
- // returns a solvert object
102
- virtual std::unique_ptr<solvert> get_solver ()
103
- {
104
- if (options.get_bool_option (" dimacs" ))
105
- return get_dimacs ();
106
- if (options.get_bool_option (" refine" ))
107
- return get_bv_refinement ();
108
- else if (options.get_bool_option (" refine-strings" ))
109
- return get_string_refinement ();
110
- if (options.get_bool_option (" smt2" ))
111
- return get_smt2 (get_smt2_solver_type ());
112
- return get_default ();
113
- }
114
-
115
- virtual ~solver_factoryt ()
116
- {
117
- }
58
+ // / Returns a solvert object
59
+ virtual std::unique_ptr<solvert> get_solver ();
60
+
61
+ virtual ~solver_factoryt () = default ;
118
62
119
63
protected:
120
64
const optionst &options;
0 commit comments