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