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