CBMC
goto_symex.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module: Symbolic Execution
4 
5 Author: Daniel Kroening, kroening@kroening.com
6 
7 \*******************************************************************/
8 
11 
12 #ifndef CPROVER_GOTO_SYMEX_GOTO_SYMEX_H
13 #define CPROVER_GOTO_SYMEX_GOTO_SYMEX_H
14 
15 #include <util/message.h>
16 
17 #include "complexity_limiter.h"
18 #include "shadow_memory.h"
19 #include "symex_config.h"
20 #include "symex_target_equation.h"
21 
22 class address_of_exprt;
24 class goto_symex_statet;
25 class path_storaget;
27 class side_effect_exprt;
28 class symex_assignt;
29 class typet;
30 
37 {
38 public:
41 
52  message_handlert &mh,
54  symex_target_equationt &_target,
55  const optionst &options,
58  : should_pause_symex(false),
59  symex_config(options),
63  target(_target),
65  log(mh),
68  _total_vccs(std::numeric_limits<unsigned>::max()),
69  _remaining_vccs(std::numeric_limits<unsigned>::max()),
70  complexity_module(mh, options),
72  std::bind(
74  this,
75  std::placeholders::_1,
76  std::placeholders::_2,
77  std::placeholders::_3),
78  ns,
79  mh)
80  {
81  }
82 
84  virtual ~goto_symext() = default;
85 
91  typedef
92  std::function<const goto_functionst::goto_functiont &(const irep_idt &)>
94 
103 
115  [[nodiscard]] virtual symbol_tablet symex_from_entry_point_of(
117  const shadow_memory_field_definitionst &fields);
118 
127  symbol_table_baset &new_symbol_table,
128  const shadow_memory_field_definitionst &fields);
129 
140  [[nodiscard]] virtual symbol_tablet resume_symex_from_saved_state(
142  const statet &saved_state,
143  symex_target_equationt *saved_equation);
144 
157  [[nodiscard]] virtual symbol_tablet
158  symex_with_state(statet &state, const get_goto_functiont &get_goto_functions);
159 
168 
171  bool ignore_assertions = false;
172 
181  virtual bool check_break(const irep_idt &loop_id, unsigned unwind);
182 
183 protected:
186 
191  std::unique_ptr<statet>
193 
199  void symex_threaded_step(
200  statet &state,
202 
210  virtual void
212 
223  statet &state);
224 
229 
232  void print_symex_step(statet &state);
233 
236 
237 public:
238 
242 
243 protected:
250 
259 
264 
267 
271 
275  std::vector<symbol_exprt> instruction_local_symbols;
276 
278  mutable messaget log;
279 
281 
291  exprt clean_expr(exprt expr, statet &state, bool write);
292 
293  void trigger_auto_object(const exprt &, statet &);
294  void initialize_auto_object(const exprt &, statet &);
295 
300  void process_array_expr(statet &, exprt &);
301  exprt make_auto_object(const typet &, statet &);
302  virtual void dereference(exprt &, statet &, bool write);
303 
304  symbol_exprt cache_dereference(exprt &dereference_result, statet &state);
305  void dereference_rec(
306  exprt &expr,
307  statet &state,
308  bool write,
309  bool is_in_quantifier);
311  const exprt &,
312  statet &,
313  bool keep_array);
314 
317  virtual void symex_goto(statet &state);
324  void symex_set_return_value(statet &state, const exprt &return_value);
327  virtual void symex_start_thread(statet &state);
330  virtual void symex_atomic_begin(statet &state);
333  virtual void symex_atomic_end(statet &state);
336  virtual void symex_decl(statet &state);
341  virtual void symex_decl(statet &state, const symbol_exprt &expr);
344  virtual void symex_dead(statet &state);
348  void symex_dead(statet &state, const symbol_exprt &symbol_expr);
351  virtual void symex_other(statet &state);
352 
354 
365  goto_symex_statet &current_state,
366  goto_statet &jump_taken_state,
367  goto_statet &jump_not_taken_state,
368  const exprt &original_guard,
369  const exprt &new_guard,
370  const namespacet &ns);
371 
389  exprt condition,
390  const value_sett &original_value_set,
391  value_sett *jump_taken_value_set,
392  value_sett *jump_not_taken_value_set,
393  const namespacet &ns);
394 
400  virtual void vcc(
401  const exprt &cond,
402  const irep_idt &property_id,
403  const std::string &msg,
404  statet &state);
405 
410  virtual void symex_assume(statet &state, const exprt &cond);
411  void symex_assume_l2(statet &, const exprt &cond);
412 
417  void merge_gotos(statet &state);
418 
425  virtual void merge_goto(
426  const symex_targett::sourcet &source,
427  goto_statet &&goto_state,
428  statet &state);
429 
433  void phi_function(const goto_statet &goto_state, statet &dest_state);
434 
440  virtual bool should_stop_unwind(
441  const symex_targett::sourcet &source,
442  const call_stackt &context,
443  unsigned unwind);
444 
445  virtual void loop_bound_exceeded(statet &state, const exprt &guard);
446 
454  virtual void symex_function_call(
456  statet &state,
457  const goto_programt::instructiont &instruction);
458 
464  virtual void locality(
465  const irep_idt &function_identifier,
467  const goto_functionst::goto_functiont &goto_function);
468 
471  virtual void symex_end_of_function(statet &);
472 
480  virtual void symex_function_call_symbol(
482  statet &state,
483  const exprt &lhs,
484  const symbol_exprt &function,
485  const exprt::operandst &arguments);
486 
499  virtual void symex_function_call_post_clean(
501  statet &state,
502  const exprt &cleaned_lhs,
503  const symbol_exprt &function,
504  const exprt::operandst &cleaned_arguments);
505 
506  virtual bool get_unwind_recursion(
507  const irep_idt &identifier,
508  unsigned thread_nr,
509  unsigned unwind);
510 
518  const irep_idt &function_identifier,
519  const goto_functionst::goto_functiont &goto_function,
520  statet &state,
521  const exprt::operandst &arguments);
522 
523  // exceptions
526  void symex_throw(statet &state);
529  void symex_catch(statet &state);
530 
531  virtual void do_simplify(exprt &expr);
532 
538  void symex_assign(statet &state, const exprt &lhs, const exprt &rhs);
539 
549  statet &state,
551  const exprt &lhs,
552  const exprt &rhs);
553 
561  statet &state,
563  const function_application_exprt &f_l1);
564 
574  statet &state,
576  const function_application_exprt &f_l1);
577 
587  statet &state,
589  const function_application_exprt &f_l1);
590 
600  statet &state,
602  const function_application_exprt &f_l1);
603 
613  statet &state,
615  const function_application_exprt &f_l1);
616 
626  statet &state,
628  const function_application_exprt &f_l1);
629 
644  statet &state,
646  const function_application_exprt &f_l1);
647 
657  statet &state,
659  const function_application_exprt &f_l1);
660 
663  statet &state,
665  const function_application_exprt &f_l1);
666 
669  statet &state,
671  const function_application_exprt &f_l1,
672  bool to_upper);
673 
676  statet &state,
678  const function_application_exprt &f_l1);
679 
701  statet &state,
703  const ssa_exprt &length,
704  const constant_exprt &new_length,
705  const ssa_exprt &char_array,
706  const array_exprt &new_char_array);
707 
717  statet &state,
719  const std::string &aux_symbol_name,
720  const ssa_exprt &char_array,
721  const array_exprt &new_char_array);
722 
734  statet &state,
736  const array_exprt &new_char_array,
737  const address_of_exprt &string_data);
738 
739  std::optional<std::reference_wrapper<const array_exprt>>
740  try_evaluate_constant_string(const statet &state, const exprt &content);
741 
742  // clang-format off
743  static std::optional<std::reference_wrapper<const constant_exprt>>
745  const statet &state,
746  const exprt &expr);
747  // clang-format on
748 
749  // havocs the given object
750  void havoc_rec(statet &state, const guardt &guard, const exprt &dest);
751 
753 
759  void lift_lets(statet &, exprt &);
760 
765  void lift_let(statet &state, const let_exprt &let_expr);
766 
767  virtual void
768  symex_va_start(statet &, const exprt &lhs, const side_effect_exprt &);
769 
775  virtual void symex_allocate(
776  statet &state,
777  const exprt &lhs,
778  const side_effect_exprt &code);
782  virtual void symex_cpp_delete(statet &state, const codet &code);
788  virtual void
789  symex_cpp_new(statet &state, const exprt &lhs, const side_effect_exprt &code);
790 
794  virtual void symex_printf(statet &state, const exprt &rhs);
798  virtual void symex_input(statet &state, const codet &code);
802  virtual void symex_output(statet &state, const codet &code);
803 
804  void rewrite_quantifiers(exprt &, statet &);
805 
811 
812 public:
822  std::size_t path_segment_vccs;
823 
824 protected:
832 
835 
837 
840 
841 public:
842  unsigned get_total_vccs() const
843  {
844  INVARIANT(
845  _total_vccs != std::numeric_limits<unsigned>::max(),
846  "symex_threaded_step should have been executed at least once before "
847  "attempting to read total_vccs");
848  return _total_vccs;
849  }
850 
851  unsigned get_remaining_vccs() const
852  {
853  INVARIANT(
854  _remaining_vccs != std::numeric_limits<unsigned>::max(),
855  "symex_threaded_step should have been executed at least once before "
856  "attempting to read remaining_vccs");
857  return _remaining_vccs;
858  }
859 
860  void validate(const validation_modet vm) const
861  {
862  target.validate(ns, vm);
863  }
864 };
865 
873 
874 void symex_transition(
877  bool is_backwards_goto);
878 
890  renamedt<exprt, L2> condition,
891  const value_sett &value_set,
892  const irep_idt &language_mode,
893  const namespacet &ns);
894 
895 #endif // CPROVER_GOTO_SYMEX_GOTO_SYMEX_H
static exprt guard(const exprt::operandst &guards, exprt cond)
Abstract interface to eager or lazy GOTO models.
Operator to return the address of an object.
Definition: pointer_expr.h:540
Array constructor from list of elements.
Definition: std_expr.h:1621
Data structure for representing an arbitrary statement in a program.
Definition: std_code_base.h:29
Symex complexity module.
A constant literal expression.
Definition: std_expr.h:3000
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition: dstring.h:38
Base class for all expressions.
Definition: expr.h:56
std::vector< exprt > operandst
Definition: expr.h:58
Application of (mathematical) function.
::goto_functiont goto_functiont
This class represents an instruction in the GOTO intermediate representation.
Definition: goto_program.h:181
instructionst::const_iterator const_targett
Definition: goto_program.h:615
Container for data that varies per program point, e.g.
Definition: goto_state.h:32
Central data structure: state.
The main class for the forward symbolic simulator.
Definition: goto_symex.h:37
virtual bool should_stop_unwind(const symex_targett::sourcet &source, const call_stackt &context, unsigned unwind)
Determine whether to unwind a loop.
Definition: symex_goto.cpp:954
void try_filter_value_sets(goto_symex_statet &state, exprt condition, const value_sett &original_value_set, value_sett *jump_taken_value_set, value_sett *jump_not_taken_value_set, const namespacet &ns)
Try to filter value sets based on whether possible values of a pointer-typed symbol make the conditio...
Definition: symex_main.cpp:780
virtual symbol_tablet symex_with_state(statet &state, const get_goto_functiont &get_goto_functions)
Symbolically execute the entire program starting from entry point.
Definition: symex_main.cpp:323
void rewrite_quantifiers(exprt &, statet &)
Definition: symex_main.cpp:251
virtual void symex_function_call_symbol(const get_goto_functiont &get_goto_function, statet &state, const exprt &lhs, const symbol_exprt &function, const exprt::operandst &arguments)
Symbolic execution of a call to a function call.
void apply_goto_condition(goto_symex_statet &current_state, goto_statet &jump_taken_state, goto_statet &jump_not_taken_state, const exprt &original_guard, const exprt &new_guard, const namespacet &ns)
Propagate constants and points-to information implied by a GOTO condition.
Definition: symex_goto.cpp:30
virtual void symex_assume(statet &state, const exprt &cond)
Symbolically execute an ASSUME instruction or simulate such an execution for a synthetic assumption.
Definition: symex_main.cpp:199
void symex_threaded_step(statet &state, const get_goto_functiont &get_goto_function)
Invokes symex_step and verifies whether additional threads can be executed.
Definition: symex_main.cpp:299
virtual bool check_break(const irep_idt &loop_id, unsigned unwind)
Defines condition for interrupting symbolic execution for a specific loop.
Definition: symex_goto.cpp:617
void symex_unreachable_goto(statet &state)
Symbolically execute a GOTO instruction in the context of unreachable code.
Definition: symex_goto.cpp:544
complexity_limitert complexity_module
Definition: goto_symex.h:836
goto_symex_statet statet
A type abbreviation for goto_symex_statet.
Definition: goto_symex.h:40
virtual void symex_atomic_begin(statet &state)
Symbolically execute an ATOMIC_BEGIN instruction.
const symbol_table_baset & outer_symbol_table
The symbol table associated with the goto-program being executed.
Definition: goto_symex.h:249
irep_idt language_mode
language_mode: ID_java, ID_C or another language identifier if we know the source language in use,...
Definition: goto_symex.h:241
void symex_set_return_value(statet &state, const exprt &return_value)
Symbolically execute a SET_RETURN_VALUE instruction.
virtual void symex_input(statet &state, const codet &code)
Symbolically execute an OTHER instruction that does a CPP input.
bool ignore_assertions
If this flag is set to true then assertions will be temporarily ignored by the symbolic executions.
Definition: goto_symex.h:171
static get_goto_functiont get_goto_function(abstract_goto_modelt &goto_model)
Return a function to get/load a goto function from the given goto model Create a default delegate to ...
Definition: symex_main.cpp:492
virtual void symex_step(const get_goto_functiont &get_goto_function, statet &state)
Called for each step in the symbolic execution This calls print_symex_step to print symex's current i...
Definition: symex_main.cpp:591
bool constant_propagate_delete_char_at(statet &state, symex_assignt &symex_assign, const function_application_exprt &f_l1)
Attempt to constant propagate deleting a character from a string.
Definition: goto_symex.cpp:652
bool constant_propagate_set_char_at(statet &state, symex_assignt &symex_assign, const function_application_exprt &f_l1)
Attempt to constant propagate setting the char at the given index.
Definition: goto_symex.cpp:900
bool constant_propagate_assignment_with_side_effects(statet &state, symex_assignt &symex_assign, const exprt &lhs, const exprt &rhs)
Attempt to constant propagate side effects of the assignment (if any)
Definition: goto_symex.cpp:184
void lift_let(statet &state, const let_exprt &let_expr)
Execute a single let expression, which should not have any nested let expressions (use lift_lets inst...
virtual void symex_goto(statet &state)
Symbolically execute a GOTO instruction.
Definition: symex_goto.cpp:230
unsigned get_remaining_vccs() const
Definition: goto_symex.h:851
virtual void symex_decl(statet &state)
Symbolically execute a DECL instruction.
Definition: symex_decl.cpp:18
void symex_catch(statet &state)
Symbolically execute a CATCH instruction.
Definition: symex_catch.cpp:14
bool constant_propagate_delete(statet &state, symex_assignt &symex_assign, const function_application_exprt &f_l1)
Attempt to constant propagate deleting a substring from a string.
Definition: goto_symex.cpp:725
static std::optional< std::reference_wrapper< const constant_exprt > > try_evaluate_constant(const statet &state, const exprt &expr)
Definition: goto_symex.cpp:389
void phi_function(const goto_statet &goto_state, statet &dest_state)
Merge the SSA assignments from goto_state into dest_state.
Definition: symex_goto.cpp:859
path_storaget & path_storage
Symbolic execution paths to be resumed later.
Definition: goto_symex.h:810
std::unique_ptr< statet > initialize_entry_point_state(const get_goto_functiont &get_goto_function)
Initialize the symbolic execution and the given state with the beginning of the entry point function.
Definition: symex_main.cpp:397
void havoc_rec(statet &state, const guardt &guard, const exprt &dest)
Definition: symex_other.cpp:20
void constant_propagate_empty_string(statet &state, symex_assignt &symex_assign, const function_application_exprt &f_l1)
Create an empty string constant.
Definition: goto_symex.cpp:408
unsigned _total_vccs
Definition: goto_symex.h:833
symex_target_equationt & target
The equation that this execution is building up.
Definition: goto_symex.h:266
virtual bool get_unwind_recursion(const irep_idt &identifier, unsigned thread_nr, unsigned unwind)
virtual void symex_cpp_delete(statet &state, const codet &code)
Symbolically execute an OTHER instruction that does a CPP delete
bool constant_propagate_case_change(statet &state, symex_assignt &symex_assign, const function_application_exprt &f_l1, bool to_upper)
Attempt to constant propagate case changes, both upper and lower.
Definition: goto_symex.cpp:970
virtual void symex_allocate(statet &state, const exprt &lhs, const side_effect_exprt &code)
Symbolically execute an assignment instruction that has an allocate on the right hand side.
bool constant_propagate_integer_to_string(statet &state, symex_assignt &symex_assign, const function_application_exprt &f_l1)
Attempt to constant propagate converting an integer to a string.
Definition: goto_symex.cpp:573
guard_managert & guard_manager
Used to create guards.
Definition: goto_symex.h:263
goto_symext(message_handlert &mh, const symbol_table_baset &outer_symbol_table, symex_target_equationt &_target, const optionst &options, path_storaget &path_storage, guard_managert &guard_manager)
Construct a goto_symext to execute a particular program.
Definition: goto_symex.h:51
unsigned atomic_section_counter
A monotonically increasing index for each encountered ATOMIC_BEGIN instruction.
Definition: goto_symex.h:270
virtual symbol_tablet resume_symex_from_saved_state(const get_goto_functiont &get_goto_function, const statet &saved_state, symex_target_equationt *saved_equation)
Performs symbolic execution using a state and equation that have already been used to symbolically ex...
Definition: symex_main.cpp:379
void symex_assert(const goto_programt::instructiont &, statet &)
Definition: symex_main.cpp:151
exprt clean_expr(exprt expr, statet &state, bool write)
Clean up an expression.
unsigned get_total_vccs() const
Definition: goto_symex.h:842
virtual void loop_bound_exceeded(statet &state, const exprt &guard)
Definition: symex_goto.cpp:926
bool constant_propagate_trim(statet &state, symex_assignt &symex_assign, const function_application_exprt &f_l1)
Attempt to constant propagate trim operations.
virtual void symex_dead(statet &state)
Symbolically execute a DEAD instruction.
Definition: symex_dead.cpp:16
shadow_memoryt shadow_memory
Shadow memory instrumentation API.
Definition: goto_symex.h:839
std::size_t path_segment_vccs
Number of VCCs generated during the run of this goto_symext object.
Definition: goto_symex.h:822
virtual void symex_start_thread(statet &state)
Symbolically execute a START_THREAD instruction.
void initialize_auto_object(const exprt &, statet &)
virtual symbol_tablet symex_from_entry_point_of(const get_goto_functiont &get_goto_function, const shadow_memory_field_definitionst &fields)
Symbolically execute the entire program starting from entry point.
Definition: symex_main.cpp:464
void parameter_assignments(const irep_idt &function_identifier, const goto_functionst::goto_functiont &goto_function, statet &state, const exprt::operandst &arguments)
Iterates over arguments and assigns them to the parameters, which are symbols whose name and type are...
virtual void symex_va_start(statet &, const exprt &lhs, const side_effect_exprt &)
namespacet ns
Initialized just before symbolic execution begins, to point to both outer_symbol_table and the symbol...
Definition: goto_symex.h:258
void trigger_auto_object(const exprt &, statet &)
void lift_lets(statet &, exprt &)
Execute any let expressions in expr using symex_assignt::assign_symbol.
virtual void vcc(const exprt &cond, const irep_idt &property_id, const std::string &msg, statet &state)
Symbolically execute a verification condition (assertion).
Definition: symex_main.cpp:180
void kill_instruction_local_symbols(statet &state)
Kills any variables in instruction_local_symbols (these are currently always let-bound variables defi...
Definition: symex_main.cpp:744
virtual void merge_goto(const symex_targett::sourcet &source, goto_statet &&goto_state, statet &state)
Merge a single branch, the symbolic state of which is held in goto_state, into the current overall sy...
Definition: symex_goto.cpp:678
virtual void symex_end_of_function(statet &)
Symbolically execute a END_FUNCTION instruction.
void symex_assign(statet &state, const exprt &lhs, const exprt &rhs)
Symbolically execute an ASSIGN instruction or simulate such an execution for a synthetic assignment.
Definition: goto_symex.cpp:38
exprt make_auto_object(const typet &, statet &)
void print_symex_step(statet &state)
Prints the route of symex as it walks through the code.
Definition: symex_main.cpp:509
virtual void symex_printf(statet &state, const exprt &rhs)
Symbolically execute an OTHER instruction that does a CPP printf
virtual void symex_output(statet &state, const codet &code)
Symbolically execute an OTHER instruction that does a CPP output.
void symex_throw(statet &state)
Symbolically execute a THROW instruction.
Definition: symex_throw.cpp:14
exprt address_arithmetic(const exprt &, statet &, bool keep_array)
Transforms an lvalue expression by replacing any dereference operations it contains with explicit ref...
const symbolt & get_new_string_data_symbol(statet &state, symex_assignt &symex_assign, const std::string &aux_symbol_name, const ssa_exprt &char_array, const array_exprt &new_char_array)
Installs a new symbol in the symbol table to represent the given character array, and assigns the cha...
Definition: goto_symex.cpp:302
void associate_array_to_pointer(statet &state, symex_assignt &symex_assign, const array_exprt &new_char_array, const address_of_exprt &string_data)
Generate array to pointer association primitive.
Definition: goto_symex.cpp:338
virtual void do_simplify(exprt &expr)
Definition: goto_symex.cpp:32
unsigned _remaining_vccs
Definition: goto_symex.h:833
virtual void symex_other(statet &state)
Symbolically execute an OTHER instruction.
Definition: symex_other.cpp:79
std::function< const goto_functionst::goto_functiont &(const irep_idt &)> get_goto_functiont
The type of delegate functions that retrieve a goto_functiont for a particular function identifier.
Definition: goto_symex.h:93
virtual void symex_function_call_post_clean(const get_goto_functiont &get_goto_function, statet &state, const exprt &cleaned_lhs, const symbol_exprt &function, const exprt::operandst &cleaned_arguments)
Symbolic execution of a function call by inlining.
virtual void symex_cpp_new(statet &state, const exprt &lhs, const side_effect_exprt &code)
Handles side effects of type 'new' for C++ and 'new array' for C++ and Java language modes.
bool constant_propagate_set_length(statet &state, symex_assignt &symex_assign, const function_application_exprt &f_l1)
Attempt to constant propagate setting the length of a string.
Definition: goto_symex.cpp:819
symbol_exprt cache_dereference(exprt &dereference_result, statet &state)
messaget log
The messaget to write log messages to.
Definition: goto_symex.h:278
const symex_configt symex_config
The configuration to use for this symbolic execution.
Definition: goto_symex.h:185
bool should_pause_symex
Set when states are pushed onto the workqueue If this flag is set at the end of a symbolic execution ...
Definition: goto_symex.h:167
virtual void dereference(exprt &, statet &, bool write)
Replace all dereference operations within expr with explicit references to the objects they may refer...
bool constant_propagate_string_substring(statet &state, symex_assignt &symex_assign, const function_application_exprt &f_l1)
Attempt to constant propagate getting a substring of a string.
Definition: goto_symex.cpp:486
void symex_assume_l2(statet &, const exprt &cond)
Definition: symex_main.cpp:219
void merge_gotos(statet &state)
Merge all branches joining at the current program point.
Definition: symex_goto.cpp:623
symex_targett::assignment_typet assignment_typet
Definition: goto_symex.h:752
virtual void locality(const irep_idt &function_identifier, goto_symext::statet &state, const goto_functionst::goto_functiont &goto_function)
Preserves locality of parameters of a given function by applying L1 renaming to them.
virtual ~goto_symext()=default
A virtual destructor allowing derived classes to be cleaned up correctly.
bool constant_propagate_replace(statet &state, symex_assignt &symex_assign, const function_application_exprt &f_l1)
Attempt to constant proagate character replacement.
messaget::mstreamt & print_callstack_entry(const symex_targett::sourcet &target)
Definition: symex_main.cpp:501
void dereference_rec(exprt &expr, statet &state, bool write, bool is_in_quantifier)
If expr is a dereference_exprt, replace it with explicit references to the objects it may point to.
std::vector< symbol_exprt > instruction_local_symbols
Variables that should be killed at the end of the current symex_step invocation.
Definition: goto_symex.h:275
void validate(const validation_modet vm) const
Definition: goto_symex.h:860
bool constant_propagate_string_concat(statet &state, symex_assignt &symex_assign, const function_application_exprt &f_l1)
Attempt to constant propagate string concatenation.
Definition: goto_symex.cpp:436
virtual void symex_atomic_end(statet &state)
Symbolically execute an ATOMIC_END instruction.
virtual void symex_function_call(const get_goto_functiont &get_goto_function, statet &state, const goto_programt::instructiont &instruction)
Symbolically execute a FUNCTION_CALL instruction.
void assign_string_constant(statet &state, symex_assignt &symex_assign, const ssa_exprt &length, const constant_exprt &new_length, const ssa_exprt &char_array, const array_exprt &new_char_array)
Assign constant string length and string data given by a char array to given ssa variables.
Definition: goto_symex.cpp:258
void process_array_expr(statet &, exprt &)
Given an expression, find the root object and the offset into it.
std::optional< std::reference_wrapper< const array_exprt > > try_evaluate_constant_string(const statet &state, const exprt &content)
Definition: goto_symex.cpp:368
void execute_next_instruction(const get_goto_functiont &get_goto_function, statet &state)
Executes the instruction state.source.pc Case-switches over the type of the instruction being execute...
Definition: symex_main.cpp:601
virtual void initialize_path_storage_from_entry_point_of(const get_goto_functiont &get_goto_function, symbol_table_baset &new_symbol_table, const shadow_memory_field_definitionst &fields)
Puts the initial state of the entry point function into the path storage.
Definition: symex_main.cpp:475
A let expression.
Definition: std_expr.h:3214
Class that provides messages with a built-in verbosity 'level'.
Definition: message.h:154
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Definition: namespace.h:94
Storage for symbolic execution paths to be resumed later.
Definition: path_storage.h:38
Wrapper for expressions or types which have been renamed up to a given level.
Definition: renamed.h:33
The shadow memory field definitions.
The shadow memory instrumentation performed during symbolic execution.
Definition: shadow_memory.h:37
An expression containing a side effect.
Definition: std_code.h:1450
Expression providing an SSA-renamed symbol of expressions.
Definition: ssa_expr.h:17
Expression to hold a symbol (variable)
Definition: std_expr.h:131
The symbol table base class interface.
The symbol table.
Definition: symbol_table.h:14
Symbol table entry.
Definition: symbol.h:28
Functor for symex assignment.
Definition: symex_assign.h:28
Callback object that goto_symext::dereference_rec provides to value_set_dereferencet to provide value...
Inheriting the interface of symex_targett this class represents the SSA form of the input program as ...
void validate(const namespacet &ns, const validation_modet vm) const
The type of an expression, extends irept.
Definition: type.h:29
State type in value_set_domaint, used in value-set analysis and goto-symex.
Definition: value_set.h:44
Symbolic Execution.
renamedt< exprt, L2 > try_evaluate_pointer_comparisons(renamedt< exprt, L2 > condition, const value_sett &value_set, const irep_idt &language_mode, const namespacet &ns)
Try to evaluate pointer comparisons where they can be trivially determined using the value-set.
Definition: symex_goto.cpp:214
void symex_transition(goto_symext::statet &state)
Transition to the next instruction, which increments the internal program counter and initializes the...
Definition: symex_main.cpp:144
Symex Shadow Memory Instrumentation.
This is unused by this implementation of guards, but can be used by other implementations of the same...
Definition: guard_expr.h:20
Configuration used for a symbolic execution.
Definition: symex_config.h:19
Identifies source in the context of symbolic execution.
Definition: symex_target.h:37
Symbolic Execution.
Generate Equation using Symbolic Execution.
ssize_t write(int fildes, const void *buf, size_t nbyte)
Definition: unistd.c:195
validation_modet