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