(heap-fix x) is a usual ACL2::fty omap fixing function.
(heap-fix x) → *
Function:
(defun heap-fix (x) (declare (xargs :guard (heapp x))) (mbe :logic (if (heapp x) x nil) :exec x))
Theorem:
(defthm heapp-of-heap-fix (heapp (heap-fix x)))
Theorem:
(defthm heap-fix-when-heapp (implies (heapp x) (equal (heap-fix x) x)))
Theorem:
(defthm emptyp-heap-fix (implies (or (omap::emptyp x) (not (heapp x))) (omap::emptyp (heap-fix x))))
Theorem:
(defthm emptyp-of-heap-fix-to-not-heap-or-emptyp (equal (omap::emptyp (heap-fix x)) (or (not (heapp x)) (omap::emptyp x))))
Function:
(defun heap-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (heapp acl2::x) (heapp acl2::y)))) (equal (heap-fix acl2::x) (heap-fix acl2::y)))
Theorem:
(defthm heap-equiv-is-an-equivalence (and (booleanp (heap-equiv x y)) (heap-equiv x x) (implies (heap-equiv x y) (heap-equiv y x)) (implies (and (heap-equiv x y) (heap-equiv y z)) (heap-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm heap-equiv-implies-equal-heap-fix-1 (implies (heap-equiv acl2::x x-equiv) (equal (heap-fix acl2::x) (heap-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm heap-fix-under-heap-equiv (heap-equiv (heap-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-heap-fix-1-forward-to-heap-equiv (implies (equal (heap-fix acl2::x) acl2::y) (heap-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-heap-fix-2-forward-to-heap-equiv (implies (equal acl2::x (heap-fix acl2::y)) (heap-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm heap-equiv-of-heap-fix-1-forward (implies (heap-equiv (heap-fix acl2::x) acl2::y) (heap-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm heap-equiv-of-heap-fix-2-forward (implies (heap-equiv acl2::x (heap-fix acl2::y)) (heap-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)