Function:
(defun vl-datatype-slot-width/range (x) (declare (xargs :guard (vl-datatype-p x))) (declare (xargs :guard (vl-datatype-resolved-p x))) (let ((__function__ 'vl-datatype-slot-width/range)) (declare (ignorable __function__)) (b* ((x (vl-maybe-usertype-resolve x)) ((mv err ?caveat slottype dim) (vl-datatype-remove-dim x)) ((when err) (mv err 0 0 0)) ((mv err size) (vl-datatype-size slottype)) ((when err) (mv err 0 0 0)) ((unless size) (mv (vmsg "Couldn't size array slot type ~a0" slottype) 0 0 0)) ((unless (vl-dimension-case dim :range)) (mv (vmsg "unsupported dimension on ~a0" x) 0 0 0)) ((vl-range range) (vl-dimension->range dim)) ((unless (vl-range-resolved-p range)) (mv (vmsg "unresolved dimension on array type ~a0" x) 0 0 0)) (msb (vl-resolved->val range.msb)) (lsb (vl-resolved->val range.lsb))) (mv nil size msb lsb))))
Theorem:
(defthm return-type-of-vl-datatype-slot-width/range.err (b* (((mv ?err ?slotwidth ?range-left ?range-right) (vl-datatype-slot-width/range x))) (iff (vl-msg-p err) err)) :rule-classes :rewrite)
Theorem:
(defthm natp-of-vl-datatype-slot-width/range.slotwidth (b* (((mv ?err ?slotwidth ?range-left ?range-right) (vl-datatype-slot-width/range x))) (natp slotwidth)) :rule-classes :type-prescription)
Theorem:
(defthm integerp-of-vl-datatype-slot-width/range.range-left (b* (((mv ?err ?slotwidth ?range-left ?range-right) (vl-datatype-slot-width/range x))) (integerp range-left)) :rule-classes :type-prescription)
Theorem:
(defthm integerp-of-vl-datatype-slot-width/range.range-right (b* (((mv ?err ?slotwidth ?range-left ?range-right) (vl-datatype-slot-width/range x))) (integerp range-right)) :rule-classes :type-prescription)
Theorem:
(defthm vl-datatype-slot-width/range-of-vl-datatype-fix-x (equal (vl-datatype-slot-width/range (vl-datatype-fix x)) (vl-datatype-slot-width/range x)))
Theorem:
(defthm vl-datatype-slot-width/range-vl-datatype-equiv-congruence-on-x (implies (vl-datatype-equiv x x-equiv) (equal (vl-datatype-slot-width/range x) (vl-datatype-slot-width/range x-equiv))) :rule-classes :congruence)