• 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
          • Atj
          • Aij
          • Language
            • Syntax
            • Semantics
              • Primitive-function-macros
              • Primitive-values
              • Floating-point-placeholders
              • Pointers
              • Floating-point-value-set-parameters
              • Values
              • Primitive-operations
              • Primitive-conversions
                • Primitive-narrowing-conversions
                • Primitive-widening-conversions
                  • Short-to-long
                  • Short-to-float
                  • Short-to-double
                  • Long-to-float
                  • Long-to-double
                  • Int-to-double
                  • Float-to-double
                  • Char-to-float
                  • Char-to-double
                  • Byte-to-float
                  • Byte-to-double
                  • Short-to-int
                  • Int-to-long
                  • Int-to-float
                  • Char-to-long
                  • Char-to-int
                  • Byte-to-short
                  • Byte-to-long
                  • Byte-to-int
                  • Primitive-widening-narrowing-conversions
                • Reference-values
          • Bitcoin
          • Ethereum
          • Yul
          • 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
    • Primitive-widening-conversions

    Byte-to-int

    Widening conversion from byte to int [JLS14:5.1.2].

    Signature
    (byte-to-int operand) → result
    Arguments
    operand — Guard (byte-valuep operand).
    Returns
    result — Type (int-valuep result).

    Definitions and Theorems

    Function: byte-to-int

    (defun byte-to-int (operand)
      (declare (xargs :guard (byte-valuep operand)))
      (b* ((x (byte-value->int operand)))
        (int-value x)))

    Theorem: int-valuep-of-byte-to-int

    (defthm int-valuep-of-byte-to-int
      (b* ((result (byte-to-int operand)))
        (int-valuep result))
      :rule-classes :rewrite)

    Theorem: byte-to-int-of-byte-value-fix-operand

    (defthm byte-to-int-of-byte-value-fix-operand
      (equal (byte-to-int (byte-value-fix operand))
             (byte-to-int operand)))

    Theorem: byte-to-int-byte-value-equiv-congruence-on-operand

    (defthm byte-to-int-byte-value-equiv-congruence-on-operand
      (implies (byte-value-equiv operand operand-equiv)
               (equal (byte-to-int operand)
                      (byte-to-int operand-equiv)))
      :rule-classes :congruence)