(vl-value-to-4vec x) → (mv err val)
Function:
(defun vl-value-to-4vec (x) (declare (xargs :guard (vl-value-p x))) (let ((__function__ 'vl-value-to-4vec)) (declare (ignorable __function__)) (vl-value-case x :vl-constint (mv nil (4vec-extend x.origsign x.origwidth (sv::2vec x.value))) :vl-weirdint (mv nil (4vec-extend x.origsign (len x.bits) (vl-bitlist->4vec (vl-weirdint->bits x)))) :vl-extint (mv nil (case x.value (:vl-1val (sv::2vec -1)) (:vl-0val (sv::2vec 0)) (:vl-xval (sv::4vec-x)) (:vl-zval (sv::4vec-z)))) :vl-string (mv nil (sv::2vec (vl-string->bits x.value (length x.value)))) :otherwise (mv (vmsg "Unsupported value type: ~a0" (make-vl-literal :val x)) (sv::4vec-x)))))
Theorem:
(defthm return-type-of-vl-value-to-4vec.err (b* (((mv ?err ?val) (vl-value-to-4vec x))) (iff (vl-msg-p err) err)) :rule-classes :rewrite)
Theorem:
(defthm 4vec-p-of-vl-value-to-4vec.val (b* (((mv ?err ?val) (vl-value-to-4vec x))) (sv::4vec-p val)) :rule-classes :rewrite)
Theorem:
(defthm vl-value-to-4vec-of-vl-value-fix-x (equal (vl-value-to-4vec (vl-value-fix x)) (vl-value-to-4vec x)))
Theorem:
(defthm vl-value-to-4vec-vl-value-equiv-congruence-on-x (implies (vl-value-equiv x x-equiv) (equal (vl-value-to-4vec x) (vl-value-to-4vec x-equiv))) :rule-classes :congruence)