Fixing function for hex-integer-literal structures.
(hex-integer-literal-fix x) → new-x
Function:
(defun hex-integer-literal-fix$inline (x) (declare (xargs :guard (hex-integer-literalp x))) (let ((__function__ 'hex-integer-literal-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((digits/uscores (hexdig/uscore-list-fix (std::da-nth 0 (cdr x)))) (prefix-upcase-p (acl2::bool-fix (std::da-nth 1 (cdr x)))) (suffix? (optional-integer-type-suffix-fix (std::da-nth 2 (cdr x))))) (let ((digits/uscores (if (hexdig/uscore-list-wfp digits/uscores) digits/uscores (list (hexdig/uscore-digit (char-code #\0)))))) (cons :hex-integer-lit (list digits/uscores prefix-upcase-p suffix?)))) :exec x)))
Theorem:
(defthm hex-integer-literalp-of-hex-integer-literal-fix (b* ((new-x (hex-integer-literal-fix$inline x))) (hex-integer-literalp new-x)) :rule-classes :rewrite)
Theorem:
(defthm hex-integer-literal-fix-when-hex-integer-literalp (implies (hex-integer-literalp x) (equal (hex-integer-literal-fix x) x)))
Function:
(defun hex-integer-literal-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (hex-integer-literalp acl2::x) (hex-integer-literalp acl2::y)))) (equal (hex-integer-literal-fix acl2::x) (hex-integer-literal-fix acl2::y)))
Theorem:
(defthm hex-integer-literal-equiv-is-an-equivalence (and (booleanp (hex-integer-literal-equiv x y)) (hex-integer-literal-equiv x x) (implies (hex-integer-literal-equiv x y) (hex-integer-literal-equiv y x)) (implies (and (hex-integer-literal-equiv x y) (hex-integer-literal-equiv y z)) (hex-integer-literal-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm hex-integer-literal-equiv-implies-equal-hex-integer-literal-fix-1 (implies (hex-integer-literal-equiv acl2::x x-equiv) (equal (hex-integer-literal-fix acl2::x) (hex-integer-literal-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm hex-integer-literal-fix-under-hex-integer-literal-equiv (hex-integer-literal-equiv (hex-integer-literal-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-hex-integer-literal-fix-1-forward-to-hex-integer-literal-equiv (implies (equal (hex-integer-literal-fix acl2::x) acl2::y) (hex-integer-literal-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-hex-integer-literal-fix-2-forward-to-hex-integer-literal-equiv (implies (equal acl2::x (hex-integer-literal-fix acl2::y)) (hex-integer-literal-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm hex-integer-literal-equiv-of-hex-integer-literal-fix-1-forward (implies (hex-integer-literal-equiv (hex-integer-literal-fix acl2::x) acl2::y) (hex-integer-literal-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm hex-integer-literal-equiv-of-hex-integer-literal-fix-2-forward (implies (hex-integer-literal-equiv acl2::x (hex-integer-literal-fix acl2::y)) (hex-integer-literal-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)