xlpoly.spad line 1 [edit on github]
This type is the basic representation of parenthesized words (binary trees over arbitrary symbols) useful in LiePolynomial. Author: Michel Petitot (petitot@lifl.fr).
x*y returns the tree [x, y].
coerce(x) returns the element of FreeMonoid(VarSet) corresponding to x by removing parentheses.
first(x) returns the first entry of the tree x.
left(x) returns left subtree of x or error if retractable?(x) is true.
length(x) returns the number of entries in x.
lexico(x, y) returns true iff x is smaller than y w.r.t. the lexicographical ordering induced by VarSet. N.B. This operation does not take into account the tree structure of its arguments. Thus this is not a total ordering.
mirror(x) returns the reversed word of x. That is x itself if retractable?(x) is true and mirror(z) * mirror(y) if x is y*z.
rest(x) return x without the first entry or error if retractable?(x) is true.
retractable?(x) tests if x is a tree with only one entry.
right(x) returns right subtree of x or error if retractable?(x) is true.
varList(x) returns the list of distinct entries of x.
RetractableTo(VarSet)
CoercibleFrom(VarSet)