Fixing function for cutinfo bit structures.
Function:
(defun cutinfo-fix (x) (declare (xargs :guard (cutinfo-p x))) (let ((__function__ 'cutinfo-fix)) (declare (ignorable __function__)) (mbe :logic (loghead 32 (logapp 16 (part-select x :width 16 :low 0) (logapp 3 (cutsize-fix (part-select x :width 3 :low 16)) (logapp 1 (part-select x :width 1 :low 19) (part-select x :width 12 :low 20))))) :exec x)))
Theorem:
(defthm cutinfo-p-of-cutinfo-fix (b* ((fty::fixed (cutinfo-fix x))) (cutinfo-p fty::fixed)) :rule-classes :rewrite)
Theorem:
(defthm cutinfo-fix-when-cutinfo-p (implies (cutinfo-p x) (equal (cutinfo-fix x) x)))
Function:
(defun cutinfo-equiv$inline (x acl2::y) (declare (xargs :guard (and (cutinfo-p x) (cutinfo-p acl2::y)))) (equal (cutinfo-fix x) (cutinfo-fix acl2::y)))
Theorem:
(defthm cutinfo-equiv-is-an-equivalence (and (booleanp (cutinfo-equiv x y)) (cutinfo-equiv x x) (implies (cutinfo-equiv x y) (cutinfo-equiv y x)) (implies (and (cutinfo-equiv x y) (cutinfo-equiv y z)) (cutinfo-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm cutinfo-equiv-implies-equal-cutinfo-fix-1 (implies (cutinfo-equiv x x-equiv) (equal (cutinfo-fix x) (cutinfo-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm cutinfo-fix-under-cutinfo-equiv (cutinfo-equiv (cutinfo-fix x) x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm cutinfo-fix-of-cutinfo-fix-x (equal (cutinfo-fix (cutinfo-fix x)) (cutinfo-fix x)))
Theorem:
(defthm cutinfo-fix-cutinfo-equiv-congruence-on-x (implies (cutinfo-equiv x x-equiv) (equal (cutinfo-fix x) (cutinfo-fix x-equiv))) :rule-classes :congruence)