cprover
Toggle main menu visibility
Loading...
Searching...
No Matches
stop_on_fail_verifier_with_fault_localization.h
Go to the documentation of this file.
1
/*******************************************************************\
2
3
Module: Goto Verifier for stopping at the first failing property
4
and localizing the fault
5
6
Author: Daniel Kroening, Peter Schrammel
7
8
\*******************************************************************/
9
13
14
#ifndef CPROVER_GOTO_CHECKER_STOP_ON_FAIL_VERIFIER_WITH_FAULT_LOCALIZATION_H
15
#define CPROVER_GOTO_CHECKER_STOP_ON_FAIL_VERIFIER_WITH_FAULT_LOCALIZATION_H
16
17
#include "
bmc_util.h
"
18
#include "
fault_localization_provider.h
"
19
#include "
goto_verifier.h
"
20
24
template
<
class
incremental_goto_checkerT>
25
class
stop_on_fail_verifier_with_fault_localizationt
:
public
goto_verifiert
26
{
27
public
:
28
stop_on_fail_verifier_with_fault_localizationt
(
29
const
optionst
&
options
,
30
ui_message_handlert
&
ui_message_handler
,
31
abstract_goto_modelt
&
goto_model
)
32
:
goto_verifiert
(
options
,
ui_message_handler
),
33
goto_model
(
goto_model
),
34
incremental_goto_checker
(
options
,
ui_message_handler
,
goto_model
)
35
{
36
properties
= std::move(
initialize_properties
(
goto_model
));
37
}
38
39
resultt
operator()
()
override
40
{
41
(void)
incremental_goto_checker
(
properties
);
42
return
determine_result
(
properties
);
43
}
44
45
void
report
()
override
46
{
47
switch
(
determine_result
(
properties
))
48
{
49
case
resultt::PASS
:
50
report_success
(
ui_message_handler
);
51
break
;
52
53
case
resultt::FAIL
:
54
{
55
const
goto_tracet
goto_trace =
56
incremental_goto_checker
.build_shortest_trace();
57
const
fault_location_infot
fault_location =
58
incremental_goto_checker
.localize_fault(
59
goto_trace.
get_last_step
().
property_id
);
60
61
output_error_trace_with_fault_localization
(
62
goto_trace,
63
incremental_goto_checker
.get_namespace(),
64
trace_optionst
(
options
),
65
fault_location,
66
ui_message_handler
);
67
68
report_failure
(
ui_message_handler
);
69
break
;
70
}
71
72
case
resultt::UNKNOWN
:
73
report_inconclusive
(
ui_message_handler
);
74
break
;
75
76
case
resultt::ERROR
:
77
report_error
(
ui_message_handler
);
78
break
;
79
}
80
}
81
82
protected
:
83
abstract_goto_modelt
&
goto_model
;
84
incremental_goto_checkerT
incremental_goto_checker
;
85
};
86
87
#endif
// CPROVER_GOTO_CHECKER_STOP_ON_FAIL_VERIFIER_WITH_FAULT_LOCALIZATION_H
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_trace_stept::property_id
irep_idt property_id
Definition
goto_trace.h:123
goto_tracet
Trace of a GOTO program.
Definition
goto_trace.h:177
goto_tracet::get_last_step
goto_trace_stept & get_last_step()
Retrieves the final step in the trace for manipulation (used to fill a trace from code,...
Definition
goto_trace.h:205
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::ui_message_handler
ui_message_handlert & ui_message_handler
Definition
goto_verifier.h:54
optionst
Definition
options.h:23
stop_on_fail_verifier_with_fault_localizationt::goto_model
abstract_goto_modelt & goto_model
Definition
stop_on_fail_verifier_with_fault_localization.h:83
stop_on_fail_verifier_with_fault_localizationt::operator()
resultt operator()() override
Check whether all properties hold.
Definition
stop_on_fail_verifier_with_fault_localization.h:39
stop_on_fail_verifier_with_fault_localizationt::report
void report() override
Report results.
Definition
stop_on_fail_verifier_with_fault_localization.h:45
stop_on_fail_verifier_with_fault_localizationt::stop_on_fail_verifier_with_fault_localizationt
stop_on_fail_verifier_with_fault_localizationt(const optionst &options, ui_message_handlert &ui_message_handler, abstract_goto_modelt &goto_model)
Definition
stop_on_fail_verifier_with_fault_localization.h:28
stop_on_fail_verifier_with_fault_localizationt::incremental_goto_checker
incremental_goto_checkerT incremental_goto_checker
Definition
stop_on_fail_verifier_with_fault_localization.h:84
ui_message_handlert
Definition
ui_message.h:22
fault_localization_provider.h
Interface for Goto Checkers to provide Fault Localization.
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
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
output_error_trace_with_fault_localization
void output_error_trace_with_fault_localization(const goto_tracet &goto_trace, const namespacet &ns, const trace_optionst &trace_options, const fault_location_infot &fault_location_info, ui_message_handlert &ui_message_handler)
Definition
report_util.cpp:633
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
fault_location_infot
Definition
fault_localization_provider.h:23
trace_optionst
Options for printing the trace using show_goto_trace.
Definition
goto_trace.h:221
goto-checker
stop_on_fail_verifier_with_fault_localization.h
Generated by
1.17.0