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