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