Fixing function for 24bits bit structures.
Function:
(defun 24bits-fix (x) (declare (xargs :guard (24bits-p x))) (let ((__function__ '24bits-fix)) (declare (ignorable __function__)) (mbe :logic (loghead 24 x) :exec x)))
Theorem:
(defthm 24bits-p-of-24bits-fix (b* ((fty::fixed (24bits-fix x))) (24bits-p fty::fixed)) :rule-classes :rewrite)
Theorem:
(defthm 24bits-fix-when-24bits-p (implies (24bits-p x) (equal (24bits-fix x) x)))
Function:
(defun 24bits-equiv$inline (x y) (declare (xargs :guard (and (24bits-p x) (24bits-p y)))) (equal (24bits-fix x) (24bits-fix y)))
Theorem:
(defthm 24bits-equiv-is-an-equivalence (and (booleanp (24bits-equiv x y)) (24bits-equiv x x) (implies (24bits-equiv x y) (24bits-equiv y x)) (implies (and (24bits-equiv x y) (24bits-equiv y z)) (24bits-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm 24bits-equiv-implies-equal-24bits-fix-1 (implies (24bits-equiv x x-equiv) (equal (24bits-fix x) (24bits-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm 24bits-fix-under-24bits-equiv (24bits-equiv (24bits-fix x) x) :rule-classes (:rewrite :rewrite-quoted-constant))