Lists can be used to represent sets. They can also be used to represent trees:
[ plus, a, b ]. [ plus, [times,a,b], [times,c,d] ].
Above, we use them to represent expressions built up from the operators
plus
and times
. If these operators are commutative, it is
often convenient to give them more than two arguments:
[ plus, a, b, c, d ].instead of
[ plus, [ plus, a, b ], [ plus, c, d ] ].
Many algebra-manipulation programs use this method.