(vl-datatype-size-warn type x warnings) → (mv warnings size)
Function:
(defun vl-datatype-size-warn (type x warnings) (declare (xargs :guard (and (vl-datatype-p type) (vl-expr-p x) (vl-warninglist-p warnings)))) (declare (xargs :guard (vl-datatype-resolved-p type))) (let ((__function__ 'vl-datatype-size-warn)) (declare (ignorable __function__)) (b* ((type (vl-datatype-fix type)) (x (vl-expr-fix x)) ((mv err size) (vl-datatype-size type)) ((when (or err (not size))) (mv (warn :type :vl-expr-to-svex-fail :msg "Couldn't size datatype ~a0 for expression ~a1: ~@2" :args (list type x (or err "unsizeable"))) nil))) (mv (ok) size))))
Theorem:
(defthm vl-warninglist-p-of-vl-datatype-size-warn.warnings (b* (((mv ?warnings ?size) (vl-datatype-size-warn type x warnings))) (vl-warninglist-p warnings)) :rule-classes :rewrite)
Theorem:
(defthm maybe-natp-of-vl-datatype-size-warn.size (b* (((mv ?warnings ?size) (vl-datatype-size-warn type x warnings))) (maybe-natp size)) :rule-classes :type-prescription)
Theorem:
(defthm vl-datatype-size-warn-of-vl-datatype-fix-type (equal (vl-datatype-size-warn (vl-datatype-fix type) x warnings) (vl-datatype-size-warn type x warnings)))
Theorem:
(defthm vl-datatype-size-warn-vl-datatype-equiv-congruence-on-type (implies (vl-datatype-equiv type type-equiv) (equal (vl-datatype-size-warn type x warnings) (vl-datatype-size-warn type-equiv x warnings))) :rule-classes :congruence)
Theorem:
(defthm vl-datatype-size-warn-of-vl-expr-fix-x (equal (vl-datatype-size-warn type (vl-expr-fix x) warnings) (vl-datatype-size-warn type x warnings)))
Theorem:
(defthm vl-datatype-size-warn-vl-expr-equiv-congruence-on-x (implies (vl-expr-equiv x x-equiv) (equal (vl-datatype-size-warn type x warnings) (vl-datatype-size-warn type x-equiv warnings))) :rule-classes :congruence)
Theorem:
(defthm vl-datatype-size-warn-of-vl-warninglist-fix-warnings (equal (vl-datatype-size-warn type x (vl-warninglist-fix warnings)) (vl-datatype-size-warn type x warnings)))
Theorem:
(defthm vl-datatype-size-warn-vl-warninglist-equiv-congruence-on-warnings (implies (vl-warninglist-equiv warnings warnings-equiv) (equal (vl-datatype-size-warn type x warnings) (vl-datatype-size-warn type x warnings-equiv))) :rule-classes :congruence)