• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • 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
        • Soft
        • C
        • Bv
        • Imp-language
        • Event-macros
        • Java
        • Bitcoin
        • Ethereum
        • Yul
          • Transformations
          • Language
            • Abstract-syntax
            • Dynamic-semantics
            • Concrete-syntax
            • Static-soundness
            • Static-semantics
              • Static-safety-checking
              • Static-shadowing-checking
              • Mode-set-result
              • Literal-evaluation
                • Eval-literal
                • Eval-hex-string-literal
                • Eval-plain-string-literal
                • Ubyte16-to-utf8
                • Eval-escape
                • Eval-string-element
                • Eval-hex-string-rest-element-list
                • Eval-hex-string-rest-element
                • Eval-hex-string-content
                • Eval-string-element-list
                • Eval-hex-quad
                  • Eval-hex-pair
                • Static-identifier-checking
                • Static-safety-checking-evm
                • Mode-set
                • Modes
              • Errors
            • Yul-json
          • Zcash
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Lists-light
          • Axe
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Literal-evaluation

    Eval-hex-quad

    Evaluate a quadruple of hex digits to a 16-bit unsigned integer.

    Signature
    (eval-hex-quad hq) → val
    Arguments
    hq — Guard (hex-quadp hq).
    Returns
    val — Type (ubyte16p val).

    The digits are interpreted in big endian form.

    Definitions and Theorems

    Function: eval-hex-quad

    (defun eval-hex-quad (hq)
      (declare (xargs :guard (hex-quadp hq)))
      (let ((__function__ 'eval-hex-quad))
        (declare (ignorable __function__))
        (str::hex-digit-chars-value
             (list (hex-digit->get (hex-quad->1st hq))
                   (hex-digit->get (hex-quad->2nd hq))
                   (hex-digit->get (hex-quad->3rd hq))
                   (hex-digit->get (hex-quad->4th hq))))))

    Theorem: ubyte16p-of-eval-hex-quad

    (defthm ubyte16p-of-eval-hex-quad
      (b* ((val (eval-hex-quad hq)))
        (ubyte16p val))
      :rule-classes :rewrite)

    Theorem: eval-hex-quad-of-hex-quad-fix-hq

    (defthm eval-hex-quad-of-hex-quad-fix-hq
      (equal (eval-hex-quad (hex-quad-fix hq))
             (eval-hex-quad hq)))

    Theorem: eval-hex-quad-hex-quad-equiv-congruence-on-hq

    (defthm eval-hex-quad-hex-quad-equiv-congruence-on-hq
      (implies (hex-quad-equiv hq hq-equiv)
               (equal (eval-hex-quad hq)
                      (eval-hex-quad hq-equiv)))
      :rule-classes :congruence)