-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3191 from sonodtt/goto_programs-validation
Goto programs validation
- Loading branch information
Showing
19 changed files
with
754 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,24 +53,25 @@ Author: Daniel Kroening, [email protected] | |
#include <goto-programs/loop_ids.h> | ||
#include <goto-programs/mm_io.h> | ||
#include <goto-programs/read_goto_binary.h> | ||
#include <goto-programs/remove_complex.h> | ||
#include <goto-programs/remove_function_pointers.h> | ||
#include <goto-programs/remove_returns.h> | ||
#include <goto-programs/remove_vector.h> | ||
#include <goto-programs/remove_complex.h> | ||
#include <goto-programs/remove_unused_functions.h> | ||
#include <goto-programs/remove_skip.h> | ||
#include <goto-programs/remove_unused_functions.h> | ||
#include <goto-programs/remove_vector.h> | ||
#include <goto-programs/rewrite_union.h> | ||
#include <goto-programs/set_properties.h> | ||
#include <goto-programs/show_goto_functions.h> | ||
#include <goto-programs/show_symbol_table.h> | ||
#include <goto-programs/show_properties.h> | ||
#include <goto-programs/show_symbol_table.h> | ||
#include <goto-programs/string_abstraction.h> | ||
#include <goto-programs/string_instrumentation.h> | ||
#include <goto-programs/validate_goto_model.h> | ||
|
||
#include <goto-instrument/reachability_slicer.h> | ||
#include <goto-instrument/cover.h> | ||
#include <goto-instrument/full_slicer.h> | ||
#include <goto-instrument/nondet_static.h> | ||
#include <goto-instrument/cover.h> | ||
#include <goto-instrument/reachability_slicer.h> | ||
|
||
#include <goto-symex/path_storage.h> | ||
|
||
|
@@ -550,7 +551,7 @@ int cbmc_parse_optionst::doit() | |
|
||
if(cmdline.isset("validate-goto-model")) | ||
{ | ||
goto_model.validate(validation_modet::INVARIANT); | ||
goto_model.validate(); | ||
} | ||
|
||
if( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,7 @@ Author: Daniel Kroening, [email protected] | |
#include <goto-programs/set_properties.h> | ||
#include <goto-programs/show_properties.h> | ||
#include <goto-programs/show_symbol_table.h> | ||
#include <goto-programs/validate_goto_model.h> | ||
|
||
#include <analyses/is_threaded.h> | ||
#include <analyses/goto_check.h> | ||
|
@@ -405,7 +406,7 @@ int goto_analyzer_parse_optionst::doit() | |
|
||
if(cmdline.isset("validate-goto-model")) | ||
{ | ||
goto_model.validate(validation_modet::INVARIANT); | ||
goto_model.validate(); | ||
} | ||
|
||
// show it? | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,25 +25,26 @@ Author: Daniel Kroening, [email protected] | |
|
||
#include <goto-programs/class_hierarchy.h> | ||
#include <goto-programs/goto_convert_functions.h> | ||
#include <goto-programs/remove_calls_no_body.h> | ||
#include <goto-programs/remove_function_pointers.h> | ||
#include <goto-programs/remove_virtual_functions.h> | ||
#include <goto-programs/remove_skip.h> | ||
#include <goto-programs/goto_inline.h> | ||
#include <goto-programs/show_properties.h> | ||
#include <goto-programs/set_properties.h> | ||
#include <goto-programs/read_goto_binary.h> | ||
#include <goto-programs/write_goto_binary.h> | ||
#include <goto-programs/interpreter.h> | ||
#include <goto-programs/string_abstraction.h> | ||
#include <goto-programs/string_instrumentation.h> | ||
#include <goto-programs/loop_ids.h> | ||
#include <goto-programs/link_to_library.h> | ||
#include <goto-programs/loop_ids.h> | ||
#include <goto-programs/parameter_assignments.h> | ||
#include <goto-programs/read_goto_binary.h> | ||
#include <goto-programs/remove_calls_no_body.h> | ||
#include <goto-programs/remove_function_pointers.h> | ||
#include <goto-programs/remove_returns.h> | ||
#include <goto-programs/remove_skip.h> | ||
#include <goto-programs/remove_unused_functions.h> | ||
#include <goto-programs/parameter_assignments.h> | ||
#include <goto-programs/slice_global_inits.h> | ||
#include <goto-programs/remove_virtual_functions.h> | ||
#include <goto-programs/set_properties.h> | ||
#include <goto-programs/show_properties.h> | ||
#include <goto-programs/show_symbol_table.h> | ||
#include <goto-programs/slice_global_inits.h> | ||
#include <goto-programs/string_abstraction.h> | ||
#include <goto-programs/string_instrumentation.h> | ||
#include <goto-programs/validate_goto_model.h> | ||
#include <goto-programs/write_goto_binary.h> | ||
|
||
#include <pointer-analysis/value_set_analysis.h> | ||
#include <pointer-analysis/goto_program_dereference.h> | ||
|
@@ -147,7 +148,7 @@ int goto_instrument_parse_optionst::doit() | |
|
||
if(cmdline.isset("validate-goto-model")) | ||
{ | ||
goto_model.validate(validation_modet::INVARIANT); | ||
goto_model.validate(); | ||
} | ||
|
||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ Author: Daniel Kroening, [email protected] | |
|
||
#include "abstract_goto_model.h" | ||
#include "goto_functions.h" | ||
#include "validate_goto_model.h" | ||
|
||
// A model is a pair consisting of a symbol table | ||
// and the CFGs for the functions. | ||
|
@@ -94,10 +95,18 @@ class goto_modelt : public abstract_goto_modelt | |
/// | ||
/// The validation mode indicates whether well-formedness check failures are | ||
/// reported via DATA_INVARIANT violations or exceptions. | ||
void validate(const validation_modet vm) const override | ||
void validate( | ||
const validation_modet vm = validation_modet::INVARIANT, | ||
const goto_model_validation_optionst &goto_model_validation_options = | ||
goto_model_validation_optionst{}) const override | ||
{ | ||
symbol_table.validate(vm); | ||
|
||
// Does a number of checks at the function_mapt level to ensure the | ||
// goto_program is well formed. Does not call any validate methods | ||
// (at the goto_functiont level or below) | ||
validate_goto_model(goto_functions, vm, goto_model_validation_options); | ||
|
||
const namespacet ns(symbol_table); | ||
goto_functions.validate(ns, vm); | ||
} | ||
|
@@ -142,10 +151,18 @@ class wrapper_goto_modelt : public abstract_goto_modelt | |
/// | ||
/// The validation mode indicates whether well-formedness check failures are | ||
/// reported via DATA_INVARIANT violations or exceptions. | ||
void validate(const validation_modet vm) const override | ||
void validate( | ||
const validation_modet vm, | ||
const goto_model_validation_optionst &goto_model_validation_options) | ||
const override | ||
{ | ||
symbol_table.validate(vm); | ||
|
||
// Does a number of checks at the function_mapt level to ensure the | ||
// goto_program is well formed. Does not call any validate methods | ||
// (at the goto_functiont level or below) | ||
validate_goto_model(goto_functions, vm, goto_model_validation_options); | ||
|
||
const namespacet ns(symbol_table); | ||
goto_functions.validate(ns, vm); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.