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