Get the bit-length for a particular output simulation variable.
(stv-out->width x stv) → width
For instance, if you have an STV output line like:
("main_result" _ _ _ res1 _ res2 _ _)
Then
If
Function:
(defun stv-out->width (x stv) (declare (xargs :guard (and (symbolp x) (processed-stv-p stv)))) (let ((__function__ 'stv-out->width)) (declare (ignorable __function__)) (b* (((processed-stv stv) stv) ((compiled-stv cstv) stv.compiled-stv) (look (hons-assoc-equal x cstv.out-usersyms)) ((unless look) (raise "Unknown output: ~x0~%" x) 0)) (len (cdr look)))))
Theorem:
(defthm natp-of-stv-out->width (b* ((width (stv-out->width x stv))) (natp width)) :rule-classes :type-prescription)