CBMC
simplify_utils.cpp File Reference
#include "simplify_utils.h"
#include "arith_tools.h"
#include "c_types.h"
#include "config.h"
#include "endianness_map.h"
#include "expr_util.h"
#include "namespace.h"
#include "pointer_expr.h"
#include "pointer_offset_size.h"
#include "std_expr.h"
#include "string_constant.h"
#include "symbol.h"
#include <algorithm>
+ Include dependency graph for simplify_utils.cpp:

Go to the source code of this file.

Classes

struct  saj_tablet
 produce canonical ordering for associative and commutative binary operators More...
 

Functions

bool sort_operands (exprt::operandst &operands)
 sort operands of an expression according to ordering defined by operator< More...
 
static bool is_associative_and_commutative_for_type (const struct saj_tablet &saj_entry, const irep_idt &type_id)
 
static const struct saj_tabletget_sort_and_join_table_entry (const irep_idt &id, const irep_idt &type_id)
 
static bool sort_and_join (exprt &expr, bool do_sort)
 
bool sort_and_join (exprt &expr)
 
bool join_operands (exprt &expr)
 
std::optional< exprtbits2expr (const std::string &bits, const typet &type, bool little_endian, const namespacet &ns)
 
std::optional< std::string > expr2bits (const exprt &expr, bool little_endian, const namespacet &ns)
 
std::optional< std::reference_wrapper< const array_exprt > > try_get_string_data_array (const exprt &content, const namespacet &ns)
 Get char sequence from content field of a refined string expression. More...
 

Variables

struct saj_tablet saj_table []
 

Function Documentation

◆ bits2expr()

std::optional<exprt> bits2expr ( const std::string &  bits,
const typet type,
bool  little_endian,
const namespacet ns 
)

Definition at line 196 of file simplify_utils.cpp.

◆ expr2bits()

std::optional<std::string> expr2bits ( const exprt expr,
bool  little_endian,
const namespacet ns 
)

Definition at line 414 of file simplify_utils.cpp.

◆ get_sort_and_join_table_entry()

static const struct saj_tablet& get_sort_and_join_table_entry ( const irep_idt id,
const irep_idt type_id 
)
static

Definition at line 121 of file simplify_utils.cpp.

◆ is_associative_and_commutative_for_type()

static bool is_associative_and_commutative_for_type ( const struct saj_tablet saj_entry,
const irep_idt type_id 
)
static

Definition at line 109 of file simplify_utils.cpp.

◆ join_operands()

bool join_operands ( exprt expr)

Definition at line 191 of file simplify_utils.cpp.

◆ sort_and_join() [1/2]

bool sort_and_join ( exprt expr)

Definition at line 186 of file simplify_utils.cpp.

◆ sort_and_join() [2/2]

static bool sort_and_join ( exprt expr,
bool  do_sort 
)
static

Definition at line 136 of file simplify_utils.cpp.

◆ sort_operands()

bool sort_operands ( exprt::operandst operands)

sort operands of an expression according to ordering defined by operator<

parameters: operand list
Returns
modifies operand list returns true iff nothing was changed

Definition at line 28 of file simplify_utils.cpp.

◆ try_get_string_data_array()

std::optional<std::reference_wrapper<const array_exprt> > try_get_string_data_array ( const exprt content,
const namespacet ns 
)

Get char sequence from content field of a refined string expression.

If content is of the form &id[e], where id is an array-typed symbol expression (and e is any expression), return the value of the symbol id (as given by the value field of the symbol in the namespace ns); otherwise return an empty optional.

Parameters
contentcontent field of a refined string expression
nsnamespace
Returns
array expression representing the char sequence which forms the content of the refined string expression, empty optional if the content cannot be determined

Definition at line 489 of file simplify_utils.cpp.

Variable Documentation

◆ saj_table

struct saj_tablet saj_table[]