• 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
                • Max-numbered-name-index-in-use
                • Add-numbered-name-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-in-use

    Add-numbered-name-in-use

    Record that a numbered name is in use.

    This macro generates an event form to add a numbered name to the table of numbered names in use. If the name is not a numbered name, or it is a numbered name with a wildcard, tha table is unchanged (via an empty progn).

    Macro: add-numbered-name-in-use

    (defmacro add-numbered-name-in-use (name)
      (cons 'make-event
            (cons (cons 'add-numbered-name-in-use-fn
                        (cons (cons 'quote (cons name 'nil))
                              '((w state))))
                  'nil)))

    Definitions and Theorems

    Function: add-numbered-name-in-use-fn

    (defun add-numbered-name-in-use-fn (name wrld)
     (declare (xargs :guard (and (symbolp name)
                                 (plist-worldp wrld))))
     (let ((__function__ 'add-numbered-name-in-use-fn))
      (declare (ignorable __function__))
      (b* (((mv is-numbered-name base index)
            (check-numbered-name name wrld)))
        (if
         (and is-numbered-name (/= index 0))
         (b* ((table (table-alist 'numbered-names-in-use
                                  wrld)
    )
              (current-indices (cdr (assoc-eq base table)))
              (new-indices (add-to-set-eql index current-indices)))
           (cons 'table
                 (cons 'numbered-names-in-use
                       (cons (cons 'quote (cons base 'nil))
                             (cons (cons 'quote (cons new-indices 'nil))
                                   'nil)))))
         '(progn)))))

    Theorem: pseudo-event-formp-of-add-numbered-name-in-use-fn

    (defthm pseudo-event-formp-of-add-numbered-name-in-use-fn
      (b* ((event (add-numbered-name-in-use-fn name wrld)))
        (pseudo-event-formp event))
      :rule-classes :rewrite)