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