• 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-pair

    Evaluate a pair of hex digits to a byte.

    Signature
    (eval-hex-pair hp) → val
    Arguments
    hp — Guard (hex-pairp hp).
    Returns
    val — Type (ubyte8p val).

    The digits are interpreted in big endian form.

    Definitions and Theorems

    Function: eval-hex-pair

    (defun eval-hex-pair (hp)
      (declare (xargs :guard (hex-pairp hp)))
      (let ((__function__ 'eval-hex-pair))
        (declare (ignorable __function__))
        (str::hex-digit-chars-value
             (list (hex-digit->get (hex-pair->1st hp))
                   (hex-digit->get (hex-pair->2nd hp))))))

    Theorem: ubyte8p-of-eval-hex-pair

    (defthm ubyte8p-of-eval-hex-pair
      (b* ((val (eval-hex-pair hp)))
        (ubyte8p val))
      :rule-classes :rewrite)

    Theorem: eval-hex-pair-of-hex-pair-fix-hp

    (defthm eval-hex-pair-of-hex-pair-fix-hp
      (equal (eval-hex-pair (hex-pair-fix hp))
             (eval-hex-pair hp)))

    Theorem: eval-hex-pair-hex-pair-equiv-congruence-on-hp

    (defthm eval-hex-pair-hex-pair-equiv-congruence-on-hp
      (implies (hex-pair-equiv hp hp-equiv)
               (equal (eval-hex-pair hp)
                      (eval-hex-pair hp-equiv)))
      :rule-classes :congruence)