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