cprover
Toggle main menu visibility
Loading...
Searching...
No Matches
all_properties_verifier_with_trace_storage.h
Go to the documentation of this file.
1
/*******************************************************************\
2
3
Module: Goto Verifier for Verifying all Properties that stores Traces
4
5
Author: Daniel Kroening, Peter Schrammel
6
7
\*******************************************************************/
8
11
12
#ifndef CPROVER_GOTO_CHECKER_ALL_PROPERTIES_VERIFIER_WITH_TRACE_STORAGE_H
13
#define CPROVER_GOTO_CHECKER_ALL_PROPERTIES_VERIFIER_WITH_TRACE_STORAGE_H
14
15
#include <
goto-programs/abstract_goto_model.h
>
16
17
#include "
bmc_util.h
"
18
#include "
fatal_assertions.h
"
19
#include "
goto_trace_storage.h
"
20
#include "
goto_verifier.h
"
21
#include "
incremental_goto_checker.h
"
22
#include "
properties.h
"
23
#include "
report_util.h
"
24
25
template
<
class
incremental_goto_checkerT>
26
class
all_properties_verifier_with_trace_storaget
:
public
goto_verifiert
27
{
28
public
:
29
all_properties_verifier_with_trace_storaget
(
30
const
optionst
&
options
,
31
ui_message_handlert
&
ui_message_handler
,
32
abstract_goto_modelt
&
goto_model
)
33
:
goto_verifiert
(
options
,
ui_message_handler
),
34
goto_model
(
goto_model
),
35
incremental_goto_checker
(
options
,
ui_message_handler
,
goto_model
),
36
traces
(
incremental_goto_checker
.get_namespace())
37
{
38
properties
=
initialize_properties
(
goto_model
);
39
}
40
41
resultt
operator()
()
override
42
{
43
while
(
true
)
44
{
45
const
auto
result =
incremental_goto_checker
(
properties
);
46
if
(result.progress ==
incremental_goto_checkert::resultt::progresst::DONE
)
47
break
;
48
49
// we've got an error trace
50
if
(
options
.get_bool_option(
"trace"
))
51
{
52
message_building_error_trace
(
log
);
53
for
(
const
auto
&property_id : result.updated_properties)
54
{
55
if
(
properties
.at(property_id).status ==
property_statust::FAIL
)
56
{
57
// get correctly truncated error trace for property and store it
58
(void)
traces
.insert(
59
incremental_goto_checker
.build_trace(property_id));
60
}
61
}
62
}
63
64
++
iterations
;
65
}
66
67
propagate_fatal_assertions
(
properties
,
goto_model
.get_goto_functions());
68
69
return
determine_result
(
properties
);
70
}
71
72
void
report
()
override
73
{
74
if
(
options
.get_bool_option(
"trace"
))
75
{
76
const
trace_optionst
trace_options(
options
);
77
output_properties_with_traces
(
78
properties
,
traces
, trace_options,
iterations
,
ui_message_handler
);
79
}
80
else
81
{
82
output_properties
(
properties
,
iterations
,
ui_message_handler
);
83
}
84
output_overall_result
(
determine_result
(
properties
),
ui_message_handler
);
85
incremental_goto_checker
.report();
86
}
87
88
const
goto_trace_storaget
&
get_traces
()
const
89
{
90
return
traces
;
91
}
92
93
protected
:
94
abstract_goto_modelt
&
goto_model
;
95
incremental_goto_checkerT
incremental_goto_checker
;
96
std::size_t
iterations
= 1;
97
goto_trace_storaget
traces
;
98
};
99
100
#endif
// CPROVER_GOTO_CHECKER_ALL_PROPERTIES_VERIFIER_WITH_TRACE_STORAGE_H
abstract_goto_model.h
Abstract interface to eager or lazy GOTO models.
message_building_error_trace
void message_building_error_trace(messaget &log)
Outputs a message that an error trace is being built.
Definition
bmc_util.cpp:32
bmc_util.h
Bounded Model Checking Utilities.
abstract_goto_modelt
Abstract interface to eager or lazy GOTO models.
Definition
abstract_goto_model.h:22
all_properties_verifier_with_trace_storaget::report
void report() override
Report results.
Definition
all_properties_verifier_with_trace_storage.h:72
all_properties_verifier_with_trace_storaget::all_properties_verifier_with_trace_storaget
all_properties_verifier_with_trace_storaget(const optionst &options, ui_message_handlert &ui_message_handler, abstract_goto_modelt &goto_model)
Definition
all_properties_verifier_with_trace_storage.h:29
all_properties_verifier_with_trace_storaget::operator()
resultt operator()() override
Check whether all properties hold.
Definition
all_properties_verifier_with_trace_storage.h:41
all_properties_verifier_with_trace_storaget::traces
goto_trace_storaget traces
Definition
all_properties_verifier_with_trace_storage.h:97
all_properties_verifier_with_trace_storaget::iterations
std::size_t iterations
Definition
all_properties_verifier_with_trace_storage.h:96
all_properties_verifier_with_trace_storaget::incremental_goto_checker
incremental_goto_checkerT incremental_goto_checker
Definition
all_properties_verifier_with_trace_storage.h:95
all_properties_verifier_with_trace_storaget::goto_model
abstract_goto_modelt & goto_model
Definition
all_properties_verifier_with_trace_storage.h:94
all_properties_verifier_with_trace_storaget::get_traces
const goto_trace_storaget & get_traces() const
Definition
all_properties_verifier_with_trace_storage.h:88
goto_trace_storaget
Definition
goto_trace_storage.h:22
goto_verifiert::properties
propertiest properties
Definition
goto_verifier.h:56
goto_verifiert::goto_verifiert
goto_verifiert()=delete
goto_verifiert::options
const optionst & options
Definition
goto_verifier.h:53
goto_verifiert::log
messaget log
Definition
goto_verifier.h:55
goto_verifiert::ui_message_handler
ui_message_handlert & ui_message_handler
Definition
goto_verifier.h:54
optionst
Definition
options.h:23
ui_message_handlert
Definition
ui_message.h:22
propagate_fatal_assertions
void propagate_fatal_assertions(propertiest &properties, const goto_functionst &goto_functions)
Proven assertions after refuted fatal assertions are marked as UNKNOWN.
Definition
fatal_assertions.cpp:167
fatal_assertions.h
Fatal Assertions.
goto_trace_storage.h
Goto Trace Storage.
goto_verifier.h
Goto Verifier Interface.
incremental_goto_checker.h
Incremental Goto Checker Interface.
determine_result
resultt determine_result(const propertiest &properties)
Determines the overall result corresponding from the given properties That is PASS if all properties ...
Definition
properties.cpp:264
initialize_properties
propertiest initialize_properties(const abstract_goto_modelt &goto_model)
Returns the properties in the goto model.
Definition
properties.cpp:70
properties.h
Properties.
property_statust::FAIL
@ FAIL
The property was violated.
Definition
properties.h:36
resultt
resultt
The result of goto verifying.
Definition
properties.h:45
output_properties
void output_properties(const propertiest &properties, std::size_t iterations, ui_message_handlert &ui_message_handler)
Definition
report_util.cpp:308
output_overall_result
void output_overall_result(resultt result, ui_message_handlert &ui_message_handler)
Definition
report_util.cpp:677
output_properties_with_traces
void output_properties_with_traces(const propertiest &properties, const goto_trace_storaget &traces, const trace_optionst &trace_options, std::size_t iterations, ui_message_handlert &ui_message_handler)
Definition
report_util.cpp:346
report_util.h
Bounded Model Checking Utilities.
incremental_goto_checkert::resultt::progresst::DONE
@ DONE
The goto checker has returned all results for the given set of properties.
Definition
incremental_goto_checker.h:51
trace_optionst
Options for printing the trace using show_goto_trace.
Definition
goto_trace.h:221
goto-checker
all_properties_verifier_with_trace_storage.h
Generated by
1.17.0