cprover
type.cpp File Reference
#include "type.h"
#include "std_types.h"
#include "namespace.h"
Include dependency graph for type.cpp:

Go to the source code of this file.

Functions

bool is_number (const typet &type)
 
bool is_constant_or_has_constant_components (const typet &type, const namespacet &ns)
 Identify if a given type is constant itself or contains constant components. More...
 

Function Documentation

◆ is_constant_or_has_constant_components()

bool is_constant_or_has_constant_components ( const typet type,
const namespacet ns 
)

Identify if a given type is constant itself or contains constant components.

Examples include:

  • const int a;
  • struct contains_constant_pointer { int x; int * const p; };
  • const int b[3];
    Parameters
    typeThe type we want to query constness of.
    nsThe namespace, needed for resolution of symbols.
    Returns
    Whether passed in type is const or not.

Definition at line 47 of file type.cpp.

References namespace_baset::follow(), irept::get_bool(), typet::has_subtype(), irept::id(), is_constant_or_has_constant_components(), typet::subtype(), and to_struct_union_type().

Referenced by is_constant_or_has_constant_components(), and nondet_static().

◆ is_number()