cprover
Toggle main menu visibility
Loading...
Searching...
No Matches
smt_solver_process.h
Go to the documentation of this file.
1
// Author: Diffblue Ltd.
2
3
#ifndef CPROVER_SOLVERS_SMT2_INCREMENTAL_SMT_SOLVER_PROCESS_H
4
#define CPROVER_SOLVERS_SMT2_INCREMENTAL_SMT_SOLVER_PROCESS_H
5
6
class
smt_commandt
;
7
8
#include <
util/message.h
>
9
#include <
util/piped_process.h
>
10
11
#include <
solvers/smt2_incremental/ast/smt_responses.h
>
12
13
#include <memory>
14
#include <sstream>
15
#include <string>
16
17
class
smt_base_solver_processt
18
{
19
public
:
20
virtual
const
std::string &
description
() = 0;
21
24
virtual
void
send
(
const
smt_commandt
&command) = 0;
25
26
virtual
smt_responset
27
receive_response
(
const
std::unordered_map<irep_idt, smt_identifier_termt>
28
&identifier_table) = 0;
29
30
virtual
~smt_base_solver_processt
() =
default
;
31
};
32
33
class
smt_piped_solver_processt
:
public
smt_base_solver_processt
34
{
35
public
:
42
smt_piped_solver_processt
(
43
std::string command_line,
44
message_handlert
&message_handler,
45
std::unique_ptr<std::ostream>
out_stream
);
46
47
const
std::string &
description
()
override
;
48
49
void
send
(
const
smt_commandt
&smt_command)
override
;
50
51
smt_responset
receive_response
(
52
const
std::unordered_map<irep_idt, smt_identifier_termt> &identifier_table)
53
override
;
54
55
~smt_piped_solver_processt
()
override
=
default
;
56
57
protected
:
59
std::string
command_line_description
;
61
std::unique_ptr<std::ostream>
out_stream
;
63
piped_processt
process
;
65
std::stringstream
response_stream
;
67
messaget
log
;
68
};
69
72
class
smt_incremental_dry_run_solvert
:
public
smt_base_solver_processt
73
{
74
public
:
82
smt_incremental_dry_run_solvert
(
83
message_handlert
&message_handler,
84
std::ostream &
out_stream
,
85
std::unique_ptr<std::ostream>
file_stream
);
86
87
const
std::string &
description
()
override
;
88
89
void
send
(
const
smt_commandt
&smt_command)
override
;
90
92
smt_responset
receive_response
(
93
const
std::unordered_map<irep_idt, smt_identifier_termt> &identifier_table)
94
override
;
95
96
~smt_incremental_dry_run_solvert
()
override
=
default
;
97
98
protected
:
101
std::unique_ptr<std::ostream>
file_stream
;
103
std::ostream &
out_stream
;
105
messaget
log
;
106
108
const
std::string
desc
=
"SMT2 incremental dry-run"
;
109
};
110
111
#endif
// CPROVER_SOLVERS_SMT2_INCREMENTAL_SMT_SOLVER_PROCESS_H
message_handlert
Definition
message.h:27
messaget
Class that provides messages with a built-in verbosity 'level'.
Definition
message.h:154
piped_processt
Definition
piped_process.h:26
smt_base_solver_processt
Definition
smt_solver_process.h:18
smt_base_solver_processt::send
virtual void send(const smt_commandt &command)=0
Converts given SMT2 command to SMT2 string and sends it to the solver process.
smt_base_solver_processt::~smt_base_solver_processt
virtual ~smt_base_solver_processt()=default
smt_base_solver_processt::receive_response
virtual smt_responset receive_response(const std::unordered_map< irep_idt, smt_identifier_termt > &identifier_table)=0
smt_base_solver_processt::description
virtual const std::string & description()=0
smt_commandt
Definition
smt_commands.h:15
smt_incremental_dry_run_solvert::description
const std::string & description() override
Definition
smt_solver_process.cpp:93
smt_incremental_dry_run_solvert::receive_response
smt_responset receive_response(const std::unordered_map< irep_idt, smt_identifier_termt > &identifier_table) override
Definition
smt_solver_process.cpp:103
smt_incremental_dry_run_solvert::send
void send(const smt_commandt &smt_command) override
Converts given SMT2 command to SMT2 string and sends it to the solver process.
Definition
smt_solver_process.cpp:98
smt_incremental_dry_run_solvert::file_stream
std::unique_ptr< std::ostream > file_stream
Pointer to the file stream to print the SMT formula.
Definition
smt_solver_process.h:101
smt_incremental_dry_run_solvert::out_stream
std::ostream & out_stream
The output stream reference to print the SMT formula to.
Definition
smt_solver_process.h:103
smt_incremental_dry_run_solvert::log
messaget log
For debug printing.
Definition
smt_solver_process.h:105
smt_incremental_dry_run_solvert::smt_incremental_dry_run_solvert
smt_incremental_dry_run_solvert(message_handlert &message_handler, std::ostream &out_stream, std::unique_ptr< std::ostream > file_stream)
Definition
smt_solver_process.cpp:83
smt_incremental_dry_run_solvert::desc
const std::string desc
Description of the current solver.
Definition
smt_solver_process.h:108
smt_incremental_dry_run_solvert::~smt_incremental_dry_run_solvert
~smt_incremental_dry_run_solvert() override=default
smt_piped_solver_processt::log
messaget log
For debug printing.
Definition
smt_solver_process.h:67
smt_piped_solver_processt::command_line_description
std::string command_line_description
The command line used to start the process.
Definition
smt_solver_process.h:59
smt_piped_solver_processt::send
void send(const smt_commandt &smt_command) override
Converts given SMT2 command to SMT2 string and sends it to the solver process.
Definition
smt_solver_process.cpp:28
smt_piped_solver_processt::~smt_piped_solver_processt
~smt_piped_solver_processt() override=default
smt_piped_solver_processt::description
const std::string & description() override
Definition
smt_solver_process.cpp:23
smt_piped_solver_processt::response_stream
std::stringstream response_stream
For buffering / combining communications from the solver to cbmc.
Definition
smt_solver_process.h:65
smt_piped_solver_processt::smt_piped_solver_processt
smt_piped_solver_processt(std::string command_line, message_handlert &message_handler, std::unique_ptr< std::ostream > out_stream)
Definition
smt_solver_process.cpp:12
smt_piped_solver_processt::receive_response
smt_responset receive_response(const std::unordered_map< irep_idt, smt_identifier_termt > &identifier_table) override
Definition
smt_solver_process.cpp:67
smt_piped_solver_processt::out_stream
std::unique_ptr< std::ostream > out_stream
Pointer to the stream to print the SMT formula. nullptr if no output.
Definition
smt_solver_process.h:61
smt_piped_solver_processt::process
piped_processt process
The raw solver sub process.
Definition
smt_solver_process.h:63
smt_responset
Definition
smt_responses.h:11
piped_process.h
Subprocess communication with pipes.
smt_responses.h
message.h
solvers
smt2_incremental
smt_solver_process.h
Generated by
1.17.0