• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • C
        • Soft
        • Bv
        • Imp-language
        • Ethereum
        • Event-macros
        • Java
        • Riscv
        • Bitcoin
        • Zcash
        • Yul
          • Transformations
          • Language
            • Abstract-syntax
              • Escape
              • Swcase-list->value-list
              • Hex-digit-list->chars
                • Fundef-list->name-list
                • Literal
                • Path
                • Hex-string-rest-element
                • Plain-string
                • String-element
                • Hex-string-content-option
                • Hex-string-content
                • Identifier
                • Funcall-option
                • Expression-option
                • Statement-option
                • Literal-option
                • Identifier-option
                • Hex-string
                • Hex-quad
                • Hex-digit
                • Hex-pair
                • Data-value
                • Data-item
                • Statements-to-fundefs
                • String-element-list-result
                • Identifier-identifier-map-result
                • Swcase-result
                • String-element-result
                • Statement-result
                • Literal-result
                • Identifier-set-result
                • Identifier-result
                • Identifier-list-result
                • Fundef-result
                • Funcall-result
                • Expression-result
                • Escape-result
                • Path-result
                • Block-result
                • Objects
                • Statements/blocks/cases/fundefs
                • Identifier-list
                • Identifier-set
                • Identifier-identifier-map
                • Identifier-identifier-alist
                • Hex-string-rest-element-list
                • String-element-list
                • Path-list
                • Hex-digit-list
                • Literal-list
                • Fundef-list
                • Expressions/funcalls
                • Abstract-syntax-induction-schemas
              • Dynamic-semantics
              • Concrete-syntax
              • Static-soundness
              • Static-semantics
              • Errors
            • Yul-json
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Axe
          • Lists-light
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Abstract-syntax

    Hex-digit-list->chars

    Extract the characters from a list of hex digits.

    Signature
    (hex-digit-list->chars x) → chars
    Arguments
    x — Guard (hex-digit-listp x).
    Returns
    chars — Type (str::hex-digit-char-list*p chars).

    This is an ordinary std::defprojection.

    Definitions and Theorems

    Function: hex-digit-list->chars-exec

    (defun hex-digit-list->chars-exec (x acc)
     (declare (xargs :guard (hex-digit-listp x)))
     (declare (xargs :guard t))
     (let ((__function__ 'hex-digit-list->chars-exec))
       (declare (ignorable __function__))
       (if
        (consp x)
        (hex-digit-list->chars-exec (cdr x)
                                    (cons (hex-digit->get (car x)) acc))
        acc)))

    Function: hex-digit-list->chars-nrev

    (defun hex-digit-list->chars-nrev (x acl2::nrev)
      (declare (xargs :stobjs (acl2::nrev)))
      (declare (xargs :guard (hex-digit-listp x)))
      (declare (xargs :guard t))
      (let ((__function__ 'hex-digit-list->chars-nrev))
        (declare (ignorable __function__))
        (if (atom x)
            (acl2::nrev-fix acl2::nrev)
          (let ((acl2::nrev (acl2::nrev-push (hex-digit->get (car x))
                                             acl2::nrev)))
            (hex-digit-list->chars-nrev (cdr x)
                                        acl2::nrev)))))

    Function: hex-digit-list->chars

    (defun hex-digit-list->chars (x)
      (declare (xargs :guard (hex-digit-listp x)))
      (declare (xargs :guard t))
      (let ((__function__ 'hex-digit-list->chars))
        (declare (ignorable __function__))
        (mbe :logic
             (if (consp x)
                 (cons (hex-digit->get (car x))
                       (hex-digit-list->chars (cdr x)))
               nil)
             :exec
             (if (atom x)
                 nil
               (acl2::with-local-nrev
                    (hex-digit-list->chars-nrev x acl2::nrev))))))

    Theorem: hex-digit-char-list*p-of-hex-digit-list->chars

    (defthm hex-digit-char-list*p-of-hex-digit-list->chars
      (b* ((chars (hex-digit-list->chars x)))
        (str::hex-digit-char-list*p chars))
      :rule-classes :rewrite)

    Theorem: hex-digit-list->chars-nrev-removal

    (defthm hex-digit-list->chars-nrev-removal
      (equal (hex-digit-list->chars-nrev acl2::x acl2::nrev)
             (append acl2::nrev
                     (hex-digit-list->chars acl2::x)))
      :rule-classes ((:rewrite)))

    Theorem: hex-digit-list->chars-exec-removal

    (defthm hex-digit-list->chars-exec-removal
      (equal (hex-digit-list->chars-exec acl2::x acl2::acc)
             (revappend (hex-digit-list->chars acl2::x)
                        acl2::acc))
      :rule-classes ((:rewrite)))

    Theorem: hex-digit-list->chars-of-take

    (defthm hex-digit-list->chars-of-take
      (implies (<= (nfix acl2::n) (len acl2::x))
               (equal (hex-digit-list->chars (take acl2::n acl2::x))
                      (take acl2::n
                            (hex-digit-list->chars acl2::x))))
      :rule-classes ((:rewrite)))

    Theorem: set-equiv-congruence-over-hex-digit-list->chars

    (defthm set-equiv-congruence-over-hex-digit-list->chars
      (implies (set-equiv acl2::x acl2::y)
               (set-equiv (hex-digit-list->chars acl2::x)
                          (hex-digit-list->chars acl2::y)))
      :rule-classes ((:congruence)))

    Theorem: subsetp-of-hex-digit-list->chars-when-subsetp

    (defthm subsetp-of-hex-digit-list->chars-when-subsetp
      (implies (subsetp acl2::x acl2::y)
               (subsetp (hex-digit-list->chars acl2::x)
                        (hex-digit-list->chars acl2::y)))
      :rule-classes ((:rewrite)))

    Theorem: member-of-hex-digit->get-in-hex-digit-list->chars

    (defthm member-of-hex-digit->get-in-hex-digit-list->chars
      (implies (member acl2::k acl2::x)
               (member (hex-digit->get acl2::k)
                       (hex-digit-list->chars acl2::x)))
      :rule-classes ((:rewrite)))

    Theorem: hex-digit-list->chars-of-rev

    (defthm hex-digit-list->chars-of-rev
      (equal (hex-digit-list->chars (rev acl2::x))
             (rev (hex-digit-list->chars acl2::x)))
      :rule-classes ((:rewrite)))

    Theorem: hex-digit-list->chars-of-list-fix

    (defthm hex-digit-list->chars-of-list-fix
      (equal (hex-digit-list->chars (list-fix acl2::x))
             (hex-digit-list->chars acl2::x))
      :rule-classes ((:rewrite)))

    Theorem: hex-digit-list->chars-of-append

    (defthm hex-digit-list->chars-of-append
      (equal (hex-digit-list->chars (append acl2::a acl2::b))
             (append (hex-digit-list->chars acl2::a)
                     (hex-digit-list->chars acl2::b)))
      :rule-classes ((:rewrite)))

    Theorem: cdr-of-hex-digit-list->chars

    (defthm cdr-of-hex-digit-list->chars
      (equal (cdr (hex-digit-list->chars acl2::x))
             (hex-digit-list->chars (cdr acl2::x)))
      :rule-classes ((:rewrite)))

    Theorem: car-of-hex-digit-list->chars

    (defthm car-of-hex-digit-list->chars
      (equal (car (hex-digit-list->chars acl2::x))
             (and (consp acl2::x)
                  (hex-digit->get (car acl2::x))))
      :rule-classes ((:rewrite)))

    Theorem: hex-digit-list->chars-under-iff

    (defthm hex-digit-list->chars-under-iff
      (iff (hex-digit-list->chars acl2::x)
           (consp acl2::x))
      :rule-classes ((:rewrite)))

    Theorem: consp-of-hex-digit-list->chars

    (defthm consp-of-hex-digit-list->chars
      (equal (consp (hex-digit-list->chars acl2::x))
             (consp acl2::x))
      :rule-classes ((:rewrite)))

    Theorem: len-of-hex-digit-list->chars

    (defthm len-of-hex-digit-list->chars
      (equal (len (hex-digit-list->chars acl2::x))
             (len acl2::x))
      :rule-classes ((:rewrite)))

    Theorem: true-listp-of-hex-digit-list->chars

    (defthm true-listp-of-hex-digit-list->chars
      (true-listp (hex-digit-list->chars acl2::x))
      :rule-classes :type-prescription)

    Theorem: hex-digit-list->chars-when-not-consp

    (defthm hex-digit-list->chars-when-not-consp
      (implies (not (consp acl2::x))
               (equal (hex-digit-list->chars acl2::x)
                      nil))
      :rule-classes ((:rewrite)))

    Theorem: hex-digit-list->chars-of-cons

    (defthm hex-digit-list->chars-of-cons
      (equal (hex-digit-list->chars (cons acl2::a acl2::b))
             (cons (hex-digit->get acl2::a)
                   (hex-digit-list->chars acl2::b)))
      :rule-classes ((:rewrite)))

    Theorem: hex-digit-list->chars-of-hex-digit-list-fix-x

    (defthm hex-digit-list->chars-of-hex-digit-list-fix-x
      (equal (hex-digit-list->chars (hex-digit-list-fix x))
             (hex-digit-list->chars x)))

    Theorem: hex-digit-list->chars-hex-digit-list-equiv-congruence-on-x

    (defthm hex-digit-list->chars-hex-digit-list-equiv-congruence-on-x
      (implies (hex-digit-list-equiv x x-equiv)
               (equal (hex-digit-list->chars x)
                      (hex-digit-list->chars x-equiv)))
      :rule-classes :congruence)