• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • 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
          • Representation
          • Transformation-tools
            • Simpadd0
            • Deftrans
            • Splitgso
            • Constant-propagation
            • Split-fn
              • Abstract-fn
              • Split-fn-block-item-list
              • Decl-to-ident-paramdeclon-map
              • Split-fn-fundef
              • Split-fn-extdecl
                • Split-fn-filepath-transunit-map
                • Split-fn-extdecl-list
                • Param-declon-to-ident-paramdeclon-map
                • Split-fn-transunit-ensemble
                • Split-fn-transunit
                • Param-declon-list-to-ident-paramdeclon-map
                • Ident-paramdeclon-map-filter
                • Decl-to-ident-paramdeclon-map0
                • Decl-list-to-ident-paramdeclon-map
                • Expr-ident-list
                • Ident-paramdeclon-map
              • Copy-fn
              • Specialize
              • Split-all-gso
              • Rename
              • Utilities
            • Insertion-sort
            • Pack
          • 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
    • Split-fn

    Split-fn-extdecl

    Transform an external declaration.

    Signature
    (split-fn-extdecl target-fn new-fn-name extdecl split-point) 
      → 
    (mv er target-found extdecls)
    Arguments
    target-fn — Guard (identp target-fn).
    new-fn-name — Guard (identp new-fn-name).
    extdecl — Guard (extdeclp extdecl).
    split-point — Guard (natp split-point).
    Returns
    target-found — Type (booleanp target-found).
    extdecls — Type (extdecl-listp extdecls).

    Definitions and Theorems

    Function: split-fn-extdecl

    (defun split-fn-extdecl (target-fn new-fn-name extdecl split-point)
     (declare (xargs :guard (and (identp target-fn)
                                 (identp new-fn-name)
                                 (extdeclp extdecl)
                                 (natp split-point))))
     (let ((__function__ 'split-fn-extdecl))
       (declare (ignorable __function__))
       (b* (((reterr) nil nil))
         (extdecl-case
              extdecl :fundef
              (b* (((erp fundef1 fundef2)
                    (split-fn-fundef target-fn new-fn-name
                                     extdecl.unwrap split-point)))
                (fundef-option-case
                     fundef2
                     :some (retok t
                                  (list (extdecl-fundef fundef1)
                                        (extdecl-fundef fundef2.val)))
                     :none (retok nil (list (extdecl-fundef fundef1)))))
              :decl (retok nil (list (extdecl-fix extdecl)))
              :empty (retok nil (list (extdecl-fix extdecl)))
              :asm (retok nil (list (extdecl-fix extdecl)))))))

    Theorem: booleanp-of-split-fn-extdecl.target-found

    (defthm booleanp-of-split-fn-extdecl.target-found
      (b* (((mv acl2::?er ?target-found ?extdecls)
            (split-fn-extdecl target-fn
                              new-fn-name extdecl split-point)))
        (booleanp target-found))
      :rule-classes :rewrite)

    Theorem: extdecl-listp-of-split-fn-extdecl.extdecls

    (defthm extdecl-listp-of-split-fn-extdecl.extdecls
      (b* (((mv acl2::?er ?target-found ?extdecls)
            (split-fn-extdecl target-fn
                              new-fn-name extdecl split-point)))
        (extdecl-listp extdecls))
      :rule-classes :rewrite)