• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
      • Theories
      • Rule-classes
      • Proof-builder
      • Recursion-and-induction
      • Hons-and-memoization
      • Events
      • Parallelism
      • History
      • Programming
      • Operational-semantics
      • Real
      • Start-here
      • Debugging
      • Miscellaneous
      • Output-controls
      • Macros
      • Interfacing-tools
        • Io
        • Defttag
        • Sys-call
        • Save-exec
        • Quicklisp
        • Std/io
        • Oslib
        • Bridge
        • Clex
          • Example-lexer
            • Token-p
            • Lex-punctuation
            • Lex-id/keyword
            • Lex-string
            • Lex-whitespace
            • Lex-comment
            • Lex1
            • Lex-main
            • Lex*
            • Tokenlist-p
            • Letter-char-p
              • Letter-charlist-p
              • Letter-chars
            • Idtail-char-p
            • Whitespace-char-p
            • Number-char-p
            • Tokentype-p
            • Lex*-exec
            • Newline-string
          • Sin
          • Matching-functions
          • Def-sin-progress
        • Tshell
        • Unsound-eval
        • Hacker
        • ACL2s-interface
        • Startup-banner
        • Command-line
    • Interfacing-tools
      • Io
      • Defttag
      • Sys-call
      • Save-exec
      • Quicklisp
      • Std/io
      • Oslib
      • Bridge
      • Clex
        • Example-lexer
          • Token-p
          • Lex-punctuation
          • Lex-id/keyword
          • Lex-string
          • Lex-whitespace
          • Lex-comment
          • Lex1
          • Lex-main
          • Lex*
          • Tokenlist-p
          • Letter-char-p
            • Letter-charlist-p
            • Letter-chars
          • Idtail-char-p
          • Whitespace-char-p
          • Number-char-p
          • Tokentype-p
          • Lex*-exec
          • Newline-string
        • Sin
        • Matching-functions
        • Def-sin-progress
      • Tshell
      • Unsound-eval
      • Hacker
      • ACL2s-interface
      • Startup-banner
      • Command-line
    • Hardware-verification
    • Software-verification
    • Math
    • Testing-utilities
  • Example-lexer

Letter-char-p

Recognize upper- and lower-case letters.

Definitions and Theorems

Function: letter-char-p

(defun letter-char-p (x)
  (declare (xargs :guard t))
  (and (characterp x)
       (let ((code (char-code x)))
         (or (and (<= (char-code #\a) code)
                  (<= code (char-code #\z)))
             (and (<= (char-code #\A) code)
                  (<= code (char-code #\Z)))))))

Theorem: booleanp-of-letter-char-p

(defthm booleanp-of-letter-char-p
  (booleanp (letter-char-p x))
  :rule-classes :type-prescription)

Theorem: characterp-when-letter-char-p

(defthm characterp-when-letter-char-p
  (implies (letter-char-p x)
           (characterp x))
  :rule-classes :compound-recognizer)

Subtopics

Letter-charlist-p
(letter-charlist-p x) recognizes lists where every element satisfies letter-char-p.
Letter-chars
A character set for letter-char-p.