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