X-Git-Url: https://scm.cri.ensmp.fr/git/Faustine.git/blobdiff_plain/c7f552fd8888da2f0d8cfb228fe0f28d3df3a12c..b4b6f2ea75b9f0f3ca918f5b84016610bf7a4d4f:/interpretor/preprocessor/faust-0.9.47mr3/compiler/headers/aterm.hh diff --git a/interpretor/preprocessor/faust-0.9.47mr3/compiler/headers/aterm.hh b/interpretor/preprocessor/faust-0.9.47mr3/compiler/headers/aterm.hh new file mode 100644 index 0000000..de59c70 --- /dev/null +++ b/interpretor/preprocessor/faust-0.9.47mr3/compiler/headers/aterm.hh @@ -0,0 +1,48 @@ +#ifndef __ATERM__ +#define __ATERM__ + +#include +#include +#include "tlib.hh" +#include "signals.hh" +#include "sigprint.hh" +#include "simplify.hh" +#include "normalize.hh" +#include "sigorderrules.hh" +#include +#include + +#include "mterm.hh" + +using namespace std; + +/** + * Implements a additive term, a set of mterms added together + * m1 + m2 + m3 + ... + */ +class aterm +{ + + map fSig2MTerms; ///< mapping between signatures and corresponding mterms + + public: + aterm (); ///< create an empty aterm (equivalent to 0) + aterm (Tree t); ///< create a aterm from an additive exp + //aterm (const aterm& a); ///< create a copy of an aterm + + const aterm& operator += (Tree t); ///< add in place an additive expression tree + const aterm& operator -= (Tree t); ///< add in place an additive expression tree + + const aterm& operator += (const mterm& m); ///< add in place an mterm + const aterm& operator -= (const mterm& m); ///< add in place an mterm + Tree normalizedTree() const; ///< return the corresponding normalized expression tree + + ostream& print(ostream& dst) const; ///< print a aterm m1 + m2 + m3 +... + mterm greatestDivisor() const; ///< return the greatest divisor of any two mterms + aterm factorize(const mterm& d); ///< reorganize the aterm by factorizing d +}; + +inline ostream& operator << (ostream& s, const aterm& a) { return a.print(s); } + + +#endif