• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • Soft
        • C
          • Syntax-for-tools
          • Atc
          • Language
          • Transformation-tools
            • Simpadd0
            • Splitgso
            • Constant-propagation
            • Specialize
            • Split-fn
              • Split-fn-implementation
            • Split-fn-when
            • Split-all-gso
            • Copy-fn
            • Rename
            • Utilities
          • Representation
          • Insertion-sort
          • Pack
        • Bv
        • Imp-language
        • Event-macros
        • Java
        • Riscv
        • 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
  • Transformation-tools

Split-fn

A C-to-C transformation to split a function in two.

Introduction

This transformation splits out the second half of a function. The function body of the original function is truncated at the split point, at which point it calls the new function containing the remainder of the statements. Necessary values are passed by pointer to the split-out function.

General Form

(split-fn const-old
          const-new
          :target      ... ; required
          :new-fn      ... ; required
          :split-point ... ; required
  )

Inputs

const-old

Specifies the code to be transformed.

This must be a symbol that names an existing ACL2 constant that contains a translation unit ensemble, i.e. a value of type transunit-ensemble. This constant could result from c$::input-files, or from some other transformation.

const-new

Specifies the name of the constant for the transformed code.

This must be a symbol that is valid name for a new ACL2 constant.

:target

A string denoting the identifier of the function which should be split.

Note: There is currently no way to specify the translation unit to allow for disambiguation of functions of the same name with internal linkage. Eventually, a :target-filepath keyword argument will be introduced to accommodate this case. Until then, the transformation will apply to all functions of the specified name.

:new-fn

A string denoting the identifier which shall be used as the name of the new function introduced by the transformation.

Note: This identifier should be free to avoid name conflict, but this condition is not current checked.

:split-point

A natural number indicating the position in the function body at which to split. This is the number of top-levelblock itemsin the function body before the split point. Splits within nested statement blocks are not yet supported.

Subtopics

Split-fn-implementation
Implementation of split-fn.