• 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
          • Omaps
          • Directed-untranslate
          • Include-book-paths
          • Ubi
          • Numbered-names
            • Check-numbered-name
            • Next-numbered-name
              • Resolve-numbered-name-wildcard
              • Set-numbered-name-index
              • Next-fresh-numbered-names
              • Global-numbered-name-index
              • Make-numbered-name
              • Make-numbered-name-list
              • Set-numbered-name-index-to-global
              • Numbered-names-in-use
              • Next-fresh-numbered-name
              • Numbered-name-index-wildcard
              • Numbered-name-index-start
              • Numbered-name-index-end
            • Digits-any-base
            • Context-message-pair
            • With-auto-termination
            • Make-termination-theorem
            • Theorems-about-true-list-lists
            • Checkpoint-list
            • Sublis-expr+
            • Integers-from-to
            • Prove$
            • Defthm<w
            • System-utilities-non-built-in
            • Integer-range-fix
            • Minimize-ruler-extenders
            • Add-const-to-untranslate-preprocess
            • Unsigned-byte-fix
            • Signed-byte-fix
            • Defthmr
            • Paired-names
            • Unsigned-byte-list-fix
            • Signed-byte-list-fix
            • Show-books
            • Skip-in-book
            • Typed-tuplep
            • List-utilities
            • Checkpoint-list-pretty
            • 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
            • Defmacroq
            • Integer-range-listp
            • Apply-fn-if-known
            • Trans-eval-error-triple
            • Checkpoint-info-list
            • Previous-subsumer-hints
            • Fms!-lst
            • Zp-listp
            • Trans-eval-state
            • Injections
            • Doublets-to-alist
            • Theorems-about-osets
            • Typed-list-utilities
            • Book-runes-alist
            • User-interface
            • Bits/ubyte11s-digit-grouping
            • Bits/bytes-digit-grouping
            • Message-utilities
            • Subsetp-eq-linear
            • Oset-utilities
            • Strict-merge-sort-<
            • Miscellaneous-enumerations
            • Maybe-unquote
            • Thm<w
            • Defthmd<w
            • Io-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
    • Numbered-names

    Next-numbered-name

    Next numbered name with the same base.

    Signature
    (next-numbered-name name wrld) → new-name
    Arguments
    name — Guard (symbolp name).
    wrld — Guard (plist-worldp wrld).
    Returns
    new-name — A symbol.

    If name is a numbered name with base base and index i, return the numbered name with base base and index j, where j is the smallest integer larger than i such that the numbered name with base base and index j is not in the ACL2 world. If name is a numbered name with base base and the wildcard as index, the behavior is the same as if this function were called on the result of resolve-numbered-name-wildcard on name. If name is not a numbered name, treat it as if it had numeric index 0, i.e. return the numbered name with base name and index j, where j is the smallest positive integer such that the numbered name with base name and index j is not in the ACL2 world.

    This function is independent from the global index for numbered names.

    Definitions and Theorems

    Function: next-numbered-name-aux

    (defun next-numbered-name-aux (base current-index wrld)
      (declare (xargs :guard (and (symbolp base)
                                  (posp current-index)
                                  (plist-worldp wrld))))
      (let ((__function__ 'next-numbered-name-aux))
        (declare (ignorable __function__))
        (let ((name (make-numbered-name base current-index wrld)))
          (if (logical-namep name wrld)
              (next-numbered-name-aux base (1+ current-index)
                                      wrld)
            current-index))))

    Function: next-numbered-name

    (defun next-numbered-name (name wrld)
     (declare (xargs :guard (and (symbolp name)
                                 (plist-worldp wrld))))
     (let ((__function__ 'next-numbered-name))
      (declare (ignorable __function__))
      (b* (((mv is-numbered-name base index)
            (check-numbered-name name wrld)))
        (if is-numbered-name
         (let
          ((next-index
                (if (= index 0)
                    (next-numbered-name-aux
                         base
                         (1+ (max-numbered-name-index-in-use base wrld))
                         wrld)
                  (next-numbered-name-aux base (1+ index)
                                          wrld))))
          (make-numbered-name base next-index wrld))
         (let ((next-index (next-numbered-name-aux name 1 wrld)))
           (make-numbered-name name next-index wrld))))))