• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
      • Std/lists
      • Std/alists
      • Obags
      • Std/util
      • Std/strings
        • Pretty-printing
        • Printtree
        • Base64
        • Charset-p
        • Strtok!
        • Cases
          • Icharlisteqv
          • Upcase-charlist
          • Downcase-charlist
          • Upcase-string
          • Istreqv
          • Downcase-char
          • Upcase-char
          • Ichareqv
          • Downcase-string
          • Upcase-first-charlist
          • Downcase-first-charlist
          • Downcase-first
          • Upcase-first
          • Down-alpha-p
            • Up-alpha-p
            • Upcase-char-str
            • Downcase-char-str
            • Upcase-string-list
            • Downcase-string-list
          • Concatenation
          • Html-encoding
          • Character-kinds
          • Substrings
          • Strtok
          • Equivalences
          • Url-encoding
          • Lines
          • Explode-implode-equalities
          • Ordering
          • Numbers
          • Pad-trim
          • Coercion
          • Std/strings/digit-to-char
          • Substitution
          • Symbols
        • 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
    • Cases
    • Lower-case-p

    Down-alpha-p

    Determine if a character is a lower-case letter (a-z).

    Signature
    (down-alpha-p x) → bool

    ACL2 has a built-in alternative to this function, common-lisp::lower-case-p, which however can also recognize characters that are not standard characters. (Historical note: Before May 2024, the guard for acl2::lower-case-p required standard-char-p yet also converted only standard characters; this provided motivation for the development of down-alpha-p.)

    Definitions and Theorems

    Function: down-alpha-p$inline

    (defun down-alpha-p$inline (x)
      (declare (type character x))
      (let ((acl2::__function__ 'down-alpha-p))
        (declare (ignorable acl2::__function__))
        (b* (((the (unsigned-byte 8) code)
              (char-code x)))
          (and (<= (little-a) code)
               (<= code (little-z))))))

    Theorem: chareqv-implies-equal-down-alpha-p-1

    (defthm chareqv-implies-equal-down-alpha-p-1
      (implies (chareqv x x-equiv)
               (equal (down-alpha-p x)
                      (down-alpha-p x-equiv)))
      :rule-classes (:congruence))

    Theorem: lower-case-p-is-down-alpha-p

    (defthm lower-case-p-is-down-alpha-p
      (implies (standard-char-p x)
               (equal (common-lisp::lower-case-p x)
                      (down-alpha-p (double-rewrite x)))))

    Theorem: down-alpha-p-when-up-alpha-p

    (defthm down-alpha-p-when-up-alpha-p
      (implies (up-alpha-p x)
               (not (down-alpha-p x))))