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