#include "aterm.hh"
#include <stdio.h>
#include <assert.h>
#include "tlib.hh"
#include "signals.hh"
#include "sigprint.hh"
#include "sigorderrules.hh"
#include <map>
#include <list>
#include "simplify.hh"
#include "normalize.hh"
#include "ppsig.hh"
Go to the source code of this file.
Typedefs | |
typedef map< Tree, mterm > | SM |
Functions | |
static Tree | simplifyingAdd (Tree t1, Tree t2) |
Add two terms trying to simplify the result. |
Add two terms trying to simplify the result.
Definition at line 33 of file aterm.cpp.
References addNums(), isNum(), isZero(), and sigAdd().
Referenced by aterm::normalizedTree().
00034 { 00035 assert(t1!=0); 00036 assert(t2!=0); 00037 00038 if (isNum(t1) && isNum(t2)) { 00039 return addNums(t1,t2); 00040 00041 } else if (isZero(t1)) { 00042 return t2; 00043 00044 } else if (isZero(t2)) { 00045 return t1; 00046 00047 } else if (t1 <= t2) { 00048 return sigAdd(t1, t2); 00049 00050 } else { 00051 return sigAdd(t2, t1); 00052 } 00053 }