Fixing function for renaming structures.
Function:
(defun renaming-fix$inline (x) (declare (xargs :guard (renamingp x))) (let ((__function__ 'renaming-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((list (identifier-identifier-alist-fix (cdr (std::da-nth 0 x))))) (let ((list (if (and (no-duplicatesp-equal (strip-cars list)) (no-duplicatesp-equal (strip-cdrs list))) list nil))) (list (cons 'list list)))) :exec x)))
Theorem:
(defthm renamingp-of-renaming-fix (b* ((new-x (renaming-fix$inline x))) (renamingp new-x)) :rule-classes :rewrite)
Theorem:
(defthm renaming-fix-when-renamingp (implies (renamingp x) (equal (renaming-fix x) x)))
Function:
(defun renaming-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (renamingp acl2::x) (renamingp acl2::y)))) (equal (renaming-fix acl2::x) (renaming-fix acl2::y)))
Theorem:
(defthm renaming-equiv-is-an-equivalence (and (booleanp (renaming-equiv x y)) (renaming-equiv x x) (implies (renaming-equiv x y) (renaming-equiv y x)) (implies (and (renaming-equiv x y) (renaming-equiv y z)) (renaming-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm renaming-equiv-implies-equal-renaming-fix-1 (implies (renaming-equiv acl2::x x-equiv) (equal (renaming-fix acl2::x) (renaming-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm renaming-fix-under-renaming-equiv (renaming-equiv (renaming-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-renaming-fix-1-forward-to-renaming-equiv (implies (equal (renaming-fix acl2::x) acl2::y) (renaming-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-renaming-fix-2-forward-to-renaming-equiv (implies (equal acl2::x (renaming-fix acl2::y)) (renaming-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm renaming-equiv-of-renaming-fix-1-forward (implies (renaming-equiv (renaming-fix acl2::x) acl2::y) (renaming-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm renaming-equiv-of-renaming-fix-2-forward (implies (renaming-equiv acl2::x (renaming-fix acl2::y)) (renaming-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)