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