CBMC
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"
19 #include "goto_verifier.h"
20 
24 template <class incremental_goto_checkerT>
26 {
27 public:
29  const optionst &options,
35  {
37  }
38 
39  resultt operator()() override
40  {
43  }
44 
45  void report() override
46  {
48  {
49  case resultt::PASS:
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 
62  goto_trace,
63  incremental_goto_checker.get_namespace(),
65  fault_location,
67 
69  break;
70  }
71 
72  case resultt::UNKNOWN:
74  break;
75 
76  case resultt::ERROR:
78  break;
79  }
80  }
81 
82 protected:
84  incremental_goto_checkerT incremental_goto_checker;
85 };
86 
87 #endif // CPROVER_GOTO_CHECKER_STOP_ON_FAIL_VERIFIER_WITH_FAULT_LOCALIZATION_H
ui_message_handlert
Definition: ui_message.h:21
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
resultt
resultt
The result of goto verifying.
Definition: properties.h:44
goto_verifiert
An implementation of goto_verifiert checks all properties in a goto model.
Definition: goto_verifier.h:26
stop_on_fail_verifier_with_fault_localizationt::report
void report() override
Report results.
Definition: stop_on_fail_verifier_with_fault_localization.h:45
optionst
Definition: options.h:22
goto_verifier.h
report_inconclusive
void report_inconclusive(ui_message_handlert &ui_message_handler)
Definition: report_util.cpp:88
fault_location_infot
Definition: fault_localization_provider.h:22
resultt::PASS
@ PASS
No properties were violated.
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
resultt::UNKNOWN
@ UNKNOWN
No property was violated, neither was there an error.
resultt::FAIL
@ FAIL
Some properties were violated.
initialize_properties
propertiest initialize_properties(const abstract_goto_modelt &goto_model)
Returns the properties in the goto model.
Definition: properties.cpp:70
bmc_util.h
report_error
void report_error(ui_message_handlert &ui_message_handler)
Definition: report_util.cpp:116
stop_on_fail_verifier_with_fault_localizationt::goto_model
abstract_goto_modelt & goto_model
Definition: stop_on_fail_verifier_with_fault_localization.h:83
report_failure
void report_failure(ui_message_handlert &ui_message_handler)
Definition: report_util.cpp:60
goto_verifiert::options
const optionst & options
Definition: goto_verifier.h:53
resultt::ERROR
@ ERROR
An error occurred during goto checking.
goto_trace_stept::property_id
irep_idt property_id
Definition: goto_trace.h:122
report_success
void report_success(ui_message_handlert &ui_message_handler)
Definition: report_util.cpp:32
fault_localization_provider.h
trace_optionst
Options for printing the trace using show_goto_trace.
Definition: goto_trace.h:218
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
goto_tracet
Trace of a GOTO program.
Definition: goto_trace.h:174
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
abstract_goto_modelt
Abstract interface to eager or lazy GOTO models.
Definition: abstract_goto_model.h:20
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
stop_on_fail_verifier_with_fault_localizationt
Stops when the first failing property is found and localizes the fault Requires an incremental goto c...
Definition: stop_on_fail_verifier_with_fault_localization.h:25
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:203
goto_verifiert::ui_message_handler
ui_message_handlert & ui_message_handler
Definition: goto_verifier.h:54
goto_verifiert::properties
propertiest properties
Definition: goto_verifier.h:56