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