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