CBMC
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 
16 
17 #include "bmc_util.h"
18 #include "fatal_assertions.h"
19 #include "goto_trace_storage.h"
20 #include "goto_verifier.h"
22 #include "properties.h"
23 #include "report_util.h"
24 
25 template <class incremental_goto_checkerT>
27 {
28 public:
30  const optionst &options,
36  traces(incremental_goto_checker.get_namespace())
37  {
39  }
40 
41  resultt operator()() override
42  {
43  while(true)
44  {
45  const auto result = incremental_goto_checker(properties);
47  break;
48 
49  // we've got an error trace
50  if(options.get_bool_option("trace"))
51  {
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 
68 
70  }
71 
72  void report() override
73  {
74  if(options.get_bool_option("trace"))
75  {
76  const trace_optionst trace_options(options);
79  }
80  else
81  {
83  }
85  incremental_goto_checker.report();
86  }
87 
89  {
90  return traces;
91  }
92 
93 protected:
95  incremental_goto_checkerT incremental_goto_checker;
96  std::size_t iterations = 1;
98 };
99 
100 #endif // CPROVER_GOTO_CHECKER_ALL_PROPERTIES_VERIFIER_WITH_TRACE_STORAGE_H
Abstract interface to eager or lazy GOTO models.
void message_building_error_trace(messaget &log)
Outputs a message that an error trace is being built.
Definition: bmc_util.cpp:35
Bounded Model Checking Utilities.
Abstract interface to eager or lazy GOTO models.
virtual const goto_functionst & get_goto_functions() const =0
Accessor to get a raw goto_functionst.
all_properties_verifier_with_trace_storaget(const optionst &options, ui_message_handlert &ui_message_handler, abstract_goto_modelt &goto_model)
resultt operator()() override
Check whether all properties hold.
const goto_tracet & insert(goto_tracet &&)
Store trace that ends in a violated assertion.
An implementation of goto_verifiert checks all properties in a goto model.
Definition: goto_verifier.h:27
propertiest properties
Definition: goto_verifier.h:56
const optionst & options
Definition: goto_verifier.h:53
ui_message_handlert & ui_message_handler
Definition: goto_verifier.h:54
bool get_bool_option(const std::string &option) const
Definition: options.cpp:44
void propagate_fatal_assertions(propertiest &properties, const goto_functionst &goto_functions)
Proven assertions after refuted fatal assertions are marked as UNKNOWN.
Fatal Assertions.
Goto Trace Storage.
Goto Verifier Interface.
Incremental Goto Checker Interface.
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
propertiest initialize_properties(const abstract_goto_modelt &goto_model)
Returns the properties in the goto model.
Definition: properties.cpp:70
Properties.
@ FAIL
The property was violated.
resultt
The result of goto verifying.
Definition: properties.h:45
void output_properties(const propertiest &properties, std::size_t iterations, ui_message_handlert &ui_message_handler)
void output_overall_result(resultt result, ui_message_handlert &ui_message_handler)
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)
Bounded Model Checking Utilities.
@ DONE
The goto checker has returned all results for the given set of properties.
Options for printing the trace using show_goto_trace.
Definition: goto_trace.h:221