Fixing function for linkage structures.
Function:
(defun linkage-fix$inline (x) (declare (xargs :guard (linkagep x))) (let ((__function__ 'linkage-fix)) (declare (ignorable __function__)) (mbe :logic (case (linkage-kind x) (:external (cons :external (list))) (:internal (cons :internal (list))) (:none (cons :none (list)))) :exec x)))
Theorem:
(defthm linkagep-of-linkage-fix (b* ((new-x (linkage-fix$inline x))) (linkagep new-x)) :rule-classes :rewrite)
Theorem:
(defthm linkage-fix-when-linkagep (implies (linkagep x) (equal (linkage-fix x) x)))
Function:
(defun linkage-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (linkagep acl2::x) (linkagep acl2::y)))) (equal (linkage-fix acl2::x) (linkage-fix acl2::y)))
Theorem:
(defthm linkage-equiv-is-an-equivalence (and (booleanp (linkage-equiv x y)) (linkage-equiv x x) (implies (linkage-equiv x y) (linkage-equiv y x)) (implies (and (linkage-equiv x y) (linkage-equiv y z)) (linkage-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm linkage-equiv-implies-equal-linkage-fix-1 (implies (linkage-equiv acl2::x x-equiv) (equal (linkage-fix acl2::x) (linkage-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm linkage-fix-under-linkage-equiv (linkage-equiv (linkage-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-linkage-fix-1-forward-to-linkage-equiv (implies (equal (linkage-fix acl2::x) acl2::y) (linkage-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-linkage-fix-2-forward-to-linkage-equiv (implies (equal acl2::x (linkage-fix acl2::y)) (linkage-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm linkage-equiv-of-linkage-fix-1-forward (implies (linkage-equiv (linkage-fix acl2::x) acl2::y) (linkage-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm linkage-equiv-of-linkage-fix-2-forward (implies (linkage-equiv acl2::x (linkage-fix acl2::y)) (linkage-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm linkage-kind$inline-of-linkage-fix-x (equal (linkage-kind$inline (linkage-fix x)) (linkage-kind$inline x)))
Theorem:
(defthm linkage-kind$inline-linkage-equiv-congruence-on-x (implies (linkage-equiv x x-equiv) (equal (linkage-kind$inline x) (linkage-kind$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm consp-of-linkage-fix (consp (linkage-fix x)) :rule-classes :type-prescription)