Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

asked 12 years ago

rmp251 gravatar image

Traversing sage's symbolic expression trees in python

I'm writing some python code around sage and I need to build an expression tree of the following basic form:

  • each node represents an operation
  • each child tree represents an expression tree to which the operation applies

Can anyone point me in the right direction as to how to traverse an instance of sage.symbolic.expression.Expression, so as to extract this kind of semantic information?