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