• 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
                • Short-to-char
                • Short-to-byte
                • Long-to-short
                • Float-to-short
                • Float-to-long
                • Float-to-char
                • Float-to-byte
                • Double-to-short
                • Double-to-long
                • Double-to-int
                • Double-to-float
                • Double-to-char
                  • Double-to-byte
                  • Char-to-short
                  • Long-to-int
                  • Long-to-char
                  • Long-to-byte
                  • Int-to-short
                  • Int-to-char
                  • Int-to-byte
                  • Float-to-int
                  • Char-to-byte
                • Primitive-widening-conversions
                • 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-narrowing-conversions

    Double-to-char

    Narrowing conversion from double to char [JLS14:5.1.3].

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

    Definitions and Theorems

    Function: double-to-char

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

    Theorem: char-valuep-of-double-to-char

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

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

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

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

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