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