• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
      • Theories
      • Rule-classes
      • Proof-builder
      • Hons-and-memoization
      • Events
      • History
      • Parallelism
      • Programming
        • Defun
        • Declare
        • System-utilities
        • Stobj
        • State
        • Memoize
        • Mbe
        • Io
        • Apply$
        • Defpkg
        • Mutual-recursion
        • Loop$
        • Programming-with-state
        • Arrays
        • Characters
        • Time$
        • Loop$-primer
        • Fast-alists
        • Defmacro
        • Defconst
        • Evaluation
        • Guard
        • Equality-variants
        • Compilation
        • Hons
        • ACL2-built-ins
        • Developers-guide
        • System-attachments
        • Advanced-features
        • Set-check-invariant-risk
        • Numbers
        • Irrelevant-formals
        • Efficiency
        • 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
        • Defmacro-untouchable
        • Primitive
        • <<
        • Revert-world
        • Set-duplicate-keys-action
        • Unmemoize
        • Symbols
          • Symbol-listp
          • Symbolp
          • Symbol-name
          • Symbol-package-name
          • Keywordp
            • Keyword-value-listp
            • Keyword-listp
          • Add-to-set
          • Symbol<
          • Packn
          • Packn-pos
          • Symbol-name-lst
        • Def-list-constructor
        • Easy-simplify-term
        • Defiteration
        • Defopen
        • Sleep
      • Start-here
      • Real
      • Debugging
      • Miscellaneous
      • Output-controls
      • Macros
      • Interfacing-tools
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
    • Testing-utilities
    • Math
  • Symbols
  • ACL2-built-ins

Keywordp

Recognizer for keywords

(Keywordp x) is true if and only if x is a keyword, i.e., a symbol in the "KEYWORD" package. Such symbols are typically printed using a colon (:) followed by the symbol-name of the symbol.

Keywordp has a guard of t.

Keywordp is a Common Lisp function. See any Common Lisp documentation for more information. The following log may be illuminating.

ACL2 !>(intern "ABC" "KEYWORD")
:ABC
ACL2 !>(symbol-name ':ABC)
"ABC"
ACL2 !>(symbol-package-name ':ABC)
"KEYWORD"
ACL2 !>

Function: keywordp

(defun keywordp (x)
       (declare (xargs :guard t))
       (and (symbolp x)
            (equal (symbol-package-name x)
                   "KEYWORD")))

Subtopics

Keyword-value-listp
Recognizer for true lists whose even-position elements are keywords
Keyword-listp
Recognizer for true lists of keywords