Measure for recurring over modscope structures.
(modscope-count x) → count
Function:
(defun modscope-count (x) (declare (xargs :guard (modscope-p x))) (let ((__function__ 'modscope-count)) (declare (ignorable __function__)) (case (modscope-kind x) (:top 1) (:nested (+ 5 (modscope-count (modscope-nested->upper x)))))))
Theorem:
(defthm natp-of-modscope-count (b* ((count (modscope-count x))) (natp count)) :rule-classes :type-prescription)
Theorem:
(defthm modscope-count-of-modscope-fix-x (equal (modscope-count (modscope-fix x)) (modscope-count x)))
Theorem:
(defthm modscope-count-modscope-equiv-congruence-on-x (implies (modscope-equiv x x-equiv) (equal (modscope-count x) (modscope-count x-equiv))) :rule-classes :congruence)
Theorem:
(defthm modscope-count-of-modscope-nested (implies t (< (+ (modscope-count upper)) (modscope-count (modscope-nested modidx wireoffset instoffset upper)))) :rule-classes :linear)
Theorem:
(defthm modscope-count-of-modscope-nested->upper (implies (equal (modscope-kind x) :nested) (< (modscope-count (modscope-nested->upper x)) (modscope-count x))) :rule-classes :linear)