Merge clauses when the bodies have the same subgoals.