Cause an error if a recursive function occurs in its own termination theorem.
(ensure-function-not-in-termination-thm fn description error-erp error-val ctx state) → (mv erp val state)
Function:
(defun ensure-function-not-in-termination-thm (fn description error-erp error-val ctx state) (declare (xargs :stobjs (state))) (declare (xargs :guard (and (msgp description) (and (logic-function-namep fn (w state)) (recursivep fn nil (w state)))))) (b* (((when (member-eq fn (all-ffn-symbs (termination-theorem fn (w state)) nil))) (er-soft+ ctx error-erp error-val "~@0 must not occur in its own termination theorem, which is~%~x1." description (termination-theorem fn (w state))))) (value nil)))