Checks whether an expression is of a bitselectable type.
(vl-expr-is-bitselect-type x ss) → (mv warning bitselectp)
Should only be called on an appropriate operand for an indexing/partselect operation, that is, some number of indexing operators applied to a HID/identifier. Otherwise, we generate a warning and fail.
Function:
(defun vl-expr-is-bitselect-type (x ss) (declare (xargs :guard (and (vl-expr-p x) (vl-scopestack-p ss)))) (let ((__function__ 'vl-expr-is-bitselect-type)) (declare (ignorable __function__)) (b* (((mv warning type) (vl-index-find-type x ss (vl-expr-fix x))) ((when warning) (mv warning nil))) (mv nil (vl-datatype-bitselect-p type)))))
Theorem:
(defthm return-type-of-vl-expr-is-bitselect-type.warning (b* (((mv common-lisp::?warning ?bitselectp) (vl-expr-is-bitselect-type x ss))) (iff (vl-warning-p warning) warning)) :rule-classes :rewrite)
Theorem:
(defthm vl-expr-is-bitselect-type-of-vl-expr-fix-x (equal (vl-expr-is-bitselect-type (vl-expr-fix x) ss) (vl-expr-is-bitselect-type x ss)))
Theorem:
(defthm vl-expr-is-bitselect-type-vl-expr-equiv-congruence-on-x (implies (vl-expr-equiv x x-equiv) (equal (vl-expr-is-bitselect-type x ss) (vl-expr-is-bitselect-type x-equiv ss))) :rule-classes :congruence)
Theorem:
(defthm vl-expr-is-bitselect-type-of-vl-scopestack-fix-ss (equal (vl-expr-is-bitselect-type x (vl-scopestack-fix ss)) (vl-expr-is-bitselect-type x ss)))
Theorem:
(defthm vl-expr-is-bitselect-type-vl-scopestack-equiv-congruence-on-ss (implies (vl-scopestack-equiv ss ss-equiv) (equal (vl-expr-is-bitselect-type x ss) (vl-expr-is-bitselect-type x ss-equiv))) :rule-classes :congruence)