Accessor for values of type
(integer-from-ushort x) → y
Function:
(defun integer-from-ushort (x) (declare (xargs :guard (ushortp x))) (let ((__function__ 'integer-from-ushort)) (declare (ignorable __function__)) (mbe :logic (b* ((x (and t x))) (ushort-integer-fix (std::da-nth 0 (cdr x)))) :exec (std::da-nth 0 (cdr x)))))
Theorem:
(defthm ushort-integerp-of-integer-from-ushort (b* ((y (integer-from-ushort x))) (ushort-integerp y)) :rule-classes :rewrite)
Theorem:
(defthm ushort-from-integer-of-integer-from-ushort (equal (ushort-from-integer (integer-from-ushort x)) (ushort-fix x)))
Theorem:
(defthm integer-from-ushort-of-ushort-from-integer (equal (integer-from-ushort (ushort-from-integer get)) (ushort-integer-fix get)))
Theorem:
(defthm integer-from-ushort-upper-bound (<= (integer-from-ushort x) (ushort-max)) :rule-classes :linear)
Theorem:
(defthm integer-from-ushort-of-ushort-fix-x (equal (integer-from-ushort (ushort-fix x)) (integer-from-ushort x)))
Theorem:
(defthm integer-from-ushort-ushort-equiv-congruence-on-x (implies (ushort-equiv x x-equiv) (equal (integer-from-ushort x) (integer-from-ushort x-equiv))) :rule-classes :congruence)