• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
      • Std/lists
      • Std/alists
      • Obags
      • Std/util
        • Defprojection
        • Deflist
        • Defaggregate
        • Define
        • Defmapping
        • Defenum
        • Add-io-pairs
        • Defalist
        • Defmapappend
        • Returns-specifiers
        • Defarbrec
        • Define-sk
        • Defines
        • Error-value-tuples
        • Defmax-nat
        • Defmin-int
        • Deftutorial
        • Extended-formals
        • Defrule
        • Defval
        • Defsurj
        • Defiso
        • Defconstrained-recognizer
        • Deffixer
        • Defmvtypes
        • Defconsts
        • Defthm-unsigned-byte-p
        • Support
          • Extract-keywords
          • Dumb-string-sublis
          • Raise
          • Look-up-return-vals
          • Logic-mode-p
          • Look-up-wrapper-args
          • Look-up-formals
          • Legal-kwds-p
          • Split-///
          • Keyword-legality
            • Getarg+
            • Var-is-stobj-p
            • Look-up-guard
            • Getarg
            • Cons-listp
            • Tuplep
            • Tuple-listp
            • Ends-with-period-p
          • Defthm-signed-byte-p
          • Defthm-natp
          • Defund-sk
          • Defmacro+
          • Defsum
          • Defthm-commutative
          • Definj
          • Defirrelevant
          • Defredundant
        • Std/strings
        • Std/osets
        • Std/io
        • Std/basic
        • Std/system
        • Std/typed-lists
        • Std/bitsets
        • Std/testing
        • Std/typed-alists
        • Std/stobjs
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Support

    Keyword-legality

    Check whether x is a legal keyword

    Returns :single if x is allowed to occur once in the argument list, :multiple if it is allowed to occur more than once, and NIL if not allowed.

    Definitions and Theorems

    Function: keyword-legality

    (defun keyword-legality (x legals)
      (declare (xargs :guard (and (symbolp x)
                                  (legal-kwds-p legals))))
      (cond ((atom legals) nil)
            ((eq x (car legals)) :single)
            ((and (consp (car legals))
                  (eq x (caar legals)))
             :multiple)
            (t (keyword-legality x (cdr legals)))))