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