• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
      • Std/lists
      • Std/alists
      • Obags
      • Std/util
      • Std/strings
      • Std/osets
      • Std/io
      • Std/basic
      • Std/system
        • Fresh-logical-name-with-$s-suffix
        • Irrelevant-formals-info
        • Std/system/function-queries
        • Std/system/term-queries
        • Std/system/term-transformations
        • Std/system/enhanced-utilities
        • Install-not-normalized-event
        • Install-not-normalized-event-lst
        • Std/system/term-function-recognizers
        • Genvar$
        • Std/system/event-name-queries
          • Logic-function-namep
          • Function-namep
          • Theorem-symbolp
          • Macro-symbolp
          • Logical-name-listp
          • Constant-symbolp
          • Theorem-symbol-listp
          • Theorem-name-listp
          • Macro-symbol-listp
          • Macro-name-listp
          • Function-symbol-listp
          • Function-name-listp
          • Theorem-namep
          • Macro-namep
          • Constant-namep
          • Fresh-namep
            • Fresh-namep-msg
            • Fresh-namep-msg-weak
              • Fresh-name-listp-msg-weak
            • Chk-fresh-namep
            • Fresh-name-listp-msg-weak
          • Std/system/function-symbolp
        • Pseudo-tests-and-call-listp
        • Maybe-pseudo-event-formp
        • Add-suffix-to-fn-or-const
        • Chk-irrelevant-formals-ok
        • Table-alist+
        • Pseudo-tests-and-callp
        • Add-suffix-to-fn-or-const-lst
        • Known-packages+
        • Add-suffix-to-fn-lst
        • Unquote-term
        • Event-landmark-names
        • Add-suffix-lst
        • Std/system/theorem-queries
        • Unquote-term-list
        • Std/system/macro-queries
        • Pseudo-command-landmark-listp
        • Install-not-normalized$
        • Pseudo-event-landmark-listp
        • Known-packages
        • Std/system/partition-rest-and-keyword-args
        • Rune-enabledp
        • Rune-disabledp
        • Included-books
        • Std/system/pseudo-event-formp
        • Std/system/plist-worldp-with-formals
        • Std/system/w
        • Std/system/geprops
        • Std/system/arglistp
        • Std/system/constant-queries
      • Std/typed-lists
      • Std/bitsets
      • Std/testing
      • Std/typed-alists
      • Std/stobjs
    • Community
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
    • Math
    • Testing-utilities
  • Fresh-namep

Fresh-namep-msg-weak

Return either nil or a message indicating why the name is not a legal new name.

Signature
(fresh-namep-msg-weak name type wrld) → msg/nil
Arguments
name — Guard (symbolp name).
wrld — Guard (plist-worldp wrld).
Returns
msg/nil — A message (see msg) or nil.

This helper function for fresh-namep-msg avoids the ``virginity'' check ensuring that the name is not already defined in raw Lisp. See fresh-namep-msg.

Definitions and Theorems

Function: fresh-namep-msg-weak

(defun fresh-namep-msg-weak (name type wrld)
 (declare (xargs :guard (and (symbolp name)
                             (plist-worldp wrld))))
 (declare
  (xargs
      :guard
      (member-eq type
                 '(function macro
                            const stobj constrained-function nil))))
 (let ((__function__ 'fresh-namep-msg-weak))
  (declare (ignorable __function__))
  (flet
   ((not-new-namep-msg
     (name wrld)
     (let ((old-type (logical-name-type name wrld t)))
      (cond
       (old-type
            (msg "~x0 is already the name for a ~s1."
                 name
                 (case old-type
                   (function "function")
                   (macro "macro")
                   (const "constant")
                   (stobj "stobj")
                   (constrained-function "constrained function")
                   (theorem "theorem"))))
       (t
        (msg
         "~x0 has properties in the world; it is ~
                                      not a new name."
         name))))))
   (cond ((mv-let (ctx msg)
                  (chk-all-but-new-name-cmp name 'fresh-namep-msg
                                            type wrld)
            (and ctx msg)))
         ((not (new-namep name wrld))
          (not-new-namep-msg name wrld))
         (t (case type
              (const (and (not (legal-constantp name))
                          (msg "~x0 is not a legal constant name."
                               name)))
              (stobj (and (not (new-namep (the-live-var name) wrld))
                          (not-new-namep-msg (the-live-var name)
                                             wrld)))
              (t nil)))))))

Subtopics

Fresh-name-listp-msg-weak
Lift fresh-namep-msg-weak to lists.