|
| 1 | +/*******************************************************************\ |
| 2 | +
|
| 3 | +Module: Goto Verifier for Covering Goals that stores Traces |
| 4 | +
|
| 5 | +Author: Daniel Kroening, Peter Schrammel |
| 6 | +
|
| 7 | +\*******************************************************************/ |
| 8 | + |
| 9 | +/// \file |
| 10 | +/// Goto verifier for covering goals that stores traces |
| 11 | + |
| 12 | +#ifndef CPROVER_GOTO_CHECKER_COVER_GOALS_VERIFIER_WITH_TRACE_STORAGE_H |
| 13 | +#define CPROVER_GOTO_CHECKER_COVER_GOALS_VERIFIER_WITH_TRACE_STORAGE_H |
| 14 | + |
| 15 | +#include "goto_verifier.h" |
| 16 | + |
| 17 | +#include "cover_goals_report_util.h" |
| 18 | +#include "goto_trace_storage.h" |
| 19 | +#include "incremental_goto_checker.h" |
| 20 | +#include "properties.h" |
| 21 | + |
| 22 | +template <class incremental_goto_checkerT> |
| 23 | +class cover_goals_verifier_with_trace_storaget : public goto_verifiert |
| 24 | +{ |
| 25 | +public: |
| 26 | + cover_goals_verifier_with_trace_storaget( |
| 27 | + const optionst &options, |
| 28 | + ui_message_handlert &ui_message_handler, |
| 29 | + abstract_goto_modelt &goto_model) |
| 30 | + : goto_verifiert(options, ui_message_handler), |
| 31 | + goto_model(goto_model), |
| 32 | + incremental_goto_checker(options, ui_message_handler, goto_model), |
| 33 | + traces(incremental_goto_checker.get_namespace()) |
| 34 | + { |
| 35 | + properties = initialize_properties(goto_model); |
| 36 | + } |
| 37 | + |
| 38 | + resultt operator()() override |
| 39 | + { |
| 40 | + while(incremental_goto_checker(properties).progress != |
| 41 | + incremental_goto_checkert::resultt::progresst::DONE) |
| 42 | + { |
| 43 | + // we've got a trace; store it and link it to the covered goals |
| 44 | + (void)traces.insert_all(incremental_goto_checker.build_trace()); |
| 45 | + |
| 46 | + ++iterations; |
| 47 | + } |
| 48 | + |
| 49 | + return determine_result(properties); |
| 50 | + } |
| 51 | + |
| 52 | + void report() override |
| 53 | + { |
| 54 | + output_goals(properties, iterations, ui_message_handler); |
| 55 | + } |
| 56 | + |
| 57 | + const goto_trace_storaget &get_traces() const |
| 58 | + { |
| 59 | + return traces; |
| 60 | + } |
| 61 | + |
| 62 | +protected: |
| 63 | + abstract_goto_modelt &goto_model; |
| 64 | + incremental_goto_checkerT incremental_goto_checker; |
| 65 | + unsigned iterations = 1; |
| 66 | + goto_trace_storaget traces; |
| 67 | +}; |
| 68 | + |
| 69 | +#endif // CPROVER_GOTO_CHECKER_COVER_GOALS_VERIFIER_WITH_TRACE_STORAGE_H |
0 commit comments