• 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-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-when

    A C-to-C transformation to split functions according to some trigger pattern.

    Introduction

    This transformation traverse finds location in functions which match the provided trigger pattern. When such a pattern is found, the function is split (see split-fn) and the transformation continues looking for further pattern matches. The transformation finishes when no more trigger patterns are found.

    General Form

    (split-fn-when const-old
                   const-new
                   :triggers ... ; 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. 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.

    :triggers

    A string or string list representing identifiers. A statement matches the trigger pattern if it is a simple function call whose function is an identifier included in this string list. The split-point inferred from such a statement will be immediately before the statement. The first statement of a function will never match the trigger pattern, as splitting in such cases would do nothing. Only top-level statements of a function body will current match a trigger pattern (e.g., statements within an if then/else block will not be considered).

    This current representation of a trigger pattern is very limited. It may be expanded in the future to describe various types of expressions at various points in a statement, and causing a split either before or after the statement.