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