Generate the body of the new function.
(parteval-gen-new-fn-body old$ static$ new-name$ case wrld) → new-body
In case 1, we replace each
In case 2, we replace each recursive call of
In case 3, we call
Function:
(defun parteval-gen-new-fn-body (old$ static$ new-name$ case wrld) (declare (xargs :guard (and (symbolp old$) (symbol-alistp static$) (symbolp new-name$) (member case '(1 2 3)) (plist-worldp wrld)))) (let ((__function__ 'parteval-gen-new-fn-body)) (declare (ignorable __function__)) (case case (1 (fsublis-var static$ (ubody old$ wrld))) (2 (b* ((body (ubody old$ wrld)) (body (parteval-transform-rec-calls-in-term body old$ new-name$ (strip-cars static$) wrld)) (body (fsublis-var static$ body))) body)) (3 (fsublis-var static$ (cons old$ (formals old$ wrld)))) (t (impossible)))))