cprover
interval_domaint Class Reference

#include <interval_domain.h>

Inheritance diagram for interval_domaint:
[legend]
Collaboration diagram for interval_domaint:
[legend]

Public Member Functions

 interval_domaint ()
 
void transform (locationt from, locationt to, ai_baset &ai, const namespacet &ns) final
 
void output (std::ostream &out, const ai_baset &ai, const namespacet &ns) const final
 
bool merge (const interval_domaint &b, locationt from, locationt to)
 
void make_bottom () final
 
void make_top () final
 
void make_entry () final
 
exprt make_expression (const symbol_exprt &) const
 
void assume (const exprt &, const namespacet &)
 
bool is_bottom () const
 
virtual bool ai_simplify (exprt &condition, const namespacet &ns) const override
 Uses the abstract state to simplify a given expression using context- specific information. More...
 
- Public Member Functions inherited from ai_domain_baset
 ai_domain_baset ()
 
virtual ~ai_domain_baset ()
 
virtual void transform (locationt from, locationt to, ai_baset &ai, const namespacet &ns)=0
 
virtual jsont output_json (const ai_baset &ai, const namespacet &ns) const
 
virtual xmlt output_xml (const ai_baset &ai, const namespacet &ns) const
 
virtual bool ai_simplify_lhs (exprt &condition, const namespacet &ns) const
 Use the information in the domain to simplify the expression on the LHS of an assignment. More...
 

Static Public Member Functions

static bool is_int (const typet &src)
 
static bool is_float (const typet &src)
 

Protected Types

typedef std::map< irep_idt, integer_intervaltint_mapt
 
typedef std::map< irep_idt, ieee_float_intervaltfloat_mapt
 

Protected Member Functions

bool join (const interval_domaint &b)
 Sets *this to the mathematical join between the two domains. More...
 
void havoc_rec (const exprt &)
 
void assume_rec (const exprt &, bool negation=false)
 
void assume_rec (const exprt &lhs, irep_idt id, const exprt &rhs)
 
void assign (const class code_assignt &assignment)
 
integer_intervalt get_int_rec (const exprt &)
 
ieee_float_intervalt get_float_rec (const exprt &)
 

Protected Attributes

bool bottom
 
int_mapt int_map
 
float_mapt float_map
 

Additional Inherited Members

- Public Types inherited from ai_domain_baset
typedef goto_programt::const_targett locationt
 

Detailed Description

Definition at line 24 of file interval_domain.h.

Member Typedef Documentation

§ float_mapt

Definition at line 106 of file interval_domain.h.

§ int_mapt

Definition at line 105 of file interval_domain.h.

Constructor & Destructor Documentation

§ interval_domaint()

interval_domaint::interval_domaint ( )
inline

Definition at line 31 of file interval_domain.h.

References join(), output(), and transform().

Member Function Documentation

§ ai_simplify()

bool interval_domaint::ai_simplify ( exprt condition,
const namespacet ns 
) const
overridevirtual

Uses the abstract state to simplify a given expression using context- specific information.

parameters: The expression to simplify.
Returns
A simplified version of the expression.

Reimplemented from ai_domain_baset.

Definition at line 454 of file interval_domain.cpp.

References assume(), irept::id(), is_bottom(), exprt::is_true(), join(), make_top(), and exprt::make_true().

Referenced by is_bottom().

§ assign()

void interval_domaint::assign ( const class code_assignt assignment)
protected

Definition at line 179 of file interval_domain.cpp.

References assume_rec(), havoc_rec(), code_assignt::lhs(), and code_assignt::rhs().

Referenced by transform().

§ assume()

void interval_domaint::assume ( const exprt cond,
const namespacet ns 
)

Definition at line 321 of file interval_domain.cpp.

References assume_rec(), and simplify_expr().

Referenced by ai_simplify(), static_analyzert::eval(), make_entry(), and transform().

§ assume_rec() [1/2]

void interval_domaint::assume_rec ( const exprt cond,
bool  negation = false 
)
protected

§ assume_rec() [2/2]

§ get_float_rec()

ieee_float_intervalt interval_domaint::get_float_rec ( const exprt )
protected

§ get_int_rec()

integer_intervalt interval_domaint::get_int_rec ( const exprt )
protected

§ havoc_rec()

void interval_domaint::havoc_rec ( const exprt lhs)
protected

§ is_bottom()

bool interval_domaint::is_bottom ( ) const
inline

Definition at line 93 of file interval_domain.h.

References ai_simplify(), and bottom.

Referenced by ai_simplify(), and static_analyzert::eval().

§ is_float()

static bool interval_domaint::is_float ( const typet src)
inlinestatic

Definition at line 88 of file interval_domain.h.

References irept::id().

Referenced by assume_rec(), havoc_rec(), and make_expression().

§ is_int()

static bool interval_domaint::is_int ( const typet src)
inlinestatic

Definition at line 83 of file interval_domain.h.

References irept::id().

Referenced by assume_rec(), havoc_rec(), and make_expression().

§ join()

bool interval_domaint::join ( const interval_domaint b)
protected

Sets *this to the mathematical join between the two domains.

This can be thought of as an abstract version of union; *this is increased so that it contains all of the values that are represented by b as well as its original intervals. The result is an overapproximation, for example: "[0,1]".join("[3,4]") –> "[0,4]" includes 2 which isn't in [0,1] or [3,4].

     Join is used in several places, the most significant being
     merge, which uses it to bring together two different paths
     of analysis.
parameters: The interval domain, b, to join to this domain.
Returns
True if the join increases the set represented by *this, False if there is no change.

Definition at line 121 of file interval_domain.cpp.

References bottom, float_map, int_map, and interval_templatet< T >::join().

Referenced by ai_simplify(), interval_domaint(), and merge().

§ make_bottom()

void interval_domaint::make_bottom ( )
inlinefinalvirtual

Implements ai_domain_baset.

Definition at line 59 of file interval_domain.h.

References bottom, float_map, and int_map.

Referenced by assume_rec().

§ make_entry()

void interval_domaint::make_entry ( )
inlinefinalvirtual

Implements ai_domain_baset.

Definition at line 74 of file interval_domain.h.

References assume(), make_expression(), and make_top().

§ make_expression()

§ make_top()

void interval_domaint::make_top ( )
inlinefinalvirtual

Implements ai_domain_baset.

Definition at line 67 of file interval_domain.h.

References bottom, float_map, and int_map.

Referenced by ai_simplify(), and make_entry().

§ merge()

bool interval_domaint::merge ( const interval_domaint b,
locationt  from,
locationt  to 
)
inline

Definition at line 50 of file interval_domain.h.

References join().

§ output()

void interval_domaint::output ( std::ostream &  out,
const ai_baset ai,
const namespacet ns 
) const
finalvirtual

Reimplemented from ai_domain_baset.

Definition at line 22 of file interval_domain.cpp.

References bottom, float_map, and int_map.

Referenced by interval_domaint().

§ transform()

Member Data Documentation

§ bottom

bool interval_domaint::bottom
protected

Definition at line 103 of file interval_domain.h.

Referenced by is_bottom(), join(), make_bottom(), make_top(), and output().

§ float_map

float_mapt interval_domaint::float_map
protected

§ int_map

int_mapt interval_domaint::int_map
protected

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