• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
        • Syntax-for-tools
        • Atc
        • Language
        • Representation
        • Transformation-tools
          • Simpadd0
          • Deftrans
          • Splitgso
          • Constant-propagation
          • Split-fn
          • Copy-fn
          • Specialize
            • Param-declon-list-remove-param-by-ident
            • Specialize-fundef
            • Specialize-extdecl
              • Specialize-filepath-transunit-map
              • Specialize-transunit-ensemble
              • Specialize-extdecl-list
              • Param-declon-to-decl
              • Specialize-transunit
              • Ident-from-param-declon
            • Split-all-gso
            • Rename
            • Utilities
          • Insertion-sort
          • Pack
        • Farray
        • Rp-rewriter
        • Instant-runoff-voting
        • Imp-language
        • Sidekick
        • Leftist-trees
        • Java
        • Taspi
        • Bitcoin
        • Riscv
        • Des
        • Ethereum
        • X86isa
        • Sha-2
        • Yul
        • Zcash
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Poseidon
        • Where-do-i-place-my-book
        • Axe
        • Bigmems
        • Builtins
        • Execloader
        • Aleo
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Specialize

    Specialize-extdecl

    Transform an external declaration.

    Signature
    (specialize-extdecl extdecl target-fn target-param const) 
      → 
    (mv found new-extdecl)
    Arguments
    extdecl — Guard (extdeclp extdecl).
    target-fn — Guard (identp target-fn).
    target-param — Guard (identp target-param).
    const — Guard (exprp const).
    Returns
    found — Type (booleanp found).
    new-extdecl — Type (extdeclp new-extdecl).

    Definitions and Theorems

    Function: specialize-extdecl

    (defun specialize-extdecl (extdecl target-fn target-param const)
      (declare (xargs :guard (and (extdeclp extdecl)
                                  (identp target-fn)
                                  (identp target-param)
                                  (exprp const))))
      (let ((__function__ 'specialize-extdecl))
        (declare (ignorable __function__))
        (extdecl-case
             extdecl :fundef
             (b* (((mv found fundef)
                   (specialize-fundef extdecl.unwrap
                                      target-fn target-param const)))
               (mv found (extdecl-fundef fundef)))
             :decl (mv nil (extdecl-fix extdecl))
             :empty (mv nil (extdecl-fix extdecl))
             :asm (mv nil (extdecl-fix extdecl)))))

    Theorem: booleanp-of-specialize-extdecl.found

    (defthm booleanp-of-specialize-extdecl.found
      (b* (((mv ?found ?new-extdecl)
            (specialize-extdecl extdecl target-fn target-param const)))
        (booleanp found))
      :rule-classes :rewrite)

    Theorem: extdeclp-of-specialize-extdecl.new-extdecl

    (defthm extdeclp-of-specialize-extdecl.new-extdecl
      (b* (((mv ?found ?new-extdecl)
            (specialize-extdecl extdecl target-fn target-param const)))
        (extdeclp new-extdecl))
      :rule-classes :rewrite)