Fixing function for alternative structures.
(alternative-fix x) → new-x
Function:
(defun alternative-fix$inline (x) (declare (xargs :guard (alternativep x))) (let ((__function__ 'alternative-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((name (identifier-fix (cdr (std::da-nth 0 x)))) (product (type-product-fix (cdr (std::da-nth 1 x))))) (list (cons 'name name) (cons 'product product))) :exec x)))
Theorem:
(defthm alternativep-of-alternative-fix (b* ((new-x (alternative-fix$inline x))) (alternativep new-x)) :rule-classes :rewrite)
Theorem:
(defthm alternative-fix-when-alternativep (implies (alternativep x) (equal (alternative-fix x) x)))
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)