• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
        • Atj
        • Aij
        • Language
          • Syntax
            • Grammar
            • Unicode-escapes
            • Unicode-input-char
            • Escape-sequence
            • Identifiers
            • Primitive-types
            • Reference-types
            • Keywords
            • Unicode-characters
              • Unicode
              • Ascii
              • String=>unicode
                • Ascii=>string
                • Ascii-list
                • Unicode-list
              • Integer-literals
              • String-literals
              • Octal-digits
              • Hexadecimal-digits
              • Decimal-digits
              • Binary-digits
              • Character-literals
              • Null-literal
              • Floating-point-literals
              • Boolean-literals
              • Package-names
              • Literals
            • Semantics
        • Taspi
        • Riscv
        • Bitcoin
        • Des
        • Ethereum
        • X86isa
        • Sha-2
        • Yul
        • Zcash
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Poseidon
        • Where-do-i-place-my-book
        • Axe
        • Aleo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Community
      • Proof-automation
      • ACL2
      • Macro-libraries
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Unicode-characters

    String=>unicode

    Convert an ACL2 string to a Java Unicode character list.

    Signature
    (string=>unicode string) → unicode
    Arguments
    string — Guard (stringp string).
    Returns
    unicode — Type (unicode-listp unicode).

    This converts each ACL2 character in the string to a Unicode character whose value is the code of the character. In at last some of the Lisps on which ACL2 runs, strings may include non-ASCII Unicode characters, but ACL2's view of these strings is that of the sequence of ACL2 characters whose codes are the bytes that form the UTF-8 encoding of the string. This is as expected for ASCII, but not necessarily for non-ASCII. We plan to restrict this ACL2 function to operate only on ACL2 strings consisting of ASCII characters.

    See also ascii=>string.

    Definitions and Theorems

    Function: string=>unicode

    (defun string=>unicode (string)
      (declare (xargs :guard (stringp string)))
      (let ((__function__ 'string=>unicode))
        (declare (ignorable __function__))
        (string=>nats string)))

    Theorem: unicode-listp-of-string=>unicode

    (defthm unicode-listp-of-string=>unicode
      (b* ((unicode (string=>unicode string)))
        (unicode-listp unicode))
      :rule-classes :rewrite)

    Theorem: string=>unicode-of-str-fix-string

    (defthm string=>unicode-of-str-fix-string
      (equal (string=>unicode (str-fix string))
             (string=>unicode string)))

    Theorem: string=>unicode-streqv-congruence-on-string

    (defthm string=>unicode-streqv-congruence-on-string
      (implies (acl2::streqv string string-equiv)
               (equal (string=>unicode string)
                      (string=>unicode string-equiv)))
      :rule-classes :congruence)