Use of replace rules in theorem proving