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