Check if two variables are related by variable renaming.
(var-renamevar old new ren) → _
We check if the two variables form a pair in the renaming list.
Function:
(defun var-renamevar (old new ren) (declare (xargs :guard (and (identifierp old) (identifierp new) (renamingp ren)))) (let ((__function__ 'var-renamevar)) (declare (ignorable __function__)) (b* ((old (identifier-fix old)) (new (identifier-fix new))) (if (member-equal (cons old new) (renaming->list ren)) nil (reserrf (list :mismatch old new (renaming-fix ren)))))))
Theorem:
(defthm reserr-optionp-of-var-renamevar (b* ((_ (var-renamevar old new ren))) (reserr-optionp _)) :rule-classes :rewrite)
Theorem:
(defthm var-renamevar-of-identifier-fix-old (equal (var-renamevar (identifier-fix old) new ren) (var-renamevar old new ren)))
Theorem:
(defthm var-renamevar-identifier-equiv-congruence-on-old (implies (identifier-equiv old old-equiv) (equal (var-renamevar old new ren) (var-renamevar old-equiv new ren))) :rule-classes :congruence)
Theorem:
(defthm var-renamevar-of-identifier-fix-new (equal (var-renamevar old (identifier-fix new) ren) (var-renamevar old new ren)))
Theorem:
(defthm var-renamevar-identifier-equiv-congruence-on-new (implies (identifier-equiv new new-equiv) (equal (var-renamevar old new ren) (var-renamevar old new-equiv ren))) :rule-classes :congruence)
Theorem:
(defthm var-renamevar-of-renaming-fix-ren (equal (var-renamevar old new (renaming-fix ren)) (var-renamevar old new ren)))
Theorem:
(defthm var-renamevar-renaming-equiv-congruence-on-ren (implies (renaming-equiv ren ren-equiv) (equal (var-renamevar old new ren) (var-renamevar old new ren-equiv))) :rule-classes :congruence)