• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Debugging
    • Projects
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Error-checking
        • Apt
        • Abnf
        • Fty-extensions
        • Isar
        • Kestrel-utilities
          • Omaps
          • Directed-untranslate
          • Include-book-paths
          • Ubi
          • Checkpoint-list
          • Digits-any-base
          • Context-message-pair
          • Numbered-names
          • With-auto-termination
          • Theorems-about-true-list-lists
          • Make-termination-theorem
          • Sublis-expr+
          • Prove$
          • Defthm<w
          • System-utilities-non-built-in
            • Pseudo-event-formp
            • Pseudo-event-form-listp
            • Directed-untranslate
            • Irrelevant-formals-info
            • Context-message-pair
            • Numbered-names
            • Prove$
            • Minimize-ruler-extenders
            • Paired-names
            • Orelse
            • Fresh-name-in-world-with-$s
              • Encapsulate-report-errors
              • On-failure
              • Chk-irrelevant-formals-ok
              • Named-formulas
              • Pseudo-event-landmarkp
              • All-program-fns
              • All-logic-fns
              • Trans-eval-error-triple
              • Trans-eval-state
              • Pseudo-tests-and-callsp
              • User-interface
              • Pseudo-command-landmarkp
              • Pseudo-tests-and-calls-listp
              • Pseudo-command-formp
              • Orelse*
              • Identity-macro
            • Integer-range-fix
            • Add-const-to-untranslate-preprocess
            • Integers-from-to
            • Minimize-ruler-extenders
            • Unsigned-byte-fix
            • Signed-byte-fix
            • Defthmr
            • Paired-names
            • Unsigned-byte-list-fix
            • Signed-byte-list-fix
            • Show-books
            • Checkpoint-list-pretty
            • List-utilities
            • Skip-in-book
            • Typed-tuplep
            • Defunt
            • Keyword-value-list-to-alist
            • Magic-macroexpand
            • Top-command-number-fn
            • Bits-as-digits-in-base-2
            • Show-checkpoint-list
            • Ubyte11s-as-digits-in-base-2048
            • Named-formulas
            • Bytes-as-digits-in-base-256
            • String-utilities
            • Make-keyword-value-list-from-keys-and-value
            • Integer-range-listp
            • Defmacroq
            • Apply-fn-if-known
            • Trans-eval-error-triple
            • Checkpoint-info-list
            • Previous-subsumer-hints
            • Fms!-lst
            • Zp-listp
            • Doublets-to-alist
            • Trans-eval-state
            • Injections
            • Theorems-about-osets
            • Typed-list-utilities
            • Book-runes-alist
            • User-interface
            • Bits/ubyte11s-digit-grouping
            • Bits/bytes-digit-grouping
            • Message-utilities
            • Subsetp-eq-linear
            • Strict-merge-sort-<
            • Miscellaneous-enumerations
            • Maybe-unquote
            • Oset-utilities
            • Thm<w
            • Defthmd<w
          • Prime-field-constraint-systems
          • Soft
          • Bv
          • Imp-language
          • Event-macros
          • Bitcoin
          • Ethereum
          • Yul
          • Zcash
          • ACL2-programming-language
          • Prime-fields
          • Java
          • C
          • Syntheto
          • Number-theory
          • Cryptography
          • Lists-light
          • File-io-light
          • Json
          • Built-ins
          • Solidity
          • Axe
          • Std-extensions
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Execloader
        • Axe
      • Testing-utilities
      • Math
    • System-utilities-non-built-in

    Fresh-name-in-world-with-$s

    Append as many $ signs to a name as needed to make the name new in the world, i.e. not already in use, and not among a given list of names to avoid.

    Signature
    (fresh-name-in-world-with-$s name names-to-avoid wrld) 
      → 
    fresh-name
    Arguments
    name — Guard (and (symbolp name) (not (keywordp name))).
    names-to-avoid — Guard (symbol-listp names-to-avoid).
    wrld — Guard (plist-worldp wrld).
    Returns
    fresh-name — A symbolp.

    The name returned by this function should be usable for a new function, theorem, constant, etc.

    Note that for a constant, the $ signs are appended before the final * character.

    The input name must not be a keyword, because it would remain a keyword (which cannot be the name of a function, theorem, etc.) when $ signs are appended to it.

    Since symbols in the main Lisp package are not usable to name new functions, theorems, etc., if the input name is in the main Lisp package, the output name is in the "ACL2" package, and has at least one $ appended to it.

    If the input name is already new, not among the names to avoid, and not in the main Lisp package, it is returned unchanged.

    Definitions and Theorems

    Function: fresh-name-in-world-with-$s

    (defun
     fresh-name-in-world-with-$s
     (name names-to-avoid wrld)
     (declare (xargs :guard (and (and (symbolp name)
                                      (not (keywordp name)))
                                 (symbol-listp names-to-avoid)
                                 (plist-worldp wrld))))
     (if
       (or (logical-namep name wrld)
           (member name names-to-avoid)
           (equal (symbol-package-name name)
                  *main-lisp-package-name*))
       (fresh-name-in-world-with-$s (add-suffix-to-fn-or-const name "$")
                                    names-to-avoid wrld)
       name))