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

    Long-to-double

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

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

    Definitions and Theorems

    Function: long-to-double

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

    Theorem: double-valuep-of-long-to-double

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

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

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

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

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