• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • 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
        • Time$
        • Defconst
        • Fast-alists
        • Defmacro
        • Loop$-primer
        • 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
          • Std/strings
          • String-listp
          • Stringp
          • Length
          • Search
          • Remove-duplicates
          • Position
          • Coerce
          • Concatenate
          • Reverse
          • String
          • Subseq
          • Substitute
          • String-upcase
          • String-downcase
          • Count
          • Char
          • String<
          • String-equal
          • String-utilities
            • Code-char-injectivity-theorem
            • 8bitbytes-hexchars-conversions
            • Code-char-inverses-theorems
            • String-kinds
            • String-codelist-conversions
              • String=>nats
              • Nats=>string
                • Nats<=>string-inverses-theorems
            • Charlist-codelist-conversions
            • 8bitbytes-hexstrings-conversions
          • String-append
          • String>=
          • String<=
          • String>
          • Hex-digit-char-theorems
          • String-downcase-gen
          • String-upcase-gen
        • 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
      • Miscellaneous
      • Output-controls
      • Bdd
      • Macros
      • Installation
      • Mailing-lists
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
    • Math
    • Testing-utilities
  • String-codelist-conversions

Nats=>string

Convert a true list of natural numbers below 256 to the corresponding string.

Signature
(nats=>string nats) → string
Arguments
nats — Guard (unsigned-byte-listp 8 nats).
Returns
string — Type (stringp string).

Definitions and Theorems

Function: nats=>string

(defun nats=>string (nats)
  (declare (xargs :guard (unsigned-byte-listp 8 nats)))
  (let ((__function__ 'nats=>string))
    (declare (ignorable __function__))
    (implode (nats=>chars nats))))

Theorem: stringp-of-nats=>string

(defthm stringp-of-nats=>string
  (b* ((string (nats=>string nats)))
    (stringp string))
  :rule-classes :rewrite)

Theorem: nth-of-explode-of-nats=>string

(defthm nth-of-explode-of-nats=>string
  (equal (nth i (explode (nats=>string nats)))
         (if (< (nfix i) (len nats))
             (code-char (nth i nats))
           nil)))

Theorem: len-of-explode-of-nats=>string

(defthm len-of-explode-of-nats=>string
  (equal (len (explode (nats=>string nats)))
         (len nats)))

Theorem: explode-of-nats=>string

(defthm explode-of-nats=>string
  (equal (explode (nats=>string nats))
         (nats=>chars nats)))

Subtopics

Nats<=>string-inverses-theorems
nats=>string and string=>nats are mutual inverses.