CBMC
Loading...
Searching...
No Matches
Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
string_abstractiont Class Reference

Replace all uses of char * by a struct that carries that string, and also the underlying allocation and the C string length. More...

#include <string_abstraction.h>

+ Collaboration diagram for string_abstractiont:

Public Member Functions

  Apply string abstraction to goto_model.
 
void  apply ()
 

Protected Types

enum class   whatt { IS_ZERO , LENGTH , SIZE }
 
 
typedef std::unordered_map< irep_idt, irep_idtlocalst
 

Protected Member Functions

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bool  build (const exprt &object, exprt &dest, bool write)
 
bool  build_wrap (const exprt &object, exprt &dest, bool write)
 
 
 
 
 
 
 
 
 
 
void  build_new_symbol (const symbolt &symbol, const irep_idt &identifier, const typet &type)
 
 
 
 
 
 
 
 
 

Static Protected Member Functions

 
 

Protected Attributes

std::string  sym_suffix
 
 
 
 
 
 
 
 
 
 

Detailed Description

Replace all uses of char * by a struct that carries that string, and also the underlying allocation and the C string length.

This will become useful (with some modifications) for supporting strings in the C frontend, as the string solver expects a struct that bundles the string length and the underlying character array.

Definition at line 32 of file string_abstraction.h.

Member Typedef Documentation

◆  abstraction_types_mapt

Definition at line 51 of file string_abstraction.h.

◆  localst

protected

Definition at line 139 of file string_abstraction.h.

Member Enumeration Documentation

◆  whatt

Enumerator
IS_ZERO 
LENGTH 
SIZE 

Definition at line 108 of file string_abstraction.h.

Constructor & Destructor Documentation

◆  string_abstractiont()

string_abstractiont::string_abstractiont ( goto_modeltgoto_model,
message_handlert_message_handler 
)

Apply string abstraction to goto_model.

If any abstractions are to be applied, the affected goto_functions and any affected symbols will be modified.

Definition at line 79 of file string_abstraction.cpp.

Member Function Documentation

◆  abstract() [1/2]

void string_abstractiont::abstract ( goto_programtdest )
protected

Definition at line 251 of file string_abstraction.cpp.

◆  abstract() [2/2]

goto_programt::targett string_abstractiont::abstract ( goto_programtdest,
)
protected

Definition at line 462 of file string_abstraction.cpp.

◆  abstract_assign()

goto_programt::targett string_abstractiont::abstract_assign ( goto_programtdest,
)
protected

Definition at line 512 of file string_abstraction.cpp.

◆  abstract_char_assign()

goto_programt::targett string_abstractiont::abstract_char_assign ( goto_programtdest,
)
protected

Definition at line 1186 of file string_abstraction.cpp.

◆  abstract_function_call()

void string_abstractiont::abstract_function_call ( goto_programt::targett  it )
protected

Definition at line 540 of file string_abstraction.cpp.

◆  abstract_pointer_assign()

goto_programt::targett string_abstractiont::abstract_pointer_assign ( goto_programtdest,
)
protected

Definition at line 1147 of file string_abstraction.cpp.

◆  add_dummy_symbol_and_value()

symbol_exprt string_abstractiont::add_dummy_symbol_and_value ( goto_programtdest,
goto_programt::targett  ref_instr,
const symboltsymbol,
const irep_idtcomponent_name,
const typettype,
const typetsource_type 
)
protected

Definition at line 397 of file string_abstraction.cpp.

◆  add_parameter()

code_typet::parametert string_abstractiont::add_parameter ( const symboltfct_symbol,
const typettype,
const irep_idtidentifier 
)
protected

Definition at line 219 of file string_abstraction.cpp.

◆  add_str_parameters()

void string_abstractiont::add_str_parameters ( symboltfct_symbol,
goto_functiont::parameter_identifierstparameter_identifiers 
)
protected

Definition at line 192 of file string_abstraction.cpp.

◆  apply() [1/2]

void string_abstractiont::apply ( )

Definition at line 130 of file string_abstraction.cpp.

◆  apply() [2/2]

void string_abstractiont::apply ( goto_programtdest )
protected

Definition at line 182 of file string_abstraction.cpp.

◆  build() [1/2]

bool string_abstractiont::build ( const exprtobject,
exprtdest,
bool  write 
)
protected

Definition at line 784 of file string_abstraction.cpp.

◆  build() [2/2]

exprt string_abstractiont::build ( const exprtpointer,
whatt  what,
bool  write,
const source_locationtsource_location 
)
protected

Definition at line 634 of file string_abstraction.cpp.

◆  build_abstraction_type()

const typet & string_abstractiont::build_abstraction_type ( const typettype )
protected

Definition at line 677 of file string_abstraction.cpp.

◆  build_abstraction_type_rec()

const typet & string_abstractiont::build_abstraction_type_rec ( const typettype,
)
protected

Definition at line 695 of file string_abstraction.cpp.

◆  build_array()

bool string_abstractiont::build_array ( const array_exprtobject,
exprtdest,
bool  write 
)
protected

Definition at line 893 of file string_abstraction.cpp.

◆  build_if()

bool string_abstractiont::build_if ( const if_exprto_if,
exprtdest,
bool  write 
)
protected

Definition at line 865 of file string_abstraction.cpp.

◆  build_new_symbol()

void string_abstractiont::build_new_symbol ( const symboltsymbol,
const irep_idtidentifier,
const typettype 
)
protected

