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