What's an expression tree?
import pymbolic.primitives as p
x = p.Variable("x")
y = p.Variable("y")
x
Let's look what happens with a simple expression:
x+5
It does not get evaluated.
Let's look at its type and structure in more detail.
u = x+5
type(u)
u.children
OK, easy. What if we introduce a product?
u = x + 4*y
u
u.children[0]
u.children[1]
u.children[1].children[0]
u.children[1].children[1]
This structure is a called a tree, because there is a root and branches.