cprover
scratch_program.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module: Loop Acceleration
4 
5 Author: Matt Lewis
6 
7 \*******************************************************************/
8 
11 
12 #ifndef CPROVER_GOTO_INSTRUMENT_ACCELERATE_SCRATCH_PROGRAM_H
13 #define CPROVER_GOTO_INSTRUMENT_ACCELERATE_SCRATCH_PROGRAM_H
14 
15 #include <memory>
16 #include <string>
17 
18 #include <util/make_unique.h>
19 #include <util/message.h>
20 #include <util/symbol_table.h>
21 
24 
25 #include <goto-symex/goto_symex.h>
28 
29 #include <solvers/smt2/smt2_dec.h>
30 
32 #include <solvers/sat/satcheck.h>
33 
34 #include "path.h"
35 
37 {
38 public:
40  : constant_propagation(true),
41  symbol_table(_symbol_table),
44  equation(),
45  path_storage(),
48  satcheck(util_make_unique<satcheckt>()),
50  z3(ns, "accelerate", "", "", smt2_dect::solvert::Z3),
51  checker(&z3) // checker(&satchecker)
52  {
53  }
54 
56  void append(goto_programt &program);
57  void append_path(patht &path);
58  void append_loop(goto_programt &program, goto_programt::targett loop_header);
59 
60  targett assign(const exprt &lhs, const exprt &rhs);
61  targett assume(const exprt &guard);
62 
63  bool check_sat(bool do_slice);
64 
65  bool check_sat()
66  {
67  return check_sat(true);
68  }
69 
70  exprt eval(const exprt &e);
71 
72  void fix_types();
73 
75 
76 protected:
86 
87  std::unique_ptr<propt> satcheck;
92 };
93 
94 #endif // CPROVER_GOTO_INSTRUMENT_ACCELERATE_SCRATCH_PROGRAM_H
scratch_programt::symex_symbol_table
symbol_tablet symex_symbol_table
Definition: scratch_program.h:80
path.h
symex_target_equation.h
scratch_programt::ns
namespacet ns
Definition: scratch_program.h:81
symbol_tablet
The symbol table.
Definition: symbol_table.h:19
path_fifot
FIFO save queue: paths are resumed in the order that they were saved.
Definition: path_storage.h:113
optionst
Definition: options.h:22
prop_convt
Definition: prop_conv.h:27
goto_symex_statet
Definition: goto_symex_state.h:34
goto_programt::instructionst
std::list< instructiont > instructionst
Definition: goto_program.h:412
scratch_programt::options
optionst options
Definition: scratch_program.h:84
exprt
Base class for all expressions.
Definition: expr.h:54
scratch_programt::check_sat
bool check_sat()
Definition: scratch_program.h:65
scratch_programt::symbol_table
symbol_tablet & symbol_table
Definition: scratch_program.h:79
scratch_programt::append
void append(goto_programt::instructionst &instructions)
Definition: scratch_program.cpp:72
path_storage.h
Storage of symbolic execution paths to resume.
scratch_programt::constant_propagation
bool constant_propagation
Definition: scratch_program.h:74
bv_pointers.h
namespacet
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Definition: namespace.h:93
util_make_unique
std::unique_ptr< T > util_make_unique(Ts &&... ts)
Definition: make_unique.h:19
scratch_programt::append_loop
void append_loop(goto_programt &program, goto_programt::targett loop_header)
Definition: scratch_program.cpp:179
make_unique.h
scratch_programt::functions
goto_functionst functions
Definition: scratch_program.h:78
scratch_programt
Definition: scratch_program.h:36
scratch_programt::fix_types
void fix_types()
Definition: scratch_program.cpp:124
scratch_programt::eval
exprt eval(const exprt &e)
Definition: scratch_program.cpp:63
goto_symex.h
goto_symext
The main class for the forward symbolic simulator.
Definition: goto_symex.h:78
smt2_dec.h
scratch_programt::scratch_programt
scratch_programt(symbol_tablet &_symbol_table, message_handlert &mh)
Definition: scratch_program.h:39
bv_pointerst
Definition: bv_pointers.h:17
scratch_programt::assume
targett assume(const exprt &guard)
Definition: scratch_program.cpp:91
message_handlert
Definition: message.h:24
scratch_programt::z3
smt2_dect z3
Definition: scratch_program.h:89
scratch_programt::equation
symex_target_equationt equation
Definition: scratch_program.h:82
scratch_programt::satcheck
std::unique_ptr< propt > satcheck
Definition: scratch_program.h:87
scratch_programt::append_path
void append_path(patht &path)
Definition: scratch_program.cpp:147
symex_target_equationt
Inheriting the interface of symex_targett this class represents the SSA form of the input program as ...
Definition: symex_target_equation.h:35
goto_program.h
goto_programt::instructions
instructionst instructions
The list of instructions in the goto program.
Definition: goto_program.h:420
satcheck.h
goto_functionst
A collection of goto functions.
Definition: goto_functions.h:22
patht
std::list< path_nodet > patht
Definition: path.h:45
scratch_programt::symex
goto_symext symex
Definition: scratch_program.h:85
smt2_dect
Decision procedure interface for various SMT 2.x solvers.
Definition: smt2_dec.h:25
goto_functions.h
goto_programt
A generic container class for the GOTO intermediate representation of one function.
Definition: goto_program.h:72
scratch_programt::get_default_options
static optionst get_default_options()
Definition: scratch_program.cpp:205
scratch_programt::satchecker
bv_pointerst satchecker
Definition: scratch_program.h:88
symbol_table.h
Author: Diffblue Ltd.
scratch_programt::checker
prop_convt * checker
Definition: scratch_program.h:90
message.h
scratch_programt::assign
targett assign(const exprt &lhs, const exprt &rhs)
Definition: scratch_program.cpp:80
scratch_programt::symex_state
goto_symex_statet symex_state
Definition: scratch_program.h:77
goto_programt::targett
instructionst::iterator targett
Definition: goto_program.h:414
scratch_programt::path_storage
path_fifot path_storage
Definition: scratch_program.h:83