Basic equivalence relation for stack structures.
Function:
(defun stack-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (stackp acl2::x) (stackp acl2::y)))) (equal (stack-fix acl2::x) (stack-fix acl2::y)))
Theorem:
(defthm stack-equiv-is-an-equivalence (and (booleanp (stack-equiv x y)) (stack-equiv x x) (implies (stack-equiv x y) (stack-equiv y x)) (implies (and (stack-equiv x y) (stack-equiv y z)) (stack-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm stack-equiv-implies-equal-stack-fix-1 (implies (stack-equiv acl2::x x-equiv) (equal (stack-fix acl2::x) (stack-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm stack-fix-under-stack-equiv (stack-equiv (stack-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-stack-fix-1-forward-to-stack-equiv (implies (equal (stack-fix acl2::x) acl2::y) (stack-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-stack-fix-2-forward-to-stack-equiv (implies (equal acl2::x (stack-fix acl2::y)) (stack-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm stack-equiv-of-stack-fix-1-forward (implies (stack-equiv (stack-fix acl2::x) acl2::y) (stack-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm stack-equiv-of-stack-fix-2-forward (implies (stack-equiv acl2::x (stack-fix acl2::y)) (stack-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)