CBMC
scratch_programt Class Reference

#include <scratch_program.h>

+ Inheritance diagram for scratch_programt:
+ Collaboration diagram for scratch_programt:

Public Member Functions

 scratch_programt (symbol_table_baset &_symbol_table, message_handlert &mh, guard_managert &guard_manager)
 
void append (goto_programt::instructionst &instructions)
 
void append (goto_programt &program)
 
void append_path (patht &path)
 
void append_loop (goto_programt &program, goto_programt::targett loop_header)
 
targett assign (const exprt &lhs, const exprt &rhs)
 
targett assume (const exprt &guard)
 
bool check_sat (bool do_slice, guard_managert &guard_manager)
 
bool check_sat (guard_managert &guard_manager)
 
exprt eval (const exprt &e)
 
void fix_types ()
 
- Public Member Functions inherited from goto_programt
 goto_programt (const goto_programt &)=delete
 Copying is deleted as this class contains pointers that cannot be copied. More...
 
goto_programtoperator= (const goto_programt &)=delete
 
 goto_programt (goto_programt &&other)
 
goto_programtoperator= (goto_programt &&other)
 
targett const_cast_target (const_targett t)
 Convert a const_targett to a targett - use with care and avoid whenever possible. More...
 
const_targett const_cast_target (const_targett t) const
 Dummy for templates with possible const contexts. More...
 
template<typename Target >
std::list< Target > get_successors (Target target) const
 Get control-flow successors of a given instruction. More...
 
void compute_incoming_edges ()
 Compute for each instruction the set of instructions it is a successor of. More...
 
void insert_before_swap (targett target)
 Insertion that preserves jumps to "target". More...
 
void insert_before_swap (targett target, instructiont &instruction)
 Insertion that preserves jumps to "target". More...
 
void insert_before_swap (targett target, goto_programt &p)
 Insertion that preserves jumps to "target". More...
 
targett insert_before (const_targett target)
 Insertion before the instruction pointed-to by the given instruction iterator target. More...
 
targett insert_before (const_targett target, const instructiont &i)
 Insertion before the instruction pointed-to by the given instruction iterator target. More...
 
targett insert_after (const_targett target)
 Insertion after the instruction pointed-to by the given instruction iterator target. More...
 
targett insert_after (const_targett target, const instructiont &i)
 Insertion after the instruction pointed-to by the given instruction iterator target. More...
 
void destructive_append (goto_programt &p)
 Appends the given program p to *this. p is destroyed. More...
 
void destructive_insert (const_targett target, goto_programt &p)
 Inserts the given program p before target. More...
 
targett add (instructiont &&instruction)
 Adds a given instruction at the end. More...
 
targett add_instruction ()
 Adds an instruction at the end. More...
 
targett add_instruction (goto_program_instruction_typet type)
 Adds an instruction of given type at the end. More...
 
std::ostream & output (std::ostream &out) const
 Output goto-program to given stream. More...
 
void compute_target_numbers ()
 Compute the target numbers. More...
 
void compute_location_numbers (unsigned &nr)
 Compute location numbers. More...
 
void compute_location_numbers ()
 Compute location numbers. More...
 
void compute_loop_numbers ()
 Compute loop numbers. More...
 
void update ()
 Update all indices. More...
 
bool empty () const
 Is the program empty? More...
 
 goto_programt ()
 Constructor. More...
 
 ~goto_programt ()
 
void swap (goto_programt &program)
 Swap the goto program. More...
 
void clear ()
 Clear the goto program. More...
 
targett get_end_function ()
 Get an instruction iterator pointing to the END_FUNCTION instruction of the goto program. More...
 
const_targett get_end_function () const
 Get an instruction iterator pointing to the END_FUNCTION instruction of the goto program. More...
 
void copy_from (const goto_programt &src)
 Copy a full goto program, preserving targets. More...
 
bool has_assertion () const
 Does the goto program have an assertion? More...
 
