Measure for recurring over vl-scopestack structures.
(vl-scopestack-count x) → count
Function:
(defun vl-scopestack-count (x) (declare (xargs :guard (vl-scopestack-p x))) (let ((__function__ 'vl-scopestack-count)) (declare (ignorable __function__)) (common-lisp::case (vl-scopestack-kind x) (:null 1) (:global 1) (:local (+ 3 (vl-scopestack-count (vl-scopestack-local->super x)))))))
Theorem:
(defthm natp-of-vl-scopestack-count (b* ((count (vl-scopestack-count x))) (natp count)) :rule-classes :type-prescription)
Theorem:
(defthm vl-scopestack-count-of-vl-scopestack-fix-x (equal (vl-scopestack-count (vl-scopestack-fix x)) (vl-scopestack-count x)))
Theorem:
(defthm vl-scopestack-count-vl-scopestack-equiv-congruence-on-x (implies (vl-scopestack-equiv x x-equiv) (equal (vl-scopestack-count x) (vl-scopestack-count x-equiv))) :rule-classes :congruence)
Theorem:
(defthm vl-scopestack-count-of-vl-scopestack-local (implies t (< (+ (vl-scopestack-count super)) (vl-scopestack-count (vl-scopestack-local top super)))) :rule-classes :linear)
Theorem:
(defthm vl-scopestack-count-of-vl-scopestack-local->super (implies (equal (vl-scopestack-kind x) :local) (< (vl-scopestack-count (vl-scopestack-local->super x)) (vl-scopestack-count x))) :rule-classes :linear)