• 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
      • Taspi
      • Bitcoin
      • Riscv
      • Des
      • Ethereum
      • X86isa
      • Sha-2
      • 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
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Poseidon
        • Where-do-i-place-my-book
        • Axe
        • Bigmems
        • Builtins
        • Execloader
        • Aleo
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • 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)