Fixing function for ienv structures.
Function:
(defun ienv-fix$inline (x) (declare (xargs :guard (ienvp x))) (let ((__function__ 'ienv-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((short-bytes (acl2::pos-fix (cdr (std::da-nth 0 x)))) (int-bytes (acl2::pos-fix (cdr (std::da-nth 1 x)))) (long-bytes (acl2::pos-fix (cdr (std::da-nth 2 x)))) (llong-bytes (acl2::pos-fix (cdr (std::da-nth 3 x)))) (plain-char-signedp (bool-fix (cdr (std::da-nth 4 x))))) (let ((short-bytes (if (and (<= short-bytes int-bytes) (<= int-bytes long-bytes) (<= long-bytes llong-bytes) (<= 2 short-bytes) (<= 4 int-bytes) (<= 8 long-bytes) (<= 8 llong-bytes)) short-bytes 2)) (int-bytes (if (and (<= short-bytes int-bytes) (<= int-bytes long-bytes) (<= long-bytes llong-bytes) (<= 2 short-bytes) (<= 4 int-bytes) (<= 8 long-bytes) (<= 8 llong-bytes)) int-bytes 4)) (long-bytes (if (and (<= short-bytes int-bytes) (<= int-bytes long-bytes) (<= long-bytes llong-bytes) (<= 2 short-bytes) (<= 4 int-bytes) (<= 8 long-bytes) (<= 8 llong-bytes)) long-bytes 8)) (llong-bytes (if (and (<= short-bytes int-bytes) (<= int-bytes long-bytes) (<= long-bytes llong-bytes) (<= 2 short-bytes) (<= 4 int-bytes) (<= 8 long-bytes) (<= 8 llong-bytes)) llong-bytes 8))) (list (cons 'short-bytes short-bytes) (cons 'int-bytes int-bytes) (cons 'long-bytes long-bytes) (cons 'llong-bytes llong-bytes) (cons 'plain-char-signedp plain-char-signedp)))) :exec x)))
Theorem:
(defthm ienvp-of-ienv-fix (b* ((new-x (ienv-fix$inline x))) (ienvp new-x)) :rule-classes :rewrite)
Theorem:
(defthm ienv-fix-when-ienvp (implies (ienvp x) (equal (ienv-fix x) x)))
Function:
(defun ienv-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (ienvp acl2::x) (ienvp acl2::y)))) (equal (ienv-fix acl2::x) (ienv-fix acl2::y)))
Theorem:
(defthm ienv-equiv-is-an-equivalence (and (booleanp (ienv-equiv x y)) (ienv-equiv x x) (implies (ienv-equiv x y) (ienv-equiv y x)) (implies (and (ienv-equiv x y) (ienv-equiv y z)) (ienv-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm ienv-equiv-implies-equal-ienv-fix-1 (implies (ienv-equiv acl2::x x-equiv) (equal (ienv-fix acl2::x) (ienv-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm ienv-fix-under-ienv-equiv (ienv-equiv (ienv-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-ienv-fix-1-forward-to-ienv-equiv (implies (equal (ienv-fix acl2::x) acl2::y) (ienv-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-ienv-fix-2-forward-to-ienv-equiv (implies (equal acl2::x (ienv-fix acl2::y)) (ienv-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm ienv-equiv-of-ienv-fix-1-forward (implies (ienv-equiv (ienv-fix acl2::x) acl2::y) (ienv-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm ienv-equiv-of-ienv-fix-2-forward (implies (ienv-equiv acl2::x (ienv-fix acl2::y)) (ienv-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)