How to make a simplifier



I would like general information on how to make a simplifier for pw.  I can get expressions in a complex form that can be simplified further but I don?t know how to write a simplifier.  Can someone point me in the right direction?

Rich