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