• 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

    Int-to-double

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

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

    Definitions and Theorems

    Function: int-to-double

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

    Theorem: double-valuep-of-int-to-double

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

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

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

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

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