A tree library with hashconsing and maximal sharing capabilities.
Tree remElement(Tree e, Tree l1)
A library to create and manipulate symbols with a unique name.
bool getProperty(Tree t, Tree key, Tree &val)
Class Node = (type x (int + double + Sym + void*))
Tree addElement(Tree e, Tree l1)
Tree cons(Tree a, Tree b)
void setProperty(Tree t, Tree key, Tree val)
A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches.
const Node & node() const
return the content of the tree
Tree list4(Tree a, Tree b, Tree c, Tree d)
Tree pushEnv(Tree key, Tree val, Tree env=nil)
Tree list3(Tree a, Tree b, Tree c)
void print(Tree t, FILE *out=stdout)
Tree tmap(Tree k, tfun f, Tree t)
bool isElement(Tree e, Tree l)
Tree lrange(Tree l, int i, int j)
Tree rconcat(Tree l1, Tree l2)
Tree list2(Tree a, Tree b)
Tree concat(Tree l1, Tree l2)
int arity() const
return the number of branches (subtrees) of a tree
bool searchEnv(Tree key, Tree &v, Tree env)
Tree substitute(Tree t, Tree id, Tree val)
void remProperty(Tree t, Tree key)
Tree replace(Tree l, int i, Tree e)
Tree setUnion(Tree l1, Tree l2)
Symbols are unique objects with a name stored in a hash table.
Tree setIntersection(Tree l1, Tree l2)
Tree lmap(tfun f, Tree l)
Tree setDifference(Tree l1, Tree l2)
Tree branch(int i) const
return the ith branch (subtree) of a tree