CBMC
pointer_offset_sum.cpp
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module: Pointer Analysis
4 
5 Author: Daniel Kroening, kroening@kroening.com
6 
7 \*******************************************************************/
8 
11 
12 #include "pointer_offset_sum.h"
13 
14 #include "std_expr.h"
15 
16 exprt pointer_offset_sum(const exprt &a, const exprt &b)
17 {
18  if(a.id() == ID_unknown)
19  return a;
20  else if(b.id() == ID_unknown)
21  return b;
22  else if(a.is_zero())
23  return b;
24  else if(b.is_zero())
25  return a;
26 
28 }
typecast_exprt::conditional_cast
static exprt conditional_cast(const exprt &expr, const typet &type)
Definition: std_expr.h:2025
plus_exprt
The plus expression Associativity is not specified.
Definition: std_expr.h:946
exprt
Base class for all expressions.
Definition: expr.h:55
exprt::type
typet & type()
Return the type of the expression.
Definition: expr.h:84
pointer_offset_sum
exprt pointer_offset_sum(const exprt &a, const exprt &b)
Definition: pointer_offset_sum.cpp:16
irept::id
const irep_idt & id() const
Definition: irep.h:396
exprt::is_zero
bool is_zero() const
Return whether the expression is a constant representing 0.
Definition: expr.cpp:65
pointer_offset_sum.h
std_expr.h