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