Generate the formula for the loop termination theorem.
(atc-gen-loop-tthm-formula term fn measure-of-fn measure-formals state) → (mv erp new-term)
This is obtained from the loop function's termination theorem, transformed as follows.
The o< relation is replaced with <. This is justified by the fact that the measure yields a natural number, as guaranteed by the applicability condition.
Furthermore, the measure term is replaced
with a call of the generated measure function.
More precisely, this is done in every term of the form
Theorem:
(defthm len-of-atc-gen-loop-tthm-formula (b* nil t) :rule-classes nil)
Theorem:
(defthm len-of-atc-gen-loop-tthm-formula-lst (b* (((mv acl2::?erp ?new-terms) (atc-gen-loop-tthm-formula-lst terms fn measure-of-fn measure-formals state))) (implies (not erp) (equal (len new-terms) (len terms)))))
Theorem:
(defthm pseudo-termp-of-atc-gen-loop-tthm-formula (implies (and (pseudo-termp term) (symbolp measure-of-fn) (not (eq measure-of-fn 'quote)) (symbol-listp measure-formals)) (b* (((mv acl2::?erp ?new-term) (atc-gen-loop-tthm-formula term fn measure-of-fn measure-formals state))) (pseudo-termp new-term))))
Theorem:
(defthm pseudo-termp-of-atc-gen-loop-tthm-formula-lst (implies (and (pseudo-term-listp terms) (symbolp measure-of-fn) (not (eq measure-of-fn 'quote)) (symbol-listp measure-formals)) (b* (((mv acl2::?erp ?new-terms) (atc-gen-loop-tthm-formula-lst terms fn measure-of-fn measure-formals state))) (pseudo-term-listp new-terms))))