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