Minimum mathematical integer value of an integer type.
For now we exclude the plain
Function:
(defun integer-type-min (type) (declare (xargs :guard (typep type))) (declare (xargs :guard (type-nonchar-integerp type))) (let ((__function__ 'integer-type-min)) (declare (ignorable __function__)) (cond ((type-case type :schar) (schar-min)) ((type-case type :uchar) 0) ((type-case type :sshort) (sshort-min)) ((type-case type :ushort) 0) ((type-case type :sint) (sint-min)) ((type-case type :uint) 0) ((type-case type :slong) (slong-min)) ((type-case type :ulong) 0) ((type-case type :sllong) (sllong-min)) ((type-case type :ullong) 0) (t (prog2$ (impossible) 0)))))
Theorem:
(defthm integerp-of-integer-type-min (b* ((min (integer-type-min type))) (integerp min)) :rule-classes :rewrite)
Theorem:
(defthm integer-type-min-of-type-fix-type (equal (integer-type-min (type-fix type)) (integer-type-min type)))
Theorem:
(defthm integer-type-min-type-equiv-congruence-on-type (implies (type-equiv type type-equiv) (equal (integer-type-min type) (integer-type-min type-equiv))) :rule-classes :congruence)