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