We factor this out of vl-datatype-arithclass so we can reuse it in places like vl-syscall-typedecide.
(vl-coretype-arithclass typinfo signedp) → class
Function:
(defun vl-coretype-arithclass (typinfo signedp) (declare (xargs :guard (and (vl-coredatatype-info-p typinfo) (booleanp signedp)))) (let ((__function__ 'vl-coretype-arithclass)) (declare (ignorable __function__)) (b* (((vl-coredatatype-info typinfo))) (cond (typinfo.takes-signingp (if signedp :vl-signed-int-class :vl-unsigned-int-class)) ((or (vl-coretypename-equiv typinfo.coretypename :vl-real) (vl-coretypename-equiv typinfo.coretypename :vl-realtime)) :vl-real-class) ((vl-coretypename-equiv typinfo.coretypename :vl-shortreal) :vl-shortreal-class) (t :vl-other-class)))))
Theorem:
(defthm vl-arithclass-p-of-vl-coretype-arithclass (b* ((class (vl-coretype-arithclass typinfo signedp))) (vl-arithclass-p class)) :rule-classes :rewrite)
Theorem:
(defthm vl-coretype-arithclass-of-vl-coredatatype-info-fix-typinfo (equal (vl-coretype-arithclass (vl-coredatatype-info-fix typinfo) signedp) (vl-coretype-arithclass typinfo signedp)))
Theorem:
(defthm vl-coretype-arithclass-vl-coredatatype-info-equiv-congruence-on-typinfo (implies (vl-coredatatype-info-equiv typinfo typinfo-equiv) (equal (vl-coretype-arithclass typinfo signedp) (vl-coretype-arithclass typinfo-equiv signedp))) :rule-classes :congruence)
Theorem:
(defthm vl-coretype-arithclass-of-bool-fix-signedp (equal (vl-coretype-arithclass typinfo (acl2::bool-fix signedp)) (vl-coretype-arithclass typinfo signedp)))
Theorem:
(defthm vl-coretype-arithclass-iff-congruence-on-signedp (implies (iff signedp signedp-equiv) (equal (vl-coretype-arithclass typinfo signedp) (vl-coretype-arithclass typinfo signedp-equiv))) :rule-classes :congruence)