Fixing function for iconst structures.
Function:
(defun iconst-fix$inline (x) (declare (xargs :guard (iconstp x))) (let ((__function__ 'iconst-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((value (nfix (cdr (std::da-nth 0 (cdr x))))) (base (iconst-base-fix (cdr (std::da-nth 1 (cdr x))))) (unsignedp (acl2::bool-fix (cdr (std::da-nth 2 (cdr x))))) (length (iconst-length-fix (cdr (std::da-nth 3 (cdr x)))))) (cons :iconst (list (cons 'value value) (cons 'base base) (cons 'unsignedp unsignedp) (cons 'length length)))) :exec x)))
Theorem:
(defthm iconstp-of-iconst-fix (b* ((new-x (iconst-fix$inline x))) (iconstp new-x)) :rule-classes :rewrite)
Theorem:
(defthm iconst-fix-when-iconstp (implies (iconstp x) (equal (iconst-fix x) x)))
Function:
(defun iconst-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (iconstp acl2::x) (iconstp acl2::y)))) (equal (iconst-fix acl2::x) (iconst-fix acl2::y)))
Theorem:
(defthm iconst-equiv-is-an-equivalence (and (booleanp (iconst-equiv x y)) (iconst-equiv x x) (implies (iconst-equiv x y) (iconst-equiv y x)) (implies (and (iconst-equiv x y) (iconst-equiv y z)) (iconst-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm iconst-equiv-implies-equal-iconst-fix-1 (implies (iconst-equiv acl2::x x-equiv) (equal (iconst-fix acl2::x) (iconst-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm iconst-fix-under-iconst-equiv (iconst-equiv (iconst-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-iconst-fix-1-forward-to-iconst-equiv (implies (equal (iconst-fix acl2::x) acl2::y) (iconst-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-iconst-fix-2-forward-to-iconst-equiv (implies (equal acl2::x (iconst-fix acl2::y)) (iconst-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm iconst-equiv-of-iconst-fix-1-forward (implies (iconst-equiv (iconst-fix acl2::x) acl2::y) (iconst-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm iconst-equiv-of-iconst-fix-2-forward (implies (iconst-equiv acl2::x (iconst-fix acl2::y)) (iconst-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)