Definition at line 1043 of file string_abstraction.cpp.

◆  build_pointer()

bool string_abstractiont::build_pointer ( const exprtobject,
exprtdest,
bool  write 
)
protected

Definition at line 919 of file string_abstraction.cpp.

◆  build_symbol()

bool string_abstractiont::build_symbol ( const symbol_exprtsym,
exprtdest 
)
protected

Definition at line 1003 of file string_abstraction.cpp.

◆  build_symbol_constant()

bool string_abstractiont::build_symbol_constant ( const mp_integerzero_length,
const mp_integerbuf_size,
exprtdest 
)
protected

Definition at line 1079 of file string_abstraction.cpp.

◆  build_type()

typet string_abstractiont::build_type ( whatt  what )
staticprotected

Definition at line 114 of file string_abstraction.cpp.

◆  build_unknown() [1/2]

exprt string_abstractiont::build_unknown ( const typettype,
bool  write 
)
protected

Definition at line 976 of file string_abstraction.cpp.

◆  build_unknown() [2/2]

exprt string_abstractiont::build_unknown ( whatt  what,
bool  write 
)
protected

Definition at line 952 of file string_abstraction.cpp.

◆  build_wrap()

bool string_abstractiont::build_wrap ( const exprtobject,
exprtdest,
bool  write 
)
protected

Definition at line 29 of file string_abstraction.cpp.

◆  char_assign()

goto_programt::targett string_abstractiont::char_assign ( goto_programtdest,
const exprtnew_lhs,
const exprtlhs,
const exprtrhs 
)
protected

Definition at line 1247 of file string_abstraction.cpp.

◆  declare_define_locals()

void string_abstractiont::declare_define_locals ( goto_programtdest )
protected

Definition at line 266 of file string_abstraction.cpp.

◆  has_string_macros()

bool string_abstractiont::has_string_macros ( const exprtexpr )
staticprotected

Definition at line 587 of file string_abstraction.cpp.

◆  is_char_type()

bool string_abstractiont::is_char_type ( const typettype ) const
inlineprotected

Definition at line 65 of file string_abstraction.h.

◆  is_ptr_string_struct()

bool string_abstractiont::is_ptr_string_struct ( const typettype ) const
protected

Definition at line 61 of file string_abstraction.cpp.

◆  make_decl_and_def()

void string_abstractiont::make_decl_and_def ( goto_programtdest,
goto_programt::targett  ref_instr,
const irep_idtidentifier,
const irep_idtsource_sym 
)
protected

Definition at line 301 of file string_abstraction.cpp.

◆  make_val_or_dummy_rec()

exprt string_abstractiont::make_val_or_dummy_rec ( goto_programtdest,
goto_programt::targett  ref_instr,
const symboltsymbol,
const typetsource_type 
)
protected

Definition at line 330 of file string_abstraction.cpp.

◆  member()

exprt string_abstractiont::member ( const exprta,
whatt  what 
)
protected

Definition at line 1392 of file string_abstraction.cpp.

◆  move_lhs_arithmetic()

void string_abstractiont::move_lhs_arithmetic ( exprtlhs,
exprtrhs 
)
protected

Definition at line 1121 of file string_abstraction.cpp.

◆  replace_string_macros()

void string_abstractiont::replace_string_macros ( exprtexpr,
bool  lhs,
const source_locationtsource_location 
)
protected

Definition at line 603 of file string_abstraction.cpp.

◆  value_assignments()

goto_programt::targett string_abstractiont::value_assignments ( goto_programtdest,
const exprtlhs,
const exprtrhs 
)
protected

Definition at line 1277 of file string_abstraction.cpp.

◆  value_assignments_if()

goto_programt::targett string_abstractiont::value_assignments_if ( goto_programtdest,
const exprtlhs,
const if_exprtrhs 
)
protected

Definition at line 1324 of file string_abstraction.cpp.

◆  value_assignments_string_struct()

goto_programt::targett string_abstractiont::value_assignments_string_struct ( goto_programtdest,
const exprtlhs,
const exprtrhs 
)
protected

Definition at line 1355 of file string_abstraction.cpp.

Member Data Documentation

◆  abstraction_types_map

abstraction_types_mapt string_abstractiont::abstraction_types_map
protected

Definition at line 52 of file string_abstraction.h.

◆  goto_model

goto_modelt& string_abstractiont::goto_model
protected

Definition at line 46 of file string_abstraction.h.

◆  initialization

goto_programt string_abstractiont::initialization
protected

Definition at line 137 of file string_abstraction.h.

◆  locals

localst string_abstractiont::locals
protected

Definition at line 140 of file string_abstraction.h.

◆  message_handler

message_handlert& string_abstractiont::message_handler
protected

Definition at line 49 of file string_abstraction.h.

◆  ns

namespacet string_abstractiont::ns
protected

Definition at line 47 of file string_abstraction.h.

◆  parameter_map

localst string_abstractiont::parameter_map
protected

Definition at line 141 of file string_abstraction.h.

◆  string_struct

typet string_abstractiont::string_struct
protected

Definition at line 136 of file string_abstraction.h.

◆  sym_suffix

std::string string_abstractiont::sym_suffix
protected

Definition at line 45 of file string_abstraction.h.

◆  temporary_counter

unsigned string_abstractiont::temporary_counter
protected

Definition at line 48 of file string_abstraction.h.


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

AltStyle によって変換されたページ (->オリジナル) /