Fixing function for cinteger structures.
Function:
(defun cinteger-fix$inline (acl2::x) (declare (xargs :guard (cintegerp acl2::x))) (let ((__function__ 'cinteger-fix)) (declare (ignorable __function__)) (mbe :logic (case (cinteger-kind acl2::x) (:schar (b* ((get (schar-fix acl2::x))) get)) (:uchar (b* ((get (uchar-fix acl2::x))) get)) (:sshort (b* ((get (sshort-fix acl2::x))) get)) (:ushort (b* ((get (ushort-fix acl2::x))) get)) (:sint (b* ((get (sint-fix acl2::x))) get)) (:uint (b* ((get (uint-fix acl2::x))) get)) (:slong (b* ((get (slong-fix acl2::x))) get)) (:ulong (b* ((get (ulong-fix acl2::x))) get)) (:sllong (b* ((get (sllong-fix acl2::x))) get)) (:ullong (b* ((get (ullong-fix acl2::x))) get))) :exec acl2::x)))
Theorem:
(defthm cintegerp-of-cinteger-fix (b* ((new-x (cinteger-fix$inline acl2::x))) (cintegerp new-x)) :rule-classes :rewrite)
Theorem:
(defthm cinteger-fix-when-cintegerp (implies (cintegerp acl2::x) (equal (cinteger-fix acl2::x) acl2::x)))
Function:
(defun cinteger-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (cintegerp acl2::x) (cintegerp acl2::y)))) (equal (cinteger-fix acl2::x) (cinteger-fix acl2::y)))
Theorem:
(defthm cinteger-equiv-is-an-equivalence (and (booleanp (cinteger-equiv x y)) (cinteger-equiv x x) (implies (cinteger-equiv x y) (cinteger-equiv y x)) (implies (and (cinteger-equiv x y) (cinteger-equiv y z)) (cinteger-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm cinteger-equiv-implies-equal-cinteger-fix-1 (implies (cinteger-equiv acl2::x x-equiv) (equal (cinteger-fix acl2::x) (cinteger-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm cinteger-fix-under-cinteger-equiv (cinteger-equiv (cinteger-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-cinteger-fix-1-forward-to-cinteger-equiv (implies (equal (cinteger-fix acl2::x) acl2::y) (cinteger-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-cinteger-fix-2-forward-to-cinteger-equiv (implies (equal acl2::x (cinteger-fix acl2::y)) (cinteger-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm cinteger-equiv-of-cinteger-fix-1-forward (implies (cinteger-equiv (cinteger-fix acl2::x) acl2::y) (cinteger-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm cinteger-equiv-of-cinteger-fix-2-forward (implies (cinteger-equiv acl2::x (cinteger-fix acl2::y)) (cinteger-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm cinteger-kind$inline-of-cinteger-fix-x (equal (cinteger-kind$inline (cinteger-fix acl2::x)) (cinteger-kind$inline acl2::x)))
Theorem:
(defthm cinteger-kind$inline-cinteger-equiv-congruence-on-x (implies (cinteger-equiv acl2::x x-equiv) (equal (cinteger-kind$inline acl2::x) (cinteger-kind$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm consp-of-cinteger-fix (consp (cinteger-fix acl2::x)) :rule-classes :type-prescription)