cprover
Toggle main menu visibility
Loading...
Searching...
No Matches
stop_on_fail_verifier.h
Go to the documentation of this file.
1
/*******************************************************************\
2
3
Module: Goto Verifier for stopping at the first failing property
4
5
Author: Daniel Kroening, Peter Schrammel
6
7
\*******************************************************************/
8
11
12
#ifndef CPROVER_GOTO_CHECKER_STOP_ON_FAIL_VERIFIER_H
13
#define CPROVER_GOTO_CHECKER_STOP_ON_FAIL_VERIFIER_H
14
15
#include "
bmc_util.h
"
16
#include "
goto_verifier.h
"
17
21
template
<
class
incremental_goto_checkerT>
22
class
stop_on_fail_verifiert
:
public
goto_verifiert
23
{
24
public
:
25
stop_on_fail_verifiert
(
26
const
optionst
&
options
,
27
ui_message_handlert
&
ui_message_handler
,
28
abstract_goto_modelt
&
goto_model
)
29
:
goto_verifiert
(
options
,
ui_message_handler
),
30
goto_model
(
goto_model
),
31
incremental_goto_checker
(
options
,
ui_message_handler
,
goto_model
)
32
{
33
properties
= std::move(
initialize_properties
(
goto_model
));
34
}
35
36
resultt
operator()
()
override
37
{
38
(void)
incremental_goto_checker
(
properties
);
39
return
determine_result
(
properties
);
40
}
41
42
void
report
()
override
43
{
44
switch
(
determine_result
(
properties
))
45
{
46
case
resultt::PASS
:
47
output_properties
(
properties
, 1,
ui_message_handler
);
48
report_success
(
ui_message_handler
);
49
incremental_goto_checker
.output_proof();
50
break
;
51
52
case
resultt::FAIL
:
53
{
54
message_building_error_trace
(
log
);
55
goto_tracet
goto_trace =
incremental_goto_checker
.build_shortest_trace();
56
output_error_trace
(
57
goto_trace,
58
incremental_goto_checker
.get_namespace(),
59
trace_optionst
(
options
),
60
ui_message_handler
);
61
report_failure
(
ui_message_handler
);
62
incremental_goto_checker
.output_error_witness(goto_trace);
63
break
;
64
}
65
66
case
resultt::UNKNOWN
:
67
report_inconclusive
(
ui_message_handler
);
68
break
;
69
70
case
resultt::ERROR
:
71
report_error
(
ui_message_handler
);
72
break
;
73
}
74
incremental_goto_checker
.report();
75
}
76
77
protected
:
78
abstract_goto_modelt
&
goto_model
;
79
incremental_goto_checkerT
incremental_goto_checker
;
80
};
81
82
#endif
// CPROVER_GOTO_CHECKER_STOP_ON_FAIL_VERIFIER_H
output_error_trace
void output_error_trace(const goto_tracet &goto_trace, const namespacet &ns, const trace_optionst &trace_options, ui_message_handlert &ui_message_handler)
Definition
bmc_util.cpp:62
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
goto_tracet
Trace of a GOTO program.
Definition
goto_trace.h:177
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
stop_on_fail_verifiert::report
void report() override
Report results.
Definition
stop_on_fail_verifier.h:42
stop_on_fail_verifiert::goto_model
abstract_goto_modelt & goto_model
Definition
stop_on_fail_verifier.h:78
stop_on_fail_verifiert::operator()
resultt operator()() override
Check whether all properties hold.
Definition
stop_on_fail_verifier.h:36
stop_on_fail_verifiert::stop_on_fail_verifiert
stop_on_fail_verifiert(const optionst &options, ui_message_handlert &ui_message_handler, abstract_goto_modelt &goto_model)
Definition
stop_on_fail_verifier.h:25
stop_on_fail_verifiert::incremental_goto_checker
incremental_goto_checkerT incremental_goto_checker
Definition
stop_on_fail_verifier.h:79
ui_message_handlert
Definition
ui_message.h:22
goto_verifier.h
Goto Verifier 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
resultt
resultt
The result of goto verifying.
Definition
properties.h:45
resultt::UNKNOWN
@ UNKNOWN
No property was violated, neither was there an error.
Definition
properties.h:47
resultt::PASS
@ PASS
No properties were violated.
Definition
properties.h:49
resultt::ERROR
@ ERROR
An error occurred during goto checking.
Definition
properties.h:53
resultt::FAIL
@ FAIL
Some properties were violated.
Definition
properties.h:51
output_properties
void output_properties(const propertiest &properties, std::size_t iterations, ui_message_handlert &ui_message_handler)
Definition
report_util.cpp:308
report_success
void report_success(ui_message_handlert &ui_message_handler)
Definition
report_util.cpp:32
report_inconclusive
void report_inconclusive(ui_message_handlert &ui_message_handler)
Definition
report_util.cpp:88
report_error
void report_error(ui_message_handlert &ui_message_handler)
Definition
report_util.cpp:116
report_failure
void report_failure(ui_message_handlert &ui_message_handler)
Definition
report_util.cpp:60
trace_optionst
Options for printing the trace using show_goto_trace.
Definition
goto_trace.h:221
goto-checker
stop_on_fail_verifier.h
Generated by
1.17.0