Fixing function for hex-quad structures.
(hex-quad-fix x) → new-x
Function:
(defun hex-quad-fix$inline (x) (declare (xargs :guard (hex-quad-p x))) (let ((__function__ 'hex-quad-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((1st (str::hex-digit-char-fix (cdr (std::da-nth 0 x)))) (2nd (str::hex-digit-char-fix (cdr (std::da-nth 1 x)))) (3rd (str::hex-digit-char-fix (cdr (std::da-nth 2 x)))) (4th (str::hex-digit-char-fix (cdr (std::da-nth 3 x))))) (list (cons '1st 1st) (cons '2nd 2nd) (cons '3rd 3rd) (cons '4th 4th))) :exec x)))
Theorem:
(defthm hex-quad-p-of-hex-quad-fix (b* ((new-x (hex-quad-fix$inline x))) (hex-quad-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm hex-quad-fix-when-hex-quad-p (implies (hex-quad-p x) (equal (hex-quad-fix x) x)))
Function:
(defun hex-quad-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (hex-quad-p acl2::x) (hex-quad-p 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)