• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
          • Simplify-defun
          • Isodata
          • Tailrec
          • Schemalg
          • Restrict
          • Expdata
          • Casesplit
          • Simplify-term
          • Simplify-defun-sk
          • Parteval
            • Parteval-implementation
              • Parteval-event-generation
                • Parteval-gen-everything
                • Parteval-gen-new-fn
                • Parteval-gen-old-to-new-thm-instances
                • Parteval-gen-old-to-new-thm
                • Parteval-gen-new-fn-verify-guards
                • Parteval-gen-new-fn-body
                  • Parteval-transform-rec-args
                  • Parteval-transform-rec-calls-in-term
                  • Parteval-gen-static-equalities
                • Parteval-fn
                • Parteval-input-processing
                • Parteval-macro-definition
            • Solve
            • Wrap-output
            • Propagate-iso
            • Simplify
            • Finite-difference
            • Drop-irrelevant-params
            • Copy-function
            • Lift-iso
            • Rename-params
            • Utilities
            • Simplify-term-programmatic
            • Simplify-defun-sk-programmatic
            • Simplify-defun-programmatic
            • Simplify-defun+
            • Common-options
            • Common-concepts
          • Error-checking
          • Fty-extensions
          • Isar
          • Kestrel-utilities
          • Set
          • Soft
          • C
          • Bv
          • Imp-language
          • Event-macros
          • Java
          • Bitcoin
          • Ethereum
          • Yul
          • Zcash
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Lists-light
          • Axe
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Parteval-event-generation

    Parteval-gen-new-fn-body

    Generate the body of the new function.

    Signature
    (parteval-gen-new-fn-body old$ static$ new-name$ case wrld) 
      → 
    new-body
    Arguments
    old$ — Guard (symbolp old$).
    static$ — Guard (symbol-alistp static$).
    new-name$ — Guard (symbolp new-name$).
    case — Guard (member case '(1 2 3)).
    wrld — Guard (plist-worldp wrld).
    Returns
    new-body — A pseudo-termp.

    In case 1, we replace each yj with cj in the body of old.

    In case 2, we replace each recursive call of old with a call of new with the static arguments removed, and then we replace each yj with cj.

    In case 3, we call old with each yj replaced with cj.

    Definitions and Theorems

    Function: parteval-gen-new-fn-body

    (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)))))