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