Given an input name and an SVTV, get the width of the part that is used.
Function:
(defun svtv->in-width (name svtv) (declare (xargs :guard (svtv-p svtv))) (let ((__function__ 'svtv->in-width)) (declare (ignorable __function__)) (b* ((look (hons-assoc-equal name (svtv->inmasks svtv))) ((unless look) (raise "Unknown input: ~x0~%" name) 0)) (integer-length (nfix (cdr look))))))
Theorem:
(defthm natp-of-svtv->in-width (b* ((width (svtv->in-width name svtv))) (natp width)) :rule-classes :type-prescription)
Theorem:
(defthm svtv->in-width-of-svtv-fix-svtv (equal (svtv->in-width name (svtv-fix svtv)) (svtv->in-width name svtv)))
Theorem:
(defthm svtv->in-width-svtv-equiv-congruence-on-svtv (implies (svtv-equiv svtv svtv-equiv) (equal (svtv->in-width name svtv) (svtv->in-width name svtv-equiv))) :rule-classes :congruence)