Check if two optional function calls are related by variable renaming.
(funcall-option-renamevar old new ren) → _
Either both function calls must be present or both must be absent. If present, they must be related.
Function:
(defun funcall-option-renamevar (old new ren) (declare (xargs :guard (and (funcall-optionp old) (funcall-optionp new) (renamingp ren)))) (let ((__function__ 'funcall-option-renamevar)) (declare (ignorable __function__)) (funcall-option-case old :none (if (funcall-option-case new :none) nil (reserrf (list :mismatch (funcall-option-fix old) (funcall-option-fix new)))) :some (funcall-option-case new :none (reserrf (list :mismatch (funcall-option-fix old) (funcall-option-fix new))) :some (funcall-renamevar (funcall-option-some->val old) (funcall-option-some->val new) ren)))))
Theorem:
(defthm reserr-optionp-of-funcall-option-renamevar (b* ((_ (funcall-option-renamevar old new ren))) (reserr-optionp _)) :rule-classes :rewrite)
Theorem:
(defthm funcall-option-renamevar-of-funcall-option-fix-old (equal (funcall-option-renamevar (funcall-option-fix old) new ren) (funcall-option-renamevar old new ren)))
Theorem:
(defthm funcall-option-renamevar-funcall-option-equiv-congruence-on-old (implies (funcall-option-equiv old old-equiv) (equal (funcall-option-renamevar old new ren) (funcall-option-renamevar old-equiv new ren))) :rule-classes :congruence)
Theorem:
(defthm funcall-option-renamevar-of-funcall-option-fix-new (equal (funcall-option-renamevar old (funcall-option-fix new) ren) (funcall-option-renamevar old new ren)))
Theorem:
(defthm funcall-option-renamevar-funcall-option-equiv-congruence-on-new (implies (funcall-option-equiv new new-equiv) (equal (funcall-option-renamevar old new ren) (funcall-option-renamevar old new-equiv ren))) :rule-classes :congruence)
Theorem:
(defthm funcall-option-renamevar-of-renaming-fix-ren (equal (funcall-option-renamevar old new (renaming-fix ren)) (funcall-option-renamevar old new ren)))
Theorem:
(defthm funcall-option-renamevar-renaming-equiv-congruence-on-ren (implies (renaming-equiv ren ren-equiv) (equal (funcall-option-renamevar old new ren) (funcall-option-renamevar old new ren-equiv))) :rule-classes :congruence)