• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
      • Theories
      • Rule-classes
      • Proof-builder
      • Recursion-and-induction
      • Hons-and-memoization
      • Events
      • Parallelism
      • History
      • Programming
        • Defun
        • Declare
        • System-utilities
          • Saving-event-data
          • Trans-eval
          • System-utilities-non-built-in
            • Pseudo-event-formp
            • Pseudo-event-form-listp
            • Directed-untranslate
            • Irrelevant-formals-info
            • 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
              • Context-message-pair
              • 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
            • Get-event-data
            • Untranslate
            • Constraint-info
          • Stobj
          • State
          • Mutual-recursion
          • Memoize
          • Mbe
          • Io
          • Defpkg
          • Apply$
          • Loop$
          • Programming-with-state
          • Arrays
          • Characters
          • Time$
          • Defconst
          • Fast-alists
          • Defmacro
          • Loop$-primer
          • Evaluation
          • Guard
          • Equality-variants
          • Compilation
          • Hons
          • ACL2-built-ins
          • Developers-guide
          • System-attachments
          • Advanced-features
          • Set-check-invariant-risk
          • Numbers
          • Efficiency
          • Irrelevant-formals
          • Introduction-to-programming-in-ACL2-for-those-who-know-lisp
          • Redefining-programs
          • Lists
          • Invariant-risk
          • Errors
          • Defabbrev
          • Conses
          • Alists
          • Set-register-invariant-risk
          • Strings
          • Program-wrapper
          • Get-internal-time
          • Basics
          • Packages
          • Oracle-eval
          • Defmacro-untouchable
          • <<
          • Primitive
          • Revert-world
          • Unmemoize
          • Set-duplicate-keys-action
          • Symbols
          • Def-list-constructor
          • Easy-simplify-term
          • Defiteration
          • Fake-oracle-eval
          • Defopen
          • Sleep
        • Operational-semantics
        • Real
        • Start-here
        • Miscellaneous
        • Output-controls
        • Bdd
        • Macros
        • Installation
        • Mailing-lists
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • 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))))))