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