Determines whether this datatype can be selected.
(vl-datatype-select-ok x) → ok
The input datatype should not have packed or unpacked dimensions; if it does, then it's definitely OK to index into it (though it's only a select if it's the last packed dimension). The input datatype should have usertypes resolved.
Function:
(defun vl-datatype-select-ok (x) (declare (xargs :guard (vl-datatype-p x))) (declare (xargs :guard (vl-datatype-resolved-p x))) (let ((__function__ 'vl-datatype-select-ok)) (declare (ignorable __function__)) (b* ((x (vl-maybe-usertype-resolve x))) (or (consp (vl-datatype->pdims x)) (consp (vl-datatype->udims x)) (vl-datatype-case x (:vl-coretype (b* (((vl-coredatatype-info xinfo) (vl-coretypename->info x.name))) (and xinfo.size (not (eql xinfo.size 1))))) (:vl-struct x.packedp) (:vl-union x.packedp) (:vl-enum t) (:vl-usertype (impossible)))))))
Theorem:
(defthm vl-datatype-select-ok-of-vl-datatype-fix-x (equal (vl-datatype-select-ok (vl-datatype-fix x)) (vl-datatype-select-ok x)))
Theorem:
(defthm vl-datatype-select-ok-vl-datatype-equiv-congruence-on-x (implies (vl-datatype-equiv x x-equiv) (equal (vl-datatype-select-ok x) (vl-datatype-select-ok x-equiv))) :rule-classes :congruence)