FAUST compiler  0.9.9.6b8
Typedefs | Functions
aterm.cpp File Reference
#include "aterm.hh"
#include "ppsig.hh"
Include dependency graph for aterm.cpp:

Go to the source code of this file.

Typedefs

typedef map< Tree, mtermSM

Functions

static Tree simplifyingAdd (Tree t1, Tree t2)
 Add two terms trying to simplify the result.

Typedef Documentation

typedef map<Tree,mterm> SM

Definition at line 9 of file aterm.cpp.


Function Documentation

static Tree simplifyingAdd ( Tree  t1,
Tree  t2 
) [static]

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().

{
    assert(t1!=0);
    assert(t2!=0);

    if (isNum(t1) && isNum(t2)) {
        return addNums(t1,t2);

    } else if (isZero(t1)) {
        return t2;

    } else if (isZero(t2)) {
        return t1;

    } else if (t1 <= t2) {
        return sigAdd(t1, t2);

    } else {
        return sigAdd(t2, t1);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function: