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