Check if an arithmetic type is a promoted one.
That is, check if it is a possible result of type-integer-promote.
This holds for all types except
the integer ones with rank below
Function:
(defun type-integer-promotedp (type) (declare (xargs :guard (typep type))) (declare (xargs :guard (type-arithmeticp type))) (not (member-eq (type-kind type) '(:bool :char :schar :uchar :sshort :ushort :enum))))
Theorem:
(defthm booleanp-of-type-integer-promotedp (b* ((yes/no (type-integer-promotedp type))) (booleanp yes/no)) :rule-classes :rewrite)
Theorem:
(defthm type-integer-promotedp-when-type-kind-syntaxp (implies (and (equal (type-kind type) kind) (syntaxp (quotep kind))) (equal (type-integer-promotedp type) (not (member-equal kind '(:bool :char :schar :uchar :sshort :ushort :enum))))))
Theorem:
(defthm type-integer-promotedp-of-type-fix-type (equal (type-integer-promotedp (type-fix type)) (type-integer-promotedp type)))
Theorem:
(defthm type-integer-promotedp-type-equiv-congruence-on-type (implies (type-equiv type type-equiv) (equal (type-integer-promotedp type) (type-integer-promotedp type-equiv))) :rule-classes :congruence)