Documentation (sub)string that describes a C integer type.
Function:
(defun integer-type-xdoc-string (type) (declare (xargs :guard (typep type))) (declare (xargs :guard (type-integerp type))) (let ((__function__ 'integer-type-xdoc-string)) (declare (ignorable __function__)) (b* ((core (case (type-kind type) (:char "char") (:schar "signed char") (:uchar "unsigned char") (:sshort "signed short") (:ushort "unsigned short") (:sint "signed int") (:uint "unsigned int") (:slong "signed long") (:ulong "unsigned long") (:sllong "signed long long") (:ullong "unsigned long long") (t (prog2$ (impossible) ""))))) (str::cat "type @('" core "')"))))
Theorem:
(defthm stringp-of-integer-type-xdoc-string (b* ((string (integer-type-xdoc-string type))) (stringp string)) :rule-classes :rewrite)
Theorem:
(defthm integer-type-xdoc-string-of-type-fix-type (equal (integer-type-xdoc-string (type-fix type)) (integer-type-xdoc-string type)))
Theorem:
(defthm integer-type-xdoc-string-type-equiv-congruence-on-type (implies (type-equiv type type-equiv) (equal (integer-type-xdoc-string type) (integer-type-xdoc-string type-equiv))) :rule-classes :congruence)