Fixing function for hex-quad structures.
Function:
(defun hex-quad-fix$inline (x) (declare (xargs :guard (hex-quadp x))) (let ((__function__ 'hex-quad-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))))) (3rd (hex-digit-fix (cdr (std::da-nth 2 (cdr x))))) (4th (hex-digit-fix (cdr (std::da-nth 3 (cdr x)))))) (cons :hex-quad (list (cons '1st 1st) (cons '2nd 2nd) (cons '3rd 3rd) (cons '4th 4th)))) :exec x)))
Theorem:
(defthm hex-quadp-of-hex-quad-fix (b* ((new-x (hex-quad-fix$inline x))) (hex-quadp new-x)) :rule-classes :rewrite)
Theorem:
(defthm hex-quad-fix-when-hex-quadp (implies (hex-quadp x) (equal (hex-quad-fix x) x)))
Function:
(defun hex-quad-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (hex-quadp acl2::x) (hex-quadp acl2::y)))) (equal (hex-quad-fix acl2::x) (hex-quad-fix acl2::y)))
Theorem:
(defthm hex-quad-equiv-is-an-equivalence (and (booleanp (hex-quad-equiv x y)) (hex-quad-equiv x x) (implies (hex-quad-equiv x y) (hex-quad-equiv y x)) (implies (and (hex-quad-equiv x y) (hex-quad-equiv y z)) (hex-quad-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm hex-quad-equiv-implies-equal-hex-quad-fix-1 (implies (hex-quad-equiv acl2::x x-equiv) (equal (hex-quad-fix acl2::x) (hex-quad-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm hex-quad-fix-under-hex-quad-equiv (hex-quad-equiv (hex-quad-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-hex-quad-fix-1-forward-to-hex-quad-equiv (implies (equal (hex-quad-fix acl2::x) acl2::y) (hex-quad-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-hex-quad-fix-2-forward-to-hex-quad-equiv (implies (equal acl2::x (hex-quad-fix acl2::y)) (hex-quad-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm hex-quad-equiv-of-hex-quad-fix-1-forward (implies (hex-quad-equiv (hex-quad-fix acl2::x) acl2::y) (hex-quad-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm hex-quad-equiv-of-hex-quad-fix-2-forward (implies (hex-quad-equiv acl2::x (hex-quad-fix acl2::y)) (hex-quad-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)