Fixing function for funcall-option structures.
(funcall-option-fix x) → new-x
Function:
(defun funcall-option-fix$inline (x) (declare (xargs :guard (funcall-optionp x))) (let ((__function__ 'funcall-option-fix)) (declare (ignorable __function__)) (mbe :logic (cond ((not x) nil) (t (b* ((fty::val (funcall-fix x))) fty::val))) :exec x)))
Theorem:
(defthm funcall-optionp-of-funcall-option-fix (b* ((new-x (funcall-option-fix$inline x))) (funcall-optionp new-x)) :rule-classes :rewrite)
Theorem:
(defthm funcall-option-fix-when-funcall-optionp (implies (funcall-optionp x) (equal (funcall-option-fix x) x)))
Function:
(defun funcall-option-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (funcall-optionp acl2::x) (funcall-optionp acl2::y)))) (equal (funcall-option-fix acl2::x) (funcall-option-fix acl2::y)))
Theorem:
(defthm funcall-option-equiv-is-an-equivalence (and (booleanp (funcall-option-equiv x y)) (funcall-option-equiv x x) (implies (funcall-option-equiv x y) (funcall-option-equiv y x)) (implies (and (funcall-option-equiv x y) (funcall-option-equiv y z)) (funcall-option-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm funcall-option-equiv-implies-equal-funcall-option-fix-1 (implies (funcall-option-equiv acl2::x x-equiv) (equal (funcall-option-fix acl2::x) (funcall-option-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm funcall-option-fix-under-funcall-option-equiv (funcall-option-equiv (funcall-option-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-funcall-option-fix-1-forward-to-funcall-option-equiv (implies (equal (funcall-option-fix acl2::x) acl2::y) (funcall-option-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-funcall-option-fix-2-forward-to-funcall-option-equiv (implies (equal acl2::x (funcall-option-fix acl2::y)) (funcall-option-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm funcall-option-equiv-of-funcall-option-fix-1-forward (implies (funcall-option-equiv (funcall-option-fix acl2::x) acl2::y) (funcall-option-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm funcall-option-equiv-of-funcall-option-fix-2-forward (implies (funcall-option-equiv acl2::x (funcall-option-fix acl2::y)) (funcall-option-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)