Fixing function for integer-literal structures.
(integer-literal-fix x) → new-x
Function:
(defun integer-literal-fix$inline (x) (declare (xargs :guard (integer-literalp x))) (let ((__function__ 'integer-literal-fix)) (declare (ignorable __function__)) (mbe :logic (case (integer-literal-kind x) (:hex (b* ((get (hex-integer-literal-fix (std::da-nth 0 (cdr x))))) (cons :hex (list get)))) (:dec (b* ((get (dec-integer-literal-fix (std::da-nth 0 (cdr x))))) (cons :dec (list get)))) (:oct (b* ((get (oct-integer-literal-fix (std::da-nth 0 (cdr x))))) (cons :oct (list get)))) (:bin (b* ((get (bin-integer-literal-fix (std::da-nth 0 (cdr x))))) (cons :bin (list get))))) :exec x)))
Theorem:
(defthm integer-literalp-of-integer-literal-fix (b* ((new-x (integer-literal-fix$inline x))) (integer-literalp new-x)) :rule-classes :rewrite)
Theorem:
(defthm integer-literal-fix-when-integer-literalp (implies (integer-literalp x) (equal (integer-literal-fix x) x)))
Function:
(defun integer-literal-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (integer-literalp acl2::x) (integer-literalp acl2::y)))) (equal (integer-literal-fix acl2::x) (integer-literal-fix acl2::y)))
Theorem:
(defthm integer-literal-equiv-is-an-equivalence (and (booleanp (integer-literal-equiv x y)) (integer-literal-equiv x x) (implies (integer-literal-equiv x y) (integer-literal-equiv y x)) (implies (and (integer-literal-equiv x y) (integer-literal-equiv y z)) (integer-literal-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm integer-literal-equiv-implies-equal-integer-literal-fix-1 (implies (integer-literal-equiv acl2::x x-equiv) (equal (integer-literal-fix acl2::x) (integer-literal-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm integer-literal-fix-under-integer-literal-equiv (integer-literal-equiv (integer-literal-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-integer-literal-fix-1-forward-to-integer-literal-equiv (implies (equal (integer-literal-fix acl2::x) acl2::y) (integer-literal-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-integer-literal-fix-2-forward-to-integer-literal-equiv (implies (equal acl2::x (integer-literal-fix acl2::y)) (integer-literal-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm integer-literal-equiv-of-integer-literal-fix-1-forward (implies (integer-literal-equiv (integer-literal-fix acl2::x) acl2::y) (integer-literal-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm integer-literal-equiv-of-integer-literal-fix-2-forward (implies (integer-literal-equiv acl2::x (integer-literal-fix acl2::y)) (integer-literal-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm integer-literal-kind$inline-of-integer-literal-fix-x (equal (integer-literal-kind$inline (integer-literal-fix x)) (integer-literal-kind$inline x)))
Theorem:
(defthm integer-literal-kind$inline-integer-literal-equiv-congruence-on-x (implies (integer-literal-equiv x x-equiv) (equal (integer-literal-kind$inline x) (integer-literal-kind$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm consp-of-integer-literal-fix (consp (integer-literal-fix x)) :rule-classes :type-prescription)