54 cerr << ++
TABBER <<
"Start simplification of : " <<
ppsig(sig) << endl;
64 cerr << --
TABBER <<
"Simplification of : " <<
ppsig(sig) <<
" Returns : " <<
ppsig(r) << endl;
96 for (
int i=0; i<sig->
arity(); i++) { args.push_back( sig->
branch(i) ); }
135 if (
isInt(n1, &i))
return t1;
148 if (
isInt(n1, &i))
return tree(
double(i));
158 if (
isZero(n1))
return t2;
159 if (
isNum(n1))
return t3;
161 if (t2==t3)
return t2;
169 if (
isZero(n1))
return t2;
170 if (
isOne(n1))
return t3;
171 if (
isNum(n1))
return t4;
194 return (
isNil(p)) ? t : p;
196 }
else if (
isRec(t,
id, body)) {
204 for (
int i = 0; i < n; i++) {
236 return (
isNil(p)) ? t : p;
238 }
else if (
isRec(t,
id, body)) {
250 return rec(id2,body2);
257 for (
int i = 0; i < n; i++) {
275 static void eraseProperties (
Tree key,
Tree t)
283 }
else if (
isRec(t,
id, body)) {
288 eraseProperties(key, body);
292 for (
int i=0; i<t->
arity(); i++) {
293 eraseProperties(key,t->
branch(i));
298 void eraseAllProperties(
Tree t)
300 cerr <<
"begin eraseAllProperties" << endl;
302 cerr <<
"end eraseAllProperties" << endl;
328 Tree tbl, tbl2, id, id2, size, igen, isig, ridx, widx, wsig;
bool isSigRDTbl(Tree s, Tree &t, Tree &i)
Tree pushEnv(Tree key, Tree val, Tree env)
Symbol * unique(const char *str)
Returns a new unique symbol of name strxxx.
bool searchEnv(Tree key, Tree &v, Tree env)
Class Node = (type x (int + double + Sym + void*))
bool isSigSelect2(Tree t, Tree &selector, Tree &s1, Tree &s2)
Tree DOCTABLES
Converts regular tables into doc tables in order to facilitate the mathematical documentation generat...
Tree rec(Tree body)
create a de Bruijn recursive tree
Tree ref(int level)
create a de Bruijn recursive reference
Tree sigSelect2(Tree selector, Tree s1, Tree s2)
A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches.
bool isSigFixDelay(Tree t, Tree &t0, Tree &t1)
static Tree traced_simplification(Tree sig)
Tree docTableConvertion(Tree sig)
const Node & node() const
return the content of the tree
bool isSigSelect3(Tree t, Tree &selector, Tree &s1, Tree &s2, Tree &s3)
Tree normalizeFixedDelayTerm(Tree s, Tree d)
Compute the normal form of a fixed delay term (s).
bool isSigGen(Tree t, Tree &x)
static Tree sigMapRename(Tree key, Tree env, tfun f, Tree t)
Like SigMap, recursively transform a graph by applying a function f.
bool isRef(Tree t, int &level)
is t a de Bruijn recursive reference
static Tree sigMap(Tree key, tfun f, Tree t)
Recursively transform a graph by applying a function f.
Tree sigDocAccessTbl(Tree tbl, Tree ridx)
bool isSigTable(Tree t, Tree &id, Tree &n, Tree &sig)
Tree normalizeDelay1Term(Tree s)
Compute the normal form of a 1-sample delay term s'.
bool isSigBinOp(Tree s, int *op, Tree &x, Tree &y)
bool isDouble(const Node &n)
bool isRightNeutral(const Node &a)
Tree sigDocConstantTbl(Tree n, Tree sig)
static Tree simplification(Tree sig)
bool isSigWRTbl(Tree u, Tree &id, Tree &t, Tree &i, Tree &s)
Tree normalizeAddTerm(Tree t)
Compute the Add-Normal form of a term t.
int arity() const
return the number of branches (subtrees) of a tree
virtual Tree computeSigOutput(const vector< Tree > &args)=0
static Tree docTableConverter(Tree sig)
bool isRec(Tree t, Tree &body)
is t a de Bruijn recursive tree
bool isSigDelay1(Tree t, Tree &t0)
bool isSigFloatCast(Tree t)
void setProperty(Tree t, Tree key, Tree val)
void * getUserData(Symbol *sym)
Returns user data.
bool isSigIntCast(Tree t)
Symbol * symbol(const char *str)
Returns (and creates if new) the symbol of name str.
Tree sigDocWriteTbl(Tree n, Tree sig, Tree widx, Tree wsig)
API to the typing system of signals.
bool isInt(const Node &n)
Node compute(const Node &a, const Node &b)
bool isLeftNeutral(const Node &a)
Tree branch(int i) const
return the ith branch (subtree) of a tree
bool getProperty(Tree t, Tree key, Tree &val)