Fixing function for vl-elabkey structures.
(vl-elabkey-fix x) → new-x
Function:
(defun vl-elabkey-fix$inline (x) (declare (xargs :guard (vl-elabkey-p x))) (let ((__function__ 'vl-elabkey-fix)) (declare (ignorable __function__)) (mbe :logic (common-lisp::case (vl-elabkey-kind x) (:package (b* ((name (str-fix (cdr x)))) (hons :package name))) (:class (b* ((name (str-fix (cdr x)))) (hons :class name))) (:item (b* ((name (str-fix (cdr x)))) (hons :item name))) (:index (b* ((val (ifix (cdr x)))) (hons :index val))) (:def (b* ((name (str-fix (cdr x)))) (hons :def name)))) :exec x)))
Theorem:
(defthm vl-elabkey-p-of-vl-elabkey-fix (b* ((new-x (vl-elabkey-fix$inline x))) (vl-elabkey-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm vl-elabkey-fix-when-vl-elabkey-p (implies (vl-elabkey-p x) (equal (vl-elabkey-fix x) x)))
Function:
(defun vl-elabkey-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (vl-elabkey-p acl2::x) (vl-elabkey-p acl2::y)))) (equal (vl-elabkey-fix acl2::x) (vl-elabkey-fix acl2::y)))
Theorem:
(defthm vl-elabkey-equiv-is-an-equivalence (and (booleanp (vl-elabkey-equiv x y)) (vl-elabkey-equiv x x) (implies (vl-elabkey-equiv x y) (vl-elabkey-equiv y x)) (implies (and (vl-elabkey-equiv x y) (vl-elabkey-equiv y z)) (vl-elabkey-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm vl-elabkey-equiv-implies-equal-vl-elabkey-fix-1 (implies (vl-elabkey-equiv acl2::x x-equiv) (equal (vl-elabkey-fix acl2::x) (vl-elabkey-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm vl-elabkey-fix-under-vl-elabkey-equiv (vl-elabkey-equiv (vl-elabkey-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-vl-elabkey-fix-1-forward-to-vl-elabkey-equiv (implies (equal (vl-elabkey-fix acl2::x) acl2::y) (vl-elabkey-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-vl-elabkey-fix-2-forward-to-vl-elabkey-equiv (implies (equal acl2::x (vl-elabkey-fix acl2::y)) (vl-elabkey-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm vl-elabkey-equiv-of-vl-elabkey-fix-1-forward (implies (vl-elabkey-equiv (vl-elabkey-fix acl2::x) acl2::y) (vl-elabkey-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm vl-elabkey-equiv-of-vl-elabkey-fix-2-forward (implies (vl-elabkey-equiv acl2::x (vl-elabkey-fix acl2::y)) (vl-elabkey-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm vl-elabkey-kind$inline-of-vl-elabkey-fix-x (equal (vl-elabkey-kind$inline (vl-elabkey-fix x)) (vl-elabkey-kind$inline x)))
Theorem:
(defthm vl-elabkey-kind$inline-vl-elabkey-equiv-congruence-on-x (implies (vl-elabkey-equiv x x-equiv) (equal (vl-elabkey-kind$inline x) (vl-elabkey-kind$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm consp-of-vl-elabkey-fix (consp (vl-elabkey-fix x)) :rule-classes :type-prescription)