• 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
        • Defun
        • Declare
        • System-utilities
        • Stobj
        • State
        • Mutual-recursion
        • Memoize
        • Mbe
        • Io
        • Defpkg
        • Apply$
        • Loop$
        • Programming-with-state
        • Arrays
        • Characters
          • Character-listp
          • Characterp
          • Coerce
          • Digit-char-p
          • Code-char
          • Char-code
          • Char-upcase
          • Char-downcase
            • Downcase-char
          • Standard-char-p
          • Char
          • Alpha-char-p
          • Upper-case-p
          • Lower-case-p
          • Explode-nonnegative-integer
          • Explode-atom
          • Char-equal
          • 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$
        • Defmacro
        • Loop$-primer
        • Fast-alists
        • Defconst
        • Evaluation
        • Guard
        • Equality-variants
        • Compilation
        • Hons
        • ACL2-built-ins
        • Developers-guide
        • System-attachments
        • Advanced-features
        • Set-check-invariant-risk
        • Numbers
        • Efficiency
        • Irrelevant-formals
        • 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
        • Oracle-eval
        • Defmacro-untouchable
        • <<
        • Primitive
        • Revert-world
        • Unmemoize
        • Set-duplicate-keys-action
        • Symbols
        • Def-list-constructor
        • Easy-simplify-term
        • Defiteration
        • Fake-oracle-eval
        • Defopen
        • Sleep
      • Operational-semantics
      • Real
      • Start-here
      • Debugging
      • Miscellaneous
      • Output-controls
      • Macros
      • Interfacing-tools
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
    • Math
    • Testing-utilities
  • 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 states that its argument is a character.

Char-downcase is a Common Lisp function. See any Common Lisp documentation for more information. Note that the value returned may depend on the host Lisp; see soundness, specifically Example 1 in the Section, “Examples of divergence among Lisp implementations”.

Function: char-downcase

(defun char-downcase (x)
  (declare (xargs :guard (characterp x)))
  (cond ((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)) (t x))))
        (t (char-downcase-non-standard x))))

Subtopics

Downcase-char
Convert a character to lower-case.