Algorithm for Proving Trace Equivalence