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