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

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

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

    Definitions and Theorems

    Function: byte-to-long

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

    Theorem: long-valuep-of-byte-to-long

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

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

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

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

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