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