Save the proof obligations for a given event as separate defthms.

Say you'd like to admit a function and verify its guards, but you want its termination and guard proof obligations to be saved as defthms so that you can use them later. Here is how to do this with def-saved-obligs:

(def-saved-obligs foo-obligs :proofs ((foo-measure-thm :hints (...)) (foo-guard-thm :hints (...))) (defun foo (x y) (declare (xargs :guard ...)) ...))

Major caveat: This works by trying to admit the proof obligations as defthms before admitting the actual events. In some cases this isn't possible: e.g., for termination conditions of some reflexive functions and guard verifications involving some requirement about the result of a recursive call. For guards, it should work to defer the guard verification to a separate def-saved-obligs event from the one with the defun. For reflexive functions, you're out of luck with this macro, for the present.

The :proofs entries should occur in the order that the corresponding proof obligations are tackled by ACL2.

The theorems produced will all have :rule-classes nil.

The ambient theory may affect the proof obligations that are saved. It
might make sense to do

This macro expands to a make-event form. In the make-event expansion phase, the events are run with some default hints installed that record each proof obligation and avoid having to actually complete the proof. on every proof obligation, push the corresponding clause onto a state global, and then unsoundly complete the proof by instantiating a bogus theorem NIL submitted using skip-proofs. (Since the use of skip-proofs is only in the make-event expansion phase, its effects are erased and it is allowed by certify-book even without :skip-proofs-okp.)