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