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