• 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-pointx-value
                • Doublex-value-fns
                • Primitivex-value
                • Floatx-value-fns
                  • Floatx-valuep
                  • Floatx-value->floatx
                  • Floatx-value-fix
                  • Floatx-value
                • Primitive-value
                • Numericx-value
                • Numeric-value
                • Integral-value
                • Int-value
                • Char-value
                • Byte-value
                • Short-value
                • Long-value
                • Float-value
                • Double-value
                • Boolean-value
                • Floating-point-value
                • Disjoint-primitive-values
                • Short-value-list
                • Long-value-list
                • Int-value-list
                • Float-value-list
                • Double-value-list
                • Char-value-list
                • Byte-value-list
                • Boolean-value-list
              • Floating-point-placeholders
              • Pointers
              • Floating-point-value-set-parameters
              • Values
              • Primitive-operations
              • Primitive-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-values

Floatx-value-fns

Recognizer, fixer, constructor, and destructor of Java float values in the float-extended-exponent value set [JLS.4.2.3].

We define the recognizer analogously to the one of the fixtypes of other Java primitive values, by tagging the underlying values introduced in floatx-value-abs. The recognizer is non-empty if and only if floatx-param is non-nil. We define a conditional fixer, but we cannot define a fixtype because the recognizer may be empty. We also define a conditional constructor and a conditional destructor, analogous to the ones of the fixtypes of other Java primitive values.

Definitions and Theorems

Function: floatx-valuep

(defun floatx-valuep (x)
  (declare (xargs :guard t))
  (let ((__function__ 'floatx-valuep))
    (declare (ignorable __function__))
    (and (tuplep 2 x)
         (eq (first x) :floatx)
         (floatx-value-abs-p (second x)))))

Theorem: booleanp-of-floatx-valuep

(defthm booleanp-of-floatx-valuep
  (b* ((yes/no (floatx-valuep x)))
    (booleanp yes/no))
  :rule-classes :rewrite)

Theorem: no-floatx-value-when-unsupported

(defthm no-floatx-value-when-unsupported
  (implies (not (floatx-param))
           (not (floatx-valuep x))))

Function: floatx-value-fix

(defun floatx-value-fix (x)
  (declare (xargs :guard (floatx-valuep x)))
  (let ((__function__ 'floatx-value-fix))
    (declare (ignorable __function__))
    (mbe :logic
         (if (floatx-valuep x)
             x
           (list :floatx (floatx-value-abs-pos-zero)))
         :exec x)))

Theorem: floatx-valuep-of-floatx-value-fix

(defthm floatx-valuep-of-floatx-value-fix
  (implies (floatx-param)
           (b* ((fixed-x (floatx-value-fix x)))
             (floatx-valuep fixed-x)))
  :rule-classes :rewrite)

Theorem: floatx-value-fix-when-floatx-valuep

(defthm floatx-value-fix-when-floatx-valuep
  (implies (floatx-valuep x)
           (equal (floatx-value-fix x) x)))

Function: floatx-value

(defun floatx-value (x)
  (declare (xargs :guard (floatx-value-abs-p x)))
  (let ((__function__ 'floatx-value))
    (declare (ignorable __function__))
    (list :floatx (floatx-value-abs-fix x))))

Theorem: floatx-valuep-of-floatx-value

(defthm floatx-valuep-of-floatx-value
  (implies (floatx-param)
           (b* ((value (floatx-value x)))
             (floatx-valuep value)))
  :rule-classes :rewrite)

Function: floatx-value->floatx

(defun floatx-value->floatx (value)
  (declare (xargs :guard (floatx-valuep value)))
  (let ((__function__ 'floatx-value->floatx))
    (declare (ignorable __function__))
    (second (floatx-value-fix value))))

Theorem: floatx-value-abs-p-of-floatx-value->floatx

(defthm floatx-value-abs-p-of-floatx-value->floatx
  (implies (floatx-param)
           (b* ((x (floatx-value->floatx value)))
             (floatx-value-abs-p x)))
  :rule-classes :rewrite)

Theorem: floatx-value->floatx-of-floatx-value

(defthm floatx-value->floatx-of-floatx-value
  (implies (floatx-param)
           (equal (floatx-value->floatx (floatx-value x))
                  (floatx-value-abs-fix x))))

Subtopics

Floatx-valuep
Recognizer of Java float values in the float-extended-exponent value set.
Floatx-value->floatx
Destructor of Java float values in the float-extended-exponent value set.
Floatx-value-fix
Fixer of Java float values in the float-extended-exponent value set.
Floatx-value
Constructor of Java float values in the float-extended-exponent value set.