• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Debugging
    • Projects
    • 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
        • Defpkg
        • Apply$
        • Mutual-recursion
        • Loop$
        • Programming-with-state
        • Arrays
        • Characters
          • Character-listp
          • Characterp
          • Coerce
          • Standard-char-p
          • Digit-char-p
          • Code-char
          • Char-code
          • Char-downcase
            • Downcase-char
          • Char
          • Char-upcase
          • Explode-nonnegative-integer
          • Explode-atom
          • Upper-case-p
          • Lower-case-p
          • Char-equal
          • Alpha-char-p
          • Digit-to-char
          • Char<
          • Char>=
          • Make-character-list
          • Char>
          • Char<=
          • Standard-char-listp
          • Character-alistp
          • Standard-char-p+
          • Chars-upcase-gen
          • Chars-downcase-gen
          • Char-upcase-gen
          • Char-downcase-gen
        • 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
        • 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
  • Characters
  • ACL2-built-ins

Char-downcase

Turn upper-case characters into lower-case characters

(Char-downcase x) is equal to #\a when x is #\A, #\b when x is #\B, ..., and #\z when x is #\Z, and is x for any other character.

The guard for char-downcase requires its argument to be a standard character (see standard-char-p).

Char-downcase is a Common Lisp function. See any Common Lisp documentation for more information.

Function: char-downcase

(defun char-downcase (x)
       (declare (xargs :guard (and (characterp x)
                                   (standard-char-p x))))
       (let ((pair (assoc x
                          '((#\A . #\a)
                            (#\B . #\b)
                            (#\C . #\c)
                            (#\D . #\d)
                            (#\E . #\e)
                            (#\F . #\f)
                            (#\G . #\g)
                            (#\H . #\h)
                            (#\I . #\i)
                            (#\J . #\j)
                            (#\K . #\k)
                            (#\L . #\l)
                            (#\M . #\m)
                            (#\N . #\n)
                            (#\O . #\o)
                            (#\P . #\p)
                            (#\Q . #\q)
                            (#\R . #\r)
                            (#\S . #\s)
                            (#\T . #\t)
                            (#\U . #\u)
                            (#\V . #\v)
                            (#\W . #\w)
                            (#\X . #\x)
                            (#\Y . #\y)
                            (#\Z . #\z)))))
            (cond (pair (cdr pair))
                  ((characterp x) x)
                  (t (code-char 0)))))

Subtopics

Downcase-char
Convert a character to lower-case.