• 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

    Char-to-float

    Widening conversion from char to float [JLS14:5.1.2].

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

    Definitions and Theorems

    Function: char-to-float

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

    Theorem: float-valuep-of-char-to-float

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

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

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

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

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