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