CBMC
verification_result.h
Go to the documentation of this file.
1 // Copyright (c) 2023 Fotis Koutoulakis for Diffblue Ltd.
2 
5 // in a structured form.
6 
7 #ifndef CPROVER_LIBCPROVER_CPP_VERIFICATION_RESULT_H
8 #define CPROVER_LIBCPROVER_CPP_VERIFICATION_RESULT_H
9 
10 #include <map>
11 #include <memory>
12 #include <string>
13 #include <vector>
14 
15 class dstringt;
17 
18 struct property_infot;
19 using propertiest = std::map<irep_idt, property_infot>;
20 enum class resultt;
21 
22 // The enumerations here mirror the ones in properties.h.
23 // The reason we do so is that we want to expose the same information
24 // to users of the API, without including (and therefore, exposing)
25 // CBMC internal headers.
26 
27 enum class prop_statust
28 {
32  UNKNOWN,
36  PASS,
38  FAIL,
40  ERROR
41 };
42 
43 enum class verifier_resultt
44 {
45  UNKNOWN,
47  PASS,
49  FAIL,
51  ERROR
52 };
53 
55 {
61 
62  void set_result(resultt &result);
63  void set_properties(propertiest &properties);
64 
66  std::vector<std::string> get_property_ids() const;
67  std::string get_property_description(const std::string &property_id) const;
68  prop_statust get_property_status(const std::string &property_id) const;
69 
70 private:
72  std::unique_ptr<verification_result_implt> _impl;
73 };
74 
75 // Allow translation of `verifier_resultt` into a CPROVER_EXIT_CODES (so that
76 // they can be consistent across various tools using the API).
78 
79 #endif // CPROVER_GOTO_CHECKER_VERIFICATION_RESULT_H
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition: dstring.h:38
@ PASS
The property was not violated.
@ FAIL
The property was violated.
@ NOT_CHECKED
The property was not checked (also used for initialization)
std::map< irep_idt, property_infot > propertiest
A map of property IDs to property infos.
Definition: properties.h:76
resultt
The result of goto verifying.
Definition: properties.h:45
verification_resultt & operator=(verification_resultt &&)
std::vector< std::string > get_property_ids() const
void set_result(resultt &result)
std::unique_ptr< verification_result_implt > _impl
std::string get_property_description(const std::string &property_id) const
void set_properties(propertiest &properties)
prop_statust get_property_status(const std::string &property_id) const
verifier_resultt final_result() const
dstringt irep_idt
verifier_resultt
@ ERROR
An error occurred during goto checking.
prop_statust
@ UNKNOWN
The checker was unable to determine the status of the property.
@ ERROR
An error occurred during goto checking.
int verifier_result_to_exit_code(verifier_resultt result)