(svexlist-count-calls-aux x acc) → call-count
Function:
(defun svexlist-count-calls-aux (x acc) (declare (xargs :guard (and (svexlist-p x) (natp acc)))) (let ((__function__ 'svexlist-count-calls-aux)) (declare (ignorable __function__)) (if (atom x) (lnfix acc) (svexlist-count-calls-aux (cdr x) (+ (let ((x1 (car x))) (svex-case x1 :call 1 :otherwise 0)) (lnfix acc))))))
Theorem:
(defthm natp-of-svexlist-count-calls-aux (b* ((call-count (svexlist-count-calls-aux x acc))) (natp call-count)) :rule-classes :type-prescription)
Theorem:
(defthm svexlist-count-calls-aux-of-svexlist-fix-x (equal (svexlist-count-calls-aux (svexlist-fix x) acc) (svexlist-count-calls-aux x acc)))
Theorem:
(defthm svexlist-count-calls-aux-svexlist-equiv-congruence-on-x (implies (svexlist-equiv x x-equiv) (equal (svexlist-count-calls-aux x acc) (svexlist-count-calls-aux x-equiv acc))) :rule-classes :congruence)
Theorem:
(defthm svexlist-count-calls-aux-of-nfix-acc (equal (svexlist-count-calls-aux x (nfix acc)) (svexlist-count-calls-aux x acc)))
Theorem:
(defthm svexlist-count-calls-aux-nat-equiv-congruence-on-acc (implies (nat-equiv acc acc-equiv) (equal (svexlist-count-calls-aux x acc) (svexlist-count-calls-aux x acc-equiv))) :rule-classes :congruence)