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