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