Limit to pass to exec-expr-list for the execution of the given list of pure expressions to terminate.
(expr-list-pure-limit exprs) → limit
If the list is empty, we still need 1 because exec-expr-list checks the limit against zp before examining the list. If the list is not empty, we additionally need enough to execute the first and the rest, so we take the maximum.
Function:
(defun expr-list-pure-limit (exprs) (declare (xargs :guard (expr-listp exprs))) (declare (xargs :guard (expr-list-purep exprs))) (cond ((endp exprs) 1) (t (1+ (max (expr-pure-limit (car exprs)) (expr-list-pure-limit (cdr exprs)))))))
Theorem:
(defthm posp-of-expr-list-pure-limit (b* ((limit (expr-list-pure-limit exprs))) (posp limit)) :rule-classes (:rewrite :type-prescription))
Theorem:
(defthm expr-list-pure-limit-of-expr-list-fix-exprs (equal (expr-list-pure-limit (expr-list-fix exprs)) (expr-list-pure-limit exprs)))
Theorem:
(defthm expr-list-pure-limit-expr-list-equiv-congruence-on-exprs (implies (expr-list-equiv exprs exprs-equiv) (equal (expr-list-pure-limit exprs) (expr-list-pure-limit exprs-equiv))) :rule-classes :congruence)