An 24-bit unsigned bitstruct type.
This is a bitstruct type introduced by defbitstruct, represented as a unsigned 24-bit integer.
This is an atomic/empty structure; it has no fields.
Function:
(defun 24bits-p (x) (declare (xargs :guard t)) (let ((__function__ '24bits-p)) (declare (ignorable __function__)) (mbe :logic (unsigned-byte-p 24 x) :exec (and (natp x) (< x 16777216)))))
Theorem:
(defthm 24bits-p-when-unsigned-byte-p (implies (unsigned-byte-p 24 x) (24bits-p x)))
Theorem:
(defthm unsigned-byte-p-when-24bits-p (implies (24bits-p x) (unsigned-byte-p 24 x)))
Theorem:
(defthm 24bits-p-compound-recognizer (implies (24bits-p x) (natp x)) :rule-classes :compound-recognizer)
Function:
(defun 24bits-fix (x) (declare (xargs :guard (24bits-p x))) (let ((__function__ '24bits-fix)) (declare (ignorable __function__)) (mbe :logic (loghead 24 x) :exec x)))
Theorem:
(defthm 24bits-p-of-24bits-fix (b* ((fty::fixed (24bits-fix x))) (24bits-p fty::fixed)) :rule-classes :rewrite)
Theorem:
(defthm 24bits-fix-when-24bits-p (implies (24bits-p x) (equal (24bits-fix x) x)))
Function:
(defun 24bits-equiv$inline (x y) (declare (xargs :guard (and (24bits-p x) (24bits-p y)))) (equal (24bits-fix x) (24bits-fix y)))
Theorem:
(defthm 24bits-equiv-is-an-equivalence (and (booleanp (24bits-equiv x y)) (24bits-equiv x x) (implies (24bits-equiv x y) (24bits-equiv y x)) (implies (and (24bits-equiv x y) (24bits-equiv y z)) (24bits-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm 24bits-equiv-implies-equal-24bits-fix-1 (implies (24bits-equiv x x-equiv) (equal (24bits-fix x) (24bits-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm 24bits-fix-under-24bits-equiv (24bits-equiv (24bits-fix x) x) :rule-classes (:rewrite :rewrite-quoted-constant))