• 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
              • Specialize-implementation
                • Param-declon-list-remove-param-by-ident
                • Specialize-fundef
                • Specialize-extdecl
                • Specialize-filepath-transunit-map
                • Specialize-extdecl-list
                • Specialize-transunit-ensemble
                • Param-declon-to-decl
                • Specialize-transunit
                • Ident-from-param-declon
                • Specialize-event-generation
                • Specialize-input-processing
                  • Specialize-process-inputs
              • 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
    • Specialize-input-processing

    Specialize-process-inputs

    Process the inputs.

    Signature
    (specialize-process-inputs const-old 
                               const-new target param const wrld) 
     
      → 
    (mv er? tunits const-new$ target$ param$ const)
    Arguments
    wrld — Guard (plist-worldp wrld).
    Returns
    er? — Type (maybe-msgp er?).
    tunits — Type (transunit-ensemblep tunits).
    const-new$ — Type (symbolp const-new$).
    target$ — Type (identp target$).
    param$ — Type (identp param$).
    const — Type (exprp const).

    Definitions and Theorems

    Function: specialize-process-inputs

    (defun specialize-process-inputs
           (const-old const-new target param const wrld)
      (declare (xargs :guard (plist-worldp wrld)))
      (b* (((reterr)
            (irr-transunit-ensemble)
            nil (c$::irr-ident)
            (c$::irr-ident)
            (irr-expr))
           ((unless (symbolp const-old))
            (retmsg$ "~x0 must be a symbol." const-old))
           (tunits (constant-value const-old wrld))
           ((unless (transunit-ensemblep tunits))
            (retmsg$ "~x0 must be a translation unit ensemble."
                     const-old))
           ((unless (symbolp const-new))
            (retmsg$ "~x0 must be a symbol." const-new))
           ((unless (stringp target))
            (retmsg$ "~x0 must be a string." target))
           (target (ident target))
           ((unless (stringp param))
            (retmsg$ "~x0 must be a string." param))
           (param (ident param))
           ((unless (exprp const))
            (retmsg$ "~x0 must be a C expression." const)))
        (retok tunits const-new target param const)))

    Theorem: maybe-msgp-of-specialize-process-inputs.er?

    (defthm maybe-msgp-of-specialize-process-inputs.er?
      (b*
       (((mv ?er? ?tunits
             ?const-new$ ?target$ ?param$ ?const)
         (specialize-process-inputs const-old
                                    const-new target param const wrld)))
       (maybe-msgp er?))
      :rule-classes :rewrite)

    Theorem: transunit-ensemblep-of-specialize-process-inputs.tunits

    (defthm transunit-ensemblep-of-specialize-process-inputs.tunits
      (b*
       (((mv ?er? ?tunits
             ?const-new$ ?target$ ?param$ ?const)
         (specialize-process-inputs const-old
                                    const-new target param const wrld)))
       (transunit-ensemblep tunits))
      :rule-classes :rewrite)

    Theorem: symbolp-of-specialize-process-inputs.const-new$

    (defthm symbolp-of-specialize-process-inputs.const-new$
      (b*
       (((mv ?er? ?tunits
             ?const-new$ ?target$ ?param$ ?const)
         (specialize-process-inputs const-old
                                    const-new target param const wrld)))
       (symbolp const-new$))
      :rule-classes :rewrite)

    Theorem: identp-of-specialize-process-inputs.target$

    (defthm identp-of-specialize-process-inputs.target$
      (b*
       (((mv ?er? ?tunits
             ?const-new$ ?target$ ?param$ ?const)
         (specialize-process-inputs const-old
                                    const-new target param const wrld)))
       (identp target$))
      :rule-classes :rewrite)

    Theorem: identp-of-specialize-process-inputs.param$

    (defthm identp-of-specialize-process-inputs.param$
      (b*
       (((mv ?er? ?tunits
             ?const-new$ ?target$ ?param$ ?const)
         (specialize-process-inputs const-old
                                    const-new target param const wrld)))
       (identp param$))
      :rule-classes :rewrite)

    Theorem: exprp-of-specialize-process-inputs.const

    (defthm exprp-of-specialize-process-inputs.const
      (b*
       (((mv ?er? ?tunits
             ?const-new$ ?target$ ?param$ ?const)
         (specialize-process-inputs const-old
                                    const-new target param const wrld)))
       (exprp const))
      :rule-classes :rewrite)