• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
          • Simplify-defun
          • Isodata
          • Tailrec
          • Schemalg
          • Restrict
          • Expdata
          • Casesplit
          • Simplify-term
          • Simplify-defun-sk
          • Parteval
          • Solve
          • Wrap-output
          • Propagate-iso
          • Simplify
          • Finite-difference
          • Drop-irrelevant-params
          • Copy-function
          • Lift-iso
          • Rename-params
          • Utilities
            • Defaults-table
            • Xdoc::apt-constructors
            • Input-processors
              • Process-input-old-soft-io-sel-mod
              • Process-input-new/wrapper-names
              • Process-input-select-old-soft-io
              • Process-input-old-to-new-name
              • Process-input-old-if-new-name
              • Process-input-old-to-wrapper-name
              • Process-input-wrapper-enable
              • Process-input-wrapper-to-old-name
              • Process-input-old-to-new-enable
              • Process-input-old-to-wrapper-enable
              • Process-input-old-if-new-enable
              • Process-input-new-name
                • Process-input-new-to-old-name
                • Process-input-wrapper-to-old-enable
                • Process-input-verify-guards
                • Process-input-new-enable
                • Process-input-new-to-old-enable
              • Transformation-table
              • Find-base-cases
              • Untranslate-specifier-utilities
              • Print-specifier-utilities
              • Hints-specifier-utilities
            • Simplify-term-programmatic
            • Simplify-defun-sk-programmatic
            • Simplify-defun-programmatic
            • Simplify-defun+
            • Common-options
            • Common-concepts
          • Error-checking
          • Fty-extensions
          • Isar
          • Kestrel-utilities
          • Set
          • Soft
          • C
          • 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
    • Input-processors

    Process-input-new-name

    Process the :new-name input of an APT transformation.

    Signature
    (process-input-new-name new-name old names-to-avoid ctx state) 
      → 
    (mv erp result state)
    Arguments
    old — Guard (symbolp old).
    names-to-avoid — Guard (symbol-listp names-to-avoid).
    Returns
    result — A tuple (new-name$ updated-names-to-avoid) satisfying (typed-tuplep symbolp symbol-listp result).

    The APT transformations that use this utility have a :new-name input but not a :wrapper and :wrapper-name input (the ones with these additional two inputs should use the utility process-input-new/wrapper-names instead). This utility processes (and validates) the :new-name inputs, as described in function-name-generation.

    Definitions and Theorems

    Function: process-input-new-name

    (defun process-input-new-name
           (new-name old names-to-avoid ctx state)
     (declare (xargs :stobjs (state)))
     (declare (xargs :guard (and (symbolp old)
                                 (symbol-listp names-to-avoid))))
     (let ((__function__ 'process-input-new-name))
      (declare (ignorable __function__))
      (b*
       ((wrld (w state))
        ((er &)
         (ensure-value-is-symbol$ new-name "The :NEW-NAME input" t nil))
        ((mv numbered-name-p base index)
         (check-numbered-name old wrld))
        ((mv base index)
         (if numbered-name-p (mv base index)
           (mv old 0))))
       (if (eq new-name :auto)
           (b* (((mv new-name names-to-avoid)
                 (next-fresh-numbered-name base (1+ index)
                                           names-to-avoid wrld)))
             (value (list new-name names-to-avoid)))
        (b*
         ((msg/nil (fresh-namep-msg-weak new-name 'function
                                         wrld))
          ((when msg/nil)
           (er-soft+
            ctx t nil
            "The name ~x0 specified by :NEW-NAME ~
                           is already in use.  ~@1"
            new-name msg/nil))
          ((when (member-eq new-name names-to-avoid))
           (er-soft+
            ctx t nil
            "The name ~x0 specified by :NEW-NAME ~
                           must be distinct form the names ~&1 ~
                           that are also being generated."
            new-name names-to-avoid)))
         (value (list new-name
                      (cons new-name names-to-avoid))))))))