Generate the body of the new function,
when
(isodata-gen-new-fn-body-nonpred old$ arg-isomaps res-isomaps undefined$ new$ compatibility wrld) → new-body
If
First we transform any recursive calls via
Function:
(defun isodata-gen-new-fn-body-nonpred (old$ arg-isomaps res-isomaps undefined$ new$ compatibility wrld) (declare (xargs :guard (and (symbolp old$) (isodata-symbol-isomap-alistp arg-isomaps) (isodata-pos-isomap-alistp res-isomaps) (symbolp new$) (plist-worldp wrld)))) (let ((__function__ 'isodata-gen-new-fn-body-nonpred)) (declare (ignorable __function__)) (b* ((x1...xn (formals old$ wrld)) (m (number-of-results old$ wrld)) (old-body (if (non-executablep old$ wrld) (unwrapped-nonexec-body old$ wrld) (ubody old$ wrld))) (old-body-with-new-rec-calls (isodata-xform-rec-calls old-body old$ arg-isomaps res-isomaps new$)) (old-body-with-back-of-x1...xn (isodata-gen-subst-x1...xn-with-back-of-x1...xn old-body-with-new-rec-calls old$ arg-isomaps wrld)) (newp-of-x1...xn (isodata-gen-newp-of-terms x1...xn arg-isomaps)) (newp-of-x1...xn-conj (conjoin newp-of-x1...xn)) (then-branch (cond ((endp res-isomaps) old-body-with-back-of-x1...xn) ((endp (cdr res-isomaps)) (apply-fn-into-ifs (isodata-isomap->forth (cdar res-isomaps)) old-body-with-back-of-x1...xn)) (t (b* ((y1...ym (isodata-gen-result-vars old$ m)) (forth-of-y1...ym (isodata-gen-forth-of-terms y1...ym res-isomaps))) (make-mv-let-call 'mv y1...ym :all old-body-with-back-of-x1...xn (fcons-term 'mv forth-of-y1...ym)))))) (else-branch (cond ((eq :base-case-then undefined$) (find-a-base-case-translated then-branch (list new$) t)) ((eq :base-case-else undefined$) (find-a-base-case-translated then-branch (list new$) nil)) (t undefined$)))) (cond ((and compatibility (not (recursivep old$ nil wrld)) then-branch)) ((equal newp-of-x1...xn-conj *t*) then-branch) (t (cons 'if (cons (cons 'mbt$ (cons newp-of-x1...xn-conj 'nil)) (cons then-branch (cons else-branch 'nil)))))))))