Function:
(defun lhs-width (x) (declare (xargs :guard (lhs-p x))) (let ((__function__ 'lhs-width)) (declare (ignorable __function__)) (if (atom x) 0 (+ (lhrange->w (car x)) (lhs-width (cdr x))))))
Theorem:
(defthm natp-of-lhs-width (b* ((w (lhs-width x))) (natp w)) :rule-classes :type-prescription)
Theorem:
(defthm lhs-width-of-lhs-fix-x (equal (lhs-width (lhs-fix x)) (lhs-width x)))
Theorem:
(defthm lhs-width-lhs-equiv-congruence-on-x (implies (lhs-equiv x x-equiv) (equal (lhs-width x) (lhs-width x-equiv))) :rule-classes :congruence)
Theorem:
(defthm lhs-width-bounds-eval-width (equal (4vec-concat (2vec (lhs-width x)) (lhs-eval x env) (4vec-z)) (lhs-eval x env)))