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