Fixing function for dec/oct/hex-const structures.
(dec/oct/hex-const-fix x) → new-x
Function:
(defun dec/oct/hex-const-fix$inline (x) (declare (xargs :guard (dec/oct/hex-constp x))) (let ((__function__ 'dec/oct/hex-const-fix)) (declare (ignorable __function__)) (mbe :logic (case (dec/oct/hex-const-kind x) (:dec (b* ((value (acl2::pos-fix (std::da-nth 0 (cdr x))))) (cons :dec (list value)))) (:oct (b* ((leading-zeros (acl2::pos-fix (std::da-nth 0 (cdr x)))) (value (nfix (std::da-nth 1 (cdr x))))) (cons :oct (list leading-zeros value)))) (:hex (b* ((prefix (hprefix-fix (std::da-nth 0 (cdr x)))) (digits (str::hex-digit-char-list-fix (std::da-nth 1 (cdr x))))) (cons :hex (list prefix digits))))) :exec x)))
Theorem:
(defthm dec/oct/hex-constp-of-dec/oct/hex-const-fix (b* ((new-x (dec/oct/hex-const-fix$inline x))) (dec/oct/hex-constp new-x)) :rule-classes :rewrite)
Theorem:
(defthm dec/oct/hex-const-fix-when-dec/oct/hex-constp (implies (dec/oct/hex-constp x) (equal (dec/oct/hex-const-fix x) x)))
Function:
(defun dec/oct/hex-const-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (dec/oct/hex-constp acl2::x) (dec/oct/hex-constp acl2::y)))) (equal (dec/oct/hex-const-fix acl2::x) (dec/oct/hex-const-fix acl2::y)))
Theorem:
(defthm dec/oct/hex-const-equiv-is-an-equivalence (and (booleanp (dec/oct/hex-const-equiv x y)) (dec/oct/hex-const-equiv x x) (implies (dec/oct/hex-const-equiv x y) (dec/oct/hex-const-equiv y x)) (implies (and (dec/oct/hex-const-equiv x y) (dec/oct/hex-const-equiv y z)) (dec/oct/hex-const-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm dec/oct/hex-const-equiv-implies-equal-dec/oct/hex-const-fix-1 (implies (dec/oct/hex-const-equiv acl2::x x-equiv) (equal (dec/oct/hex-const-fix acl2::x) (dec/oct/hex-const-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm dec/oct/hex-const-fix-under-dec/oct/hex-const-equiv (dec/oct/hex-const-equiv (dec/oct/hex-const-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-dec/oct/hex-const-fix-1-forward-to-dec/oct/hex-const-equiv (implies (equal (dec/oct/hex-const-fix acl2::x) acl2::y) (dec/oct/hex-const-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-dec/oct/hex-const-fix-2-forward-to-dec/oct/hex-const-equiv (implies (equal acl2::x (dec/oct/hex-const-fix acl2::y)) (dec/oct/hex-const-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm dec/oct/hex-const-equiv-of-dec/oct/hex-const-fix-1-forward (implies (dec/oct/hex-const-equiv (dec/oct/hex-const-fix acl2::x) acl2::y) (dec/oct/hex-const-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm dec/oct/hex-const-equiv-of-dec/oct/hex-const-fix-2-forward (implies (dec/oct/hex-const-equiv acl2::x (dec/oct/hex-const-fix acl2::y)) (dec/oct/hex-const-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm dec/oct/hex-const-kind$inline-of-dec/oct/hex-const-fix-x (equal (dec/oct/hex-const-kind$inline (dec/oct/hex-const-fix x)) (dec/oct/hex-const-kind$inline x)))
Theorem:
(defthm dec/oct/hex-const-kind$inline-dec/oct/hex-const-equiv-congruence-on-x (implies (dec/oct/hex-const-equiv x x-equiv) (equal (dec/oct/hex-const-kind$inline x) (dec/oct/hex-const-kind$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm consp-of-dec/oct/hex-const-fix (consp (dec/oct/hex-const-fix x)) :rule-classes :type-prescription)