cprover
Toggle main menu visibility
Loading...
Searching...
No Matches
api.h
Go to the documentation of this file.
1
// Author: Fotis Koutoulakis for Diffblue Ltd.
2
3
#ifndef CPROVER_LIBCPROVER_CPP_API_H
4
#define CPROVER_LIBCPROVER_CPP_API_H
5
6
#include <memory>
7
#include <string>
8
#include <vector>
9
10
// Forward declaration of API dependencies
11
struct
api_session_implementationt
;
12
13
// There has been a design decision to allow users to include all of
14
// the API headers by just including `api.h`, so we want to have an
15
// include for all the API headers below. If we get any auxiliary
16
// development tools complaining about the includes, please use
17
// a pragma like below to silence the warning (at least as long
18
// as the design principle is to be followed.)
19
20
#include "
api_options.h
"
// IWYU pragma: keep
21
#include "
verification_result.h
"
// IWYU pragma: keep
22
25
struct
api_messaget
;
26
31
const
char
*
api_message_get_string
(
const
api_messaget
&message);
32
34
bool
api_message_is_error
(
const
api_messaget
&message);
35
40
using
api_call_back_contextt
=
void
*;
41
50
using
api_message_callbackt
= void (*)(
51
const
api_messaget
&message,
52
api_call_back_contextt
call_back_context);
53
54
// An object in the pattern of Session Facade - owning all of the memory
55
// the API is using and being responsible for the management of that.
56
struct
api_sessiont
57
{
58
// Initialising constructor
59
api_sessiont
();
60
explicit
api_sessiont
(
const
api_optionst
&options);
61
~api_sessiont
();
// default constructed in the .cpp file
62
67
void
set_message_callback
(
68
api_message_callbackt
callback,
69
api_call_back_contextt
context);
70
73
void
load_model_from_files
(
const
std::vector<std::string> &files)
const
;
74
75
// Run the verification engine against previously loaded model and return
76
// results object pointer.
77
std::unique_ptr<verification_resultt>
verify_model
()
const
;
78
80
void
drop_unused_functions
()
const
;
81
83
void
validate_goto_model
()
const
;
84
86
std::unique_ptr<std::string>
get_api_version
()
const
;
87
90
std::unique_ptr<verification_resultt>
run_verifier
()
const
;
91
94
void
read_goto_binary
(std::string &
file
)
const
;
95
97
bool
is_goto_binary
(std::string &
file
)
const
;
98
99
private
:
100
std::unique_ptr<api_session_implementationt>
implementation
;
101
106
bool
preprocess_model
()
const
;
107
};
108
109
#endif
api_message_callbackt
void(*)( const api_messaget &message, api_call_back_contextt call_back_context) api_message_callbackt
The type of call back for feedback of status information and results.
Definition
api.h:50
api_message_is_error
bool api_message_is_error(const api_messaget &message)
Definition
api.cpp:87
api_message_get_string
const char * api_message_get_string(const api_messaget &message)
Given a api_message, this function returns that message expressed as a C language string.
Definition
api.cpp:82
api_call_back_contextt
void * api_call_back_contextt
The type of pointers to contextual data passed to the api_message_callback functions.
Definition
api.h:40
api_options.h
api_optionst
Definition
api_options.h:11
api_messaget
Definition
api.cpp:77
api_session_implementationt
Definition
api.cpp:43
api_sessiont::get_api_version
std::unique_ptr< std::string > get_api_version() const
A simple API version information function.
Definition
api.cpp:37
api_sessiont::run_verifier
std::unique_ptr< verification_resultt > run_verifier() const
Process the model by running symex and the decision procedure.
Definition
api.cpp:223
api_sessiont::preprocess_model
bool preprocess_model() const
Implement necessary transformations to reduce model to symex-ready-GOTO, before being fed to symex.
Definition
api.cpp:178
api_sessiont::load_model_from_files
void load_model_from_files(const std::vector< std::string > &files) const
Load a goto_model from a given vector of filenames.
Definition
api.cpp:136
api_sessiont::is_goto_binary
bool is_goto_binary(std::string &file) const
True if file is goto-binary.
Definition
api.cpp:173
api_sessiont::verify_model
std::unique_ptr< verification_resultt > verify_model() const
Definition
api.cpp:143
api_sessiont::set_message_callback
void set_message_callback(api_message_callbackt callback, api_call_back_contextt context)
Definition
api.cpp:128
api_sessiont::drop_unused_functions
void drop_unused_functions() const
Drop unused functions from the loaded goto_model simplifying it.
Definition
api.cpp:243
api_sessiont::validate_goto_model
void validate_goto_model() const
Validate the loaded goto model.
Definition
api.cpp:258
api_sessiont::implementation
std::unique_ptr< api_session_implementationt > implementation
Definition
api.h:100
api_sessiont::api_sessiont
api_sessiont()
Definition
api.cpp:49
api_sessiont::~api_sessiont
~api_sessiont()
api_sessiont::read_goto_binary
void read_goto_binary(std::string &file) const
Read a goto-binary from a given filename.
Definition
api.cpp:156
file
Definition
kdev_t.h:19
verification_result.h
Interface for the various verification engines providing results.
libcprover-cpp
api.h
Generated by
1.17.0