Rename all the occurrences of a rule name to a new rule name, both in the definiens of a rule and in the name of the rule itself.
Function:
(defun rule-rename-rule (rule oldname newname) (declare (xargs :guard (and (rulep rule) (rulenamep oldname) (rulenamep newname)))) (make-rule :name (if (equal (rule->name rule) oldname) newname (rule->name rule)) :incremental (rule->incremental rule) :definiens (alternation-rename-rule (rule->definiens rule) oldname newname)))
Theorem:
(defthm rulep-of-rule-rename-rule (b* ((new-rule (rule-rename-rule rule oldname newname))) (rulep new-rule)) :rule-classes :rewrite)