void get_decl_identifiers (decl_identifierst &decl_identifiers) const
 get the variables in decl statements More...
 
bool equals (const goto_programt &other) const
 Syntactic equality: two goto_programt are equal if, and only if, they have the same number of instructions, each pair of instructions compares equal, and relative jumps have the same distance. More...
 
void validate (const namespacet &ns, const validation_modet vm) const
 Check that the goto program is well-formed. More...
 

Public Attributes

bool constant_propagation
 
- Public Attributes inherited from goto_programt
instructionst instructions
 The list of instructions in the goto program. More...
 

Static Protected Member Functions

static optionst get_default_options ()
 

Protected Attributes

std::unique_ptr< goto_symex_statetsymex_state
 
goto_functionst functions
 
symbol_table_basetsymbol_table
 
symbol_tablet symex_symbol_table
 
namespacet ns
 
symex_target_equationt equation
 
path_fifot path_storage
 
optionst options
 
scratch_program_symext symex
 
std::unique_ptr< proptsatcheck
 
bv_pointerst satchecker
 
smt2_dect z3
 
decision_proceduretchecker
 

Additional Inherited Members

- Public Types inherited from goto_programt
typedef std::list< instructiontinstructionst
 
typedef instructionst::iterator targett
 
typedef instructionst::const_iterator const_targett
 
typedef std::list< targetttargetst
 
typedef std::list< const_targettconst_targetst
 
typedef instructiont::target_less_than target_less_than
 
typedef std::set< irep_idtdecl_identifierst
 
- Static Public Member Functions inherited from goto_programt
static irep_idt loop_id (const irep_idt &function_id, const instructiont &instruction)
 Human-readable loop name. More...
 
static instructiont make_set_return_value (exprt return_value, const source_locationt &l=source_locationt::nil())
 
static instructiont make_set_return_value (const code_returnt &code, const source_locationt &l=source_locationt::nil())=delete
 
static instructiont make_skip (const source_locationt &l=source_locationt::nil())
 
static instructiont make_location (const source_locationt &l)
 
static instructiont make_throw (const source_locationt &l=source_locationt::nil())
 
static instructiont make_catch (const source_locationt &l=source_locationt::nil())
 
static instructiont make_assertion (const exprt &g, const source_locationt &l=source_locationt::nil())
 
static instructiont make_assumption (const exprt &g, const source_locationt &l=source_locationt::nil())
 
static instructiont make_other (const goto_instruction_codet &_code, const source_locationt &l=source_locationt::nil())
 
static instructiont make_decl (const symbol_exprt &symbol, const source_locationt &l=source_locationt::nil())
 
static instructiont make_dead (const symbol_exprt &symbol, const source_locationt &l=source_locationt::nil())
 
static instructiont make_atomic_begin (const source_locationt &l=source_locationt::nil())
 
static instructiont make_atomic_end (const source_locationt &l=source_locationt::nil())
 
static instructiont make_end_function (const source_locationt &l=source_locationt::nil())
 
static instructiont make_incomplete_goto (const exprt &_cond, const source_locationt &l=source_locationt::nil())
 
static instructiont make_incomplete_goto (const source_locationt &l=source_locationt::nil())
 
static instructiont make_incomplete_goto (const code_gotot &, const source_locationt &=source_locationt::nil())
 
static instructiont make_goto (targett _target, const source_locationt &l=source_locationt::nil())
 
static instructiont make_goto (targett _target, const exprt &g, const source_locationt &l=source_locationt::nil())
 
static instructiont make_assignment (const code_assignt &_code, const source_locationt &l=source_locationt::nil())
 Create an assignment instruction. More...
 
static instructiont make_assignment (exprt lhs, exprt rhs, const source_locationt &l=source_locationt::nil())
 Create an assignment instruction. More...
 
static instructiont make_decl (const code_declt &_code, const source_locationt &l=source_locationt::nil())
 
static instructiont make_function_call (const code_function_callt &_code, const source_locationt &l=source_locationt::nil())
 Create a function call instruction. More...
 
