CBMC
is_constantt Class Reference

Determine whether an expression is constant. More...

#include <expr_util.h>

+ Inheritance diagram for is_constantt:

Public Member Functions

bool operator() (const exprt &e) const
 returns true iff the expression can be considered constant More...
 

Protected Member Functions

virtual bool is_constant (const exprt &) const
 This function determines what expressions are to be propagated as "constants". More...
 
virtual bool is_constant_address_of (const exprt &) const
 this function determines which reference-typed expressions are constant More...
 

Detailed Description

Determine whether an expression is constant.

A literal constant is constant, but so are, e.g., sums over constants or addresses of objects. An implementation derive from this class to refine what it considers constant in a particular context by overriding is_constant and/or is_constant_address_of.

Definition at line 88 of file expr_util.h.

Member Function Documentation

◆ is_constant()

bool is_constantt::is_constant ( const exprt expr) const
protectedvirtual

This function determines what expressions are to be propagated as "constants".

Reimplemented in constant_propagator_is_constantt, havoc_utils_is_constantt, goto_symex_is_constantt, and is_compile_time_constantt.

Definition at line 227 of file expr_util.cpp.

◆ is_constant_address_of()

bool is_constantt::is_constant_address_of ( const exprt expr) const
protectedvirtual

this function determines which reference-typed expressions are constant

Reimplemented in is_compile_time_constantt.

Definition at line 255 of file expr_util.cpp.

◆ operator()()

bool is_constantt::operator() ( const exprt e) const
inline

returns true iff the expression can be considered constant

Definition at line 92 of file expr_util.h.


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