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