Fixing function for uinteger+sinteger-format structures.
(uinteger+sinteger-format-fix x) → new-x
Function:
(defun uinteger+sinteger-format-fix$inline (x) (declare (xargs :guard (uinteger+sinteger-formatp x))) (let ((__function__ 'uinteger+sinteger-format-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((unsigned (uinteger-format-fix (cdr (std::da-nth 0 x)))) (signed (sinteger-format-fix (cdr (std::da-nth 1 x))))) (list (cons 'unsigned unsigned) (cons 'signed signed))) :exec x)))
Theorem:
(defthm uinteger+sinteger-formatp-of-uinteger+sinteger-format-fix (b* ((new-x (uinteger+sinteger-format-fix$inline x))) (uinteger+sinteger-formatp new-x)) :rule-classes :rewrite)
Theorem:
(defthm uinteger+sinteger-format-fix-when-uinteger+sinteger-formatp (implies (uinteger+sinteger-formatp x) (equal (uinteger+sinteger-format-fix x) x)))
Function:
(defun uinteger+sinteger-format-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (uinteger+sinteger-formatp acl2::x) (uinteger+sinteger-formatp acl2::y)))) (equal (uinteger+sinteger-format-fix acl2::x) (uinteger+sinteger-format-fix acl2::y)))
Theorem:
(defthm uinteger+sinteger-format-equiv-is-an-equivalence (and (booleanp (uinteger+sinteger-format-equiv x y)) (uinteger+sinteger-format-equiv x x) (implies (uinteger+sinteger-format-equiv x y) (uinteger+sinteger-format-equiv y x)) (implies (and (uinteger+sinteger-format-equiv x y) (uinteger+sinteger-format-equiv y z)) (uinteger+sinteger-format-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm uinteger+sinteger-format-equiv-implies-equal-uinteger+sinteger-format-fix-1 (implies (uinteger+sinteger-format-equiv acl2::x x-equiv) (equal (uinteger+sinteger-format-fix acl2::x) (uinteger+sinteger-format-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm uinteger+sinteger-format-fix-under-uinteger+sinteger-format-equiv (uinteger+sinteger-format-equiv (uinteger+sinteger-format-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-uinteger+sinteger-format-fix-1-forward-to-uinteger+sinteger-format-equiv (implies (equal (uinteger+sinteger-format-fix acl2::x) acl2::y) (uinteger+sinteger-format-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-uinteger+sinteger-format-fix-2-forward-to-uinteger+sinteger-format-equiv (implies (equal acl2::x (uinteger+sinteger-format-fix acl2::y)) (uinteger+sinteger-format-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm uinteger+sinteger-format-equiv-of-uinteger+sinteger-format-fix-1-forward (implies (uinteger+sinteger-format-equiv (uinteger+sinteger-format-fix acl2::x) acl2::y) (uinteger+sinteger-format-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm uinteger+sinteger-format-equiv-of-uinteger+sinteger-format-fix-2-forward (implies (uinteger+sinteger-format-equiv acl2::x (uinteger+sinteger-format-fix acl2::y)) (uinteger+sinteger-format-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)