ESBMC
Efficient SMT-based Context-Bounded Model Checker
Loading...
Searching...
No Matches
property_verdict.h
Go to the documentation of this file.
1#ifndef CPROVER_GOTO_PROGRAMS_PROPERTY_VERDICT_H
2#define CPROVER_GOTO_PROGRAMS_PROPERTY_VERDICT_H
3
6
7#include <atomic>
8#include <cstddef>
9#include <map>
10#include <mutex>
11#include <set>
12#include <string>
13
14class optionst;
15
25{
27 Passed = 1,
30};
31
35{
36 std::string file;
37 std::string function;
38 std::string description;
39 unsigned line = 0;
40 unsigned column = 0;
44 unsigned instruction = 0;
46};
47
52 const std::string &description);
53
60std::string property_key(
62 const std::string &description);
63
74
84{
85public:
93 void record(
94 const std::string &property,
95 property_verdictt verdict,
96 const property_locationt &loc,
97 const std::string &note = "");
98
106
109 void note_incomplete();
110
113 void begin_round();
114
117 {
118 incomplete = false;
119 }
120
123 bool is_incomplete() const
124 {
125 return incomplete;
126 }
127
132 bool all_passed() const;
133
135 std::size_t size() const;
136
140 bool has_violation() const
141 {
142 return violation;
143 }
144
146 std::map<std::string, property_resultt> snapshot() const;
147
149 void clear();
150
151private:
152 mutable std::mutex mutex;
153 std::map<std::string, property_resultt> results;
154 std::set<std::string> recorded_this_round;
155 std::atomic<bool> violation{false};
156 std::atomic<bool> incomplete{false};
157};
158
162bool withholds_proofs(const optionst &options);
163
164#endif
Container for an instruction of the goto-program.
Definition goto_program.h:95
Definition options.h:11
One verdict per property for a whole verification run.
Definition property_verdict.h:84
bool has_violation() const
Whether any property has been found violated.
Definition property_verdict.h:140
void promote_unchecked_to_passed()
Raises every NotChecked entry recorded since the last begin_round() or clear() to Passed.
Definition property_verdict.cpp:82
void begin_round()
Starts the round of a k-step strategy's next base case, incomplete until complete_round().
Definition property_verdict.cpp:96
std::map< std::string, property_resultt > snapshot() const
A copy of the results recorded so far, keyed by property.
Definition property_verdict.cpp:131
void clear()
Discards all verdicts.
Definition property_verdict.cpp:137
bool is_incomplete() const
Whether a phase since the last clear() or complete_round() stopped short, or the round's base case ha...
Definition property_verdict.h:123
std::size_t size() const
How many distinct properties have been checked.
Definition property_verdict.cpp:124
void note_incomplete()
Records that a phase stopped before every property reached a verdict, disarming proofs until the next...
Definition property_verdict.cpp:103
bool all_passed() const
Whether every property in the table reached Passed.
Definition property_verdict.cpp:115
void complete_round()
Records that the round's base case solved every claim it raised.
Definition property_verdict.h:116
void record(const std::string &property, property_verdictt verdict, const property_locationt &loc, const std::string &note="")
Records verdict for property at loc, annotated with note.
Definition property_verdict.cpp:58
pthread_mutex_t mutex
Definition cuda.h:49
irep_container< expr2t > expr2tc
Definition irep2.h:431
property_verdictt
Outcome of checking one property.
Definition property_verdict.h:25
@ Unknown
Definition property_verdict.h:28
@ Passed
Definition property_verdict.h:27
@ NotChecked
Definition property_verdict.h:26
@ Failed
Definition property_verdict.h:29
std::string property_key(const goto_programt::instructiont &pc, const std::string &description)
The table key for the claim description raised at pc.
Definition property_verdict.cpp:46
bool withholds_proofs(const optionst &options)
Whether a phase must leave a claim it discharges NotChecked rather than Passed: under a k-step strate...
Definition property_verdict.cpp:108
property_locationt property_location(const goto_programt::instructiont &pc, const std::string &description)
Where the claim description raised at pc lives, with the assertion's instruction and condition when t...
Definition property_verdict.cpp:32
Where a property lives, kept apart from the table key so the report can sort by source position and p...
Definition property_verdict.h:35
expr2tc condition
Definition property_verdict.h:45
std::string description
Definition property_verdict.h:38
unsigned column
Definition property_verdict.h:40
std::string function
Definition property_verdict.h:37
unsigned instruction
The asserting instruction's location_number and condition, when the property is that instruction's ow...
Definition property_verdict.h:44
unsigned line
Definition property_verdict.h:39
std::string file
Definition property_verdict.h:36
A verdict together with where it applies and a note explaining how it was reached – that a discharge ...
Definition property_verdict.h:69
property_locationt loc
Definition property_verdict.h:72
std::string note
Definition property_verdict.h:71
property_verdictt verdict
Definition property_verdict.h:70