Tail recursive version of max-index-formula.
(fast-max-index-formula formula max) → *
Function:
(defun fast-max-index-formula (formula max) (declare (xargs :guard (and (lit-list-listp formula) (natp max)))) (let ((__function__ 'fast-max-index-formula)) (declare (ignorable __function__)) (b* (((when (atom formula)) (lnfix max)) (max (fast-max-index-clause (car formula) max))) (fast-max-index-formula (cdr formula) max))))
Theorem:
(defthm fast-max-index-formula-of-lit-list-list-fix-formula (equal (fast-max-index-formula (lit-list-list-fix formula) max) (fast-max-index-formula formula max)))
Theorem:
(defthm fast-max-index-formula-lit-list-list-equiv-congruence-on-formula (implies (lit-list-list-equiv formula formula-equiv) (equal (fast-max-index-formula formula max) (fast-max-index-formula formula-equiv max))) :rule-classes :congruence)
Theorem:
(defthm fast-max-index-formula-of-nfix-max (equal (fast-max-index-formula formula (nfix max)) (fast-max-index-formula formula max)))
Theorem:
(defthm fast-max-index-formula-nat-equiv-congruence-on-max (implies (nat-equiv max max-equiv) (equal (fast-max-index-formula formula max) (fast-max-index-formula formula max-equiv))) :rule-classes :congruence)