Maximum index of any identifier used anywhere in a clause.
Function:
(defun max-index-clause (clause) (declare (xargs :guard (lit-listp clause))) (let ((__function__ 'max-index-clause)) (declare (ignorable __function__)) (mbe :logic (if (atom clause) 0 (max (lit->var (car clause)) (max-index-clause (cdr clause)))) :exec (fast-max-index-clause clause 0))))
Theorem:
(defthm natp-of-max-index-clause (b* ((max (max-index-clause clause))) (natp max)) :rule-classes :type-prescription)
Theorem:
(defthm fast-max-index-clause-removal (equal (fast-max-index-clause clause max) (max (nfix max) (max-index-clause clause))))
Theorem:
(defthm max-index-clause-of-lit-list-fix-clause (equal (max-index-clause (lit-list-fix clause)) (max-index-clause clause)))
Theorem:
(defthm max-index-clause-lit-list-equiv-congruence-on-clause (implies (lit-list-equiv clause clause-equiv) (equal (max-index-clause clause) (max-index-clause clause-equiv))) :rule-classes :congruence)