@@ -21,44 +21,44 @@ class smt_base_solver_processt
21
21
22
22
// / \brief Converts given SMT2 command to SMT2 string and sends it to the
23
23
// / solver process.
24
- virtual void send (const smt_commandt &command) = 0 ;
24
+ virtual void send (const smt_commandt &smt_command) ;
25
25
26
26
virtual smt_responset
27
27
receive_response (const std::unordered_map<irep_idt, smt_identifier_termt>
28
28
&identifier_table) = 0 ;
29
29
30
30
virtual ~smt_base_solver_processt () = default ;
31
+
32
+ protected:
33
+ virtual void send (const std::string &)
34
+ {
35
+ }
31
36
};
32
37
33
- class smt_piped_solver_processt : public smt_base_solver_processt
38
+ class smt_piped_solver_processt : public virtual smt_base_solver_processt
34
39
{
35
40
public:
36
41
// / \param command_line:
37
42
// / The command and arguments for invoking the smt2 solver.
38
43
// / \param message_handler:
39
44
// / The messaging system to be used for logging purposes.
40
- // / \param out_stream:
41
- // / Pointer to the stream to print the SMT formula. `nullptr` if no output.
42
45
smt_piped_solver_processt (
43
46
std::string command_line,
44
- message_handlert &message_handler,
45
- std::unique_ptr<std::ostream> out_stream);
47
+ message_handlert &message_handler);
46
48
47
49
std::string description () override ;
48
50
49
- void send (const smt_commandt &smt_command) override ;
50
-
51
51
smt_responset receive_response (
52
52
const std::unordered_map<irep_idt, smt_identifier_termt> &identifier_table)
53
53
override ;
54
54
55
55
~smt_piped_solver_processt () override = default ;
56
56
57
57
protected:
58
+ void send (const std::string &command_string) override ;
59
+
58
60
// / The command line used to start the process.
59
61
std::string command_line_description;
60
- // / Pointer to the stream to print the SMT formula. `nullptr` if no output.
61
- std::unique_ptr<std::ostream> out_stream;
62
62
// / The raw solver sub process.
63
63
piped_processt process;
64
64
// / For buffering / combining communications from the solver to cbmc.
@@ -69,7 +69,7 @@ class smt_piped_solver_processt : public smt_base_solver_processt
69
69
70
70
// / Class for an incremental SMT solver used in combination with `--outfile`
71
71
// / argument where the solver is never run.
72
- class smt_incremental_dry_run_solvert : public smt_base_solver_processt
72
+ class smt_incremental_dry_run_solvert : public virtual smt_base_solver_processt
73
73
{
74
74
public:
75
75
// / \param message_handler:
@@ -85,8 +85,6 @@ class smt_incremental_dry_run_solvert : public smt_base_solver_processt
85
85
86
86
std::string description () override ;
87
87
88
- void send (const smt_commandt &smt_command) override ;
89
-
90
88
// / \note This function returns always a valid unsat response.
91
89
smt_responset receive_response (
92
90
const std::unordered_map<irep_idt, smt_identifier_termt> &identifier_table)
@@ -95,11 +93,39 @@ class smt_incremental_dry_run_solvert : public smt_base_solver_processt
95
93
~smt_incremental_dry_run_solvert () override = default ;
96
94
97
95
protected:
96
+ void send (const std::string &smt_command) override ;
97
+
98
98
// / Pointer to the file stream to print the SMT formula. `nullptr` if output
99
99
// / is to `std::cout`.
100
100
std::unique_ptr<std::ostream> file_stream;
101
101
// / The output stream reference to print the SMT formula to.
102
102
std::ostream &out_stream;
103
103
};
104
104
105
+ class smt_piped_solver_process_with_dumpt : public smt_piped_solver_processt ,
106
+ smt_incremental_dry_run_solvert
107
+ {
108
+ public:
109
+ // / \param command_line:
110
+ // / The command and arguments for invoking the smt2 solver.
111
+ // / \param message_handler:
112
+ // / The messaging system to be used for logging purposes.
113
+ // / \param out_stream:
114
+ // / Pointer to the stream to print the SMT formula.
115
+ smt_piped_solver_process_with_dumpt (
116
+ std::string command_line,
117
+ message_handlert &message_handler,
118
+ std::unique_ptr<std::ostream> out_stream);
119
+
120
+ void send (const std::string &smt_command) override ;
121
+
122
+ std::string description () override ;
123
+
124
+ smt_responset receive_response (
125
+ const std::unordered_map<irep_idt, smt_identifier_termt> &identifier_table)
126
+ override ;
127
+
128
+ ~smt_piped_solver_process_with_dumpt () override = default ;
129
+ };
130
+
105
131
#endif // CPROVER_SOLVERS_SMT2_INCREMENTAL_SMT_SOLVER_PROCESS_H
0 commit comments