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
symbol_tablet symex_symbol_table
Generate Equation using Symbolic Execution.
targett assign(const exprt &lhs, const exprt &rhs)
Goto Programs with Functions.
symbol_tablet & symbol_table
Inheriting the interface of symex_targett this class represents the SSA form of the input program as ...
std::list< instructiont > instructionst
Definition: goto_program.h:412
Decision procedure interface for various SMT 2.x solvers.
Definition: smt2_dec.h:25
goto_functionst functions
instructionst::iterator targett
Definition: goto_program.h:414
FIFO save queue: paths are resumed in the order that they were saved.
Definition: path_storage.h:113
targett assume(const exprt &guard)
exprt eval(const exprt &e)
Symbolic Execution.
instructionst instructions
The list of instructions in the goto program.
Definition: goto_program.h:420
void append_loop(goto_programt &program, goto_programt::targett loop_header)
void append(goto_programt::instructionst &instructions)
std::list< path_nodet > patht
Definition: path.h:45
The symbol table.
Definition: symbol_table.h:19
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Definition: namespace.h:93
A collection of goto functions.
Author: Diffblue Ltd.
scratch_programt(symbol_tablet &_symbol_table, message_handlert &mh)
A generic container class for the GOTO intermediate representation of one function.
Definition: goto_program.h:72
Loop Acceleration.
The main class for the forward symbolic simulator.
Definition: goto_symex.h:78
symex_target_equationt equation
std::unique_ptr< propt > satcheck
void append_path(patht &path)
static optionst get_default_options()
prop_convt * checker
Base class for all expressions.
Definition: expr.h:54
std::unique_ptr< T > util_make_unique(Ts &&... ts)
Definition: make_unique.h:19
goto_symex_statet symex_state
goto_symext symex
path_fifot path_storage
bv_pointerst satchecker
Storage of symbolic execution paths to resume.
Concrete Goto Program.