Generate the formula of the theorem that expresses the old function in terms of the new function.
(expdata-gen-old-to-new-thm-formula old$ arg-surjmaps res-surjmaps new$ wrld) → old-to-new-formula
Function:
(defun expdata-gen-old-to-new-thm-formula (old$ arg-surjmaps res-surjmaps new$ wrld) (declare (xargs :guard (and (symbolp old$) (expdata-symbol-surjmap-alistp arg-surjmaps) (expdata-pos-surjmap-alistp res-surjmaps) (symbolp new$) (plist-worldp wrld)))) (let ((__function__ 'expdata-gen-old-to-new-thm-formula)) (declare (ignorable __function__)) (b* ((x1...xn (formals old$ wrld)) (oldp-of-x1...xn (expdata-gen-oldp-of-terms x1...xn arg-surjmaps)) (forth-of-x1...xn (expdata-gen-forth-of-terms x1...xn arg-surjmaps)) (new-call (fcons-term new$ forth-of-x1...xn)) (old-call (fcons-term old$ x1...xn)) (consequent (case (len res-surjmaps) (0 (cons 'equal (cons old-call (cons new-call 'nil)))) (1 (b* ((back-res (expdata-surjmap->back (cdar res-surjmaps))) (back-of-new-call (apply-term* back-res new-call))) (cons 'equal (cons old-call (cons back-of-new-call 'nil))))) (t (b* ((mv-nths-of-old-call (make-mv-nth-calls old-call (len res-surjmaps))) (mv-nths-of-new-call (make-mv-nth-calls new-call (len res-surjmaps))) (back-of-mv-nths-of-new-call (expdata-gen-back-of-terms mv-nths-of-new-call res-surjmaps))) (conjoin-equalities mv-nths-of-old-call back-of-mv-nths-of-new-call)))))) (implicate (conjoin oldp-of-x1...xn) consequent))))