static instructiont make_function_call (exprt lhs, exprt function, code_function_callt::argumentst arguments, const source_locationt &l=source_locationt::nil())
 Create a function call instruction. More...
 

Detailed Description

Definition at line 60 of file scratch_program.h.

Constructor & Destructor Documentation

◆ scratch_programt()

scratch_programt::scratch_programt ( symbol_table_baset _symbol_table,
message_handlert mh,
guard_managert guard_manager 
)
inline

Definition at line 63 of file scratch_program.h.

Member Function Documentation

◆ append() [1/2]

void scratch_programt::append ( goto_programt program)

Definition at line 185 of file scratch_program.cpp.

◆ append() [2/2]

void scratch_programt::append ( goto_programt::instructionst instructions)

Definition at line 94 of file scratch_program.cpp.

◆ append_loop()

void scratch_programt::append_loop ( goto_programt program,
goto_programt::targett  loop_header 
)

Definition at line 193 of file scratch_program.cpp.

◆ append_path()

void scratch_programt::append_path ( patht path)

Definition at line 161 of file scratch_program.cpp.

◆ assign()

goto_programt::targett scratch_programt::assign ( const exprt lhs,
const exprt rhs 
)

Definition at line 102 of file scratch_program.cpp.

◆ assume()

goto_programt::targett scratch_programt::assume ( const exprt guard)

Definition at line 109 of file scratch_program.cpp.

◆ check_sat() [1/2]

bool scratch_programt::check_sat ( bool  do_slice,
guard_managert guard_manager 
)

Definition at line 24 of file scratch_program.cpp.

◆ check_sat() [2/2]

bool scratch_programt::check_sat ( guard_managert guard_manager)
inline

Definition at line 92 of file scratch_program.h.

◆ eval()

exprt scratch_programt::eval ( const exprt e)

Definition at line 89 of file scratch_program.cpp.

◆ fix_types()

void scratch_programt::fix_types ( )

Definition at line 140 of file scratch_program.cpp.

◆ get_default_options()

optionst scratch_programt::get_default_options ( )
staticprotected

Definition at line 219 of file scratch_program.cpp.

Member Data Documentation

◆ checker

decision_proceduret* scratch_programt::checker
protected

Definition at line 117 of file scratch_program.h.

◆ constant_propagation

bool scratch_programt::constant_propagation

Definition at line 101 of file scratch_program.h.

◆ equation

symex_target_equationt scratch_programt::equation
protected

Definition at line 109 of file scratch_program.h.

◆ functions

goto_functionst scratch_programt::functions
protected

Definition at line 105 of file scratch_program.h.

◆ ns

namespacet scratch_programt::ns
protected

Definition at line 108 of file scratch_program.h.

◆ options

optionst scratch_programt::options
protected

Definition at line 111 of file scratch_program.h.

◆ path_storage

path_fifot scratch_programt::path_storage
protected

Definition at line 110 of file scratch_program.h.

◆ satcheck

std::unique_ptr<propt> scratch_programt::satcheck
protected

Definition at line 114 of file scratch_program.h.

◆ satchecker

bv_pointerst scratch_programt::satchecker
protected

Definition at line 115 of file scratch_program.h.

◆ symbol_table

symbol_table_baset& scratch_programt::symbol_table
protected

Definition at line 106 of file scratch_program.h.

◆ symex

scratch_program_symext scratch_programt::symex
protected

Definition at line 112 of file scratch_program.h.

◆ symex_state

std::unique_ptr<goto_symex_statet> scratch_programt::symex_state
protected

Definition at line 104 of file scratch_program.h.

◆ symex_symbol_table

symbol_tablet scratch_programt::symex_symbol_table
protected

Definition at line 107 of file scratch_program.h.

◆ z3

smt2_dect scratch_programt::z3
protected

Definition at line 116 of file scratch_program.h.


The documentation for this class was generated from the following files: