(vl-datatype-index-shift-amount x idx) → (mv err shift)
Function:
(defun vl-datatype-index-shift-amount (x idx) (declare (xargs :guard (and (vl-datatype-p x) (sv::svex-p idx)))) (declare (xargs :guard (vl-datatype-resolved-p x))) (let ((__function__ 'vl-datatype-index-shift-amount)) (declare (ignorable __function__)) (b* (((mv err size msb lsb) (vl-datatype-slot-width/range x)) ((when err) (mv err nil))) (mv nil (vl-index-shift-amount size msb lsb idx)))))
Theorem:
(defthm return-type-of-vl-datatype-index-shift-amount.err (b* (((mv ?err ?shift) (vl-datatype-index-shift-amount x idx))) (iff (vl-msg-p err) err)) :rule-classes :rewrite)
Theorem:
(defthm return-type-of-vl-datatype-index-shift-amount.shift (b* (((mv ?err ?shift) (vl-datatype-index-shift-amount x idx))) (implies (not err) (sv::svex-p shift))) :rule-classes :rewrite)
Theorem:
(defthm vars-of-vl-datatype-index-shift-amount (b* (((mv ?err ?shift) (vl-datatype-index-shift-amount x idx))) (implies (and (not err) (not (member v (sv::svex-vars idx)))) (not (member v (sv::svex-vars shift))))))
Theorem:
(defthm vl-datatype-index-shift-amount-of-vl-datatype-fix-x (equal (vl-datatype-index-shift-amount (vl-datatype-fix x) idx) (vl-datatype-index-shift-amount x idx)))
Theorem:
(defthm vl-datatype-index-shift-amount-vl-datatype-equiv-congruence-on-x (implies (vl-datatype-equiv x x-equiv) (equal (vl-datatype-index-shift-amount x idx) (vl-datatype-index-shift-amount x-equiv idx))) :rule-classes :congruence)
Theorem:
(defthm vl-datatype-index-shift-amount-of-svex-fix-idx (equal (vl-datatype-index-shift-amount x (sv::svex-fix idx)) (vl-datatype-index-shift-amount x idx)))
Theorem:
(defthm vl-datatype-index-shift-amount-svex-equiv-congruence-on-idx (implies (sv::svex-equiv idx idx-equiv) (equal (vl-datatype-index-shift-amount x idx) (vl-datatype-index-shift-amount x idx-equiv))) :rule-classes :congruence)