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