Fixing function for signed-format structures.
(signed-format-fix x) → new-x
Function:
(defun signed-format-fix$inline (x) (declare (xargs :guard (signed-formatp x))) (let ((__function__ 'signed-format-fix)) (declare (ignorable __function__)) (mbe :logic (case (signed-format-kind x) (:sign-magnitude (cons :sign-magnitude (list))) (:ones-complement (cons :ones-complement (list))) (:twos-complement (cons :twos-complement (list)))) :exec x)))
Theorem:
(defthm signed-formatp-of-signed-format-fix (b* ((new-x (signed-format-fix$inline x))) (signed-formatp new-x)) :rule-classes :rewrite)
Theorem:
(defthm signed-format-fix-when-signed-formatp (implies (signed-formatp x) (equal (signed-format-fix x) x)))
Function:
(defun signed-format-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (signed-formatp acl2::x) (signed-formatp acl2::y)))) (equal (signed-format-fix acl2::x) (signed-format-fix acl2::y)))
Theorem:
(defthm signed-format-equiv-is-an-equivalence (and (booleanp (signed-format-equiv x y)) (signed-format-equiv x x) (implies (signed-format-equiv x y) (signed-format-equiv y x)) (implies (and (signed-format-equiv x y) (signed-format-equiv y z)) (signed-format-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm signed-format-equiv-implies-equal-signed-format-fix-1 (implies (signed-format-equiv acl2::x x-equiv) (equal (signed-format-fix acl2::x) (signed-format-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm signed-format-fix-under-signed-format-equiv (signed-format-equiv (signed-format-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-signed-format-fix-1-forward-to-signed-format-equiv (implies (equal (signed-format-fix acl2::x) acl2::y) (signed-format-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-signed-format-fix-2-forward-to-signed-format-equiv (implies (equal acl2::x (signed-format-fix acl2::y)) (signed-format-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm signed-format-equiv-of-signed-format-fix-1-forward (implies (signed-format-equiv (signed-format-fix acl2::x) acl2::y) (signed-format-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm signed-format-equiv-of-signed-format-fix-2-forward (implies (signed-format-equiv acl2::x (signed-format-fix acl2::y)) (signed-format-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm signed-format-kind$inline-of-signed-format-fix-x (equal (signed-format-kind$inline (signed-format-fix x)) (signed-format-kind$inline x)))
Theorem:
(defthm signed-format-kind$inline-signed-format-equiv-congruence-on-x (implies (signed-format-equiv x x-equiv) (equal (signed-format-kind$inline x) (signed-format-kind$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm consp-of-signed-format-fix (consp (signed-format-fix x)) :rule-classes :type-prescription)