This module is an extension to the Math::Symbolic module. A basic
familiarity with that module is required.
Math::Symbolic offers some builtin simplification routines. These, however,
are not capable of complex simplifications. This extension offers facilities
to override the default simplification routines through means of subclassing
this module. A subclass of this module is required to define a simplify
object method that implements a simplification of Math::Symbolic trees.
There are two class methods to inherit: register and unregister.
Calling the register method on your subclass registers your class as
providing the simplify method that is invoked whenever simplify()
is called on a Math::Symbolic::Operator object.
Calling unregister on your subclass restores whichever simplification
routines where in place before.
Several subsequent register() and c<unregister()> calls on different
subclasses can be used to localize simplification routines.
The old routines are saved to a stack.
If there are several subclasses of this module, say MySimplification and
MyOtherSimplification, calling MySimplification-register()>, then
MyOtherSimplification-register()> will finally provide the
simplification routines of MyOtherSimplification. Unregistering
MyOtherSimplification revert to the routine from MySimplification.
If you unregister out of order (i.e. in the above example if you
unregistered MySimplification instead of MyOtherSimplification),
all simplification routines up to and including the one youre unregistering
are removed and the one that was in effect before MySimplification (here:
the default simplify()) is restored.