Total correctness of a goal replacement rule based on the unfold/fold proof method