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