Function: math[tree] - converts an algebraic expression to an expression tree

Calling Sequence:

tree(expr);

Parameters:

expr - any algebraic expression

Description:

math/tree splits an algebraic expression into its elemental components. Elemental components are either realcons or names (of variables).

The result is a list (of nested lists) representing the structure of expr as a tree with the elemental components the leaves.

This function is part of the math package, and so can be used only after performing the command with(math) or with(math, tree).

Examples:

> with(math):

> tree(x^3);

[Maple Math]

> tree(2*x^3+1);

[Maple Math]

> e := tree(2*x^3+sin(2*y));

[Maple Math]

> printtree(e);

+
*
2
^
x
3
sin
*
2
y

See Also:

math/printtree , op .

Version History:

Version 1.0 - June 08, 1998