Basic equivalence relation for heap structures.
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)