CBMC
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
goto_check.cpp
Go to the documentation of this file.
1/*******************************************************************\
2
3Module: GOTO Programs
4
5Author: Daniel Kroening, kroening@kroening.com
6
7\*******************************************************************/
8
11
12#include "goto_check.h"
13
14#include <util/options.h>
15
16#include "goto_model.h"
17#include "remove_skip.h"
18
20 goto_programt &goto_program,
24{
25 bool did_something = false;
26
27 for(auto &instruction : goto_program.instructions)
28 {
29 if(instruction.is_assert())
30 {
31 bool is_user_provided =
32 instruction.source_location().get_bool("user-provided");
33
34 if(
36 instruction.source_location().get_property_class() != "error label") ||
38 {
39 instruction.turn_into_skip();
40 did_something = true;
41 }
42 }
43 else if(instruction.is_assume())
44 {
46 {
47 instruction.turn_into_skip();
48 did_something = true;
49 }
50 }
51 }
52
54 remove_skip(goto_program);
55}
56
58 const optionst &options,
59 goto_modelt &goto_model)
60{
61 const bool enable_assertions = options.get_bool_option("assertions");
63 options.get_bool_option("built-in-assertions");
64 const bool enable_assumptions = options.get_bool_option("assumptions");
65
66 // check whether there could possibly be anything to do
68 return;
69
70 for(auto &entry : goto_model.goto_functions.function_map)
71 {
73 entry.second.body,
77 }
78}
79
81 const optionst &options,
82 goto_programt &goto_program)
83{
84 const bool enable_assertions = options.get_bool_option("assertions");
86 options.get_bool_option("built-in-assertions");
87 const bool enable_assumptions = options.get_bool_option("assumptions");
88
89 // check whether there could possibly be anything to do
91 return;
92
94 goto_program,
98}
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Definition ai.h:562
function_mapt function_map
goto_functionst goto_functions
GOTO functions.
Definition goto_model.h:34
A generic container class for the GOTO intermediate representation of one function.
instructionst instructions
The list of instructions in the goto program.
bool get_bool_option(const std::string &option) const
Definition options.cpp:44
static void transform_assertions_assumptions(goto_programt &goto_program, bool enable_assertions, bool enable_built_in_assertions, bool enable_assumptions)
Checks for Errors in C and Java Programs.
Symbol Table + CFG.
Options.
void remove_skip(goto_programt &goto_program, goto_programt::targett begin, goto_programt::targett end)
remove unnecessary skip statements
Program Transformation.