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