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