• 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
                  • Doublex-valuep
                  • Doublex-value->doublex
                  • Doublex-value-fix
                  • Doublex-value
                • Primitivex-value
                • Floatx-value-fns
                • 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

Doublex-value-fns

Recognizer, fixer, constructor, and destructor of Java double values in the double-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 doublex-value-abs. The recognizer is non-empty if and only if doublex-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: doublex-valuep

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

Theorem: booleanp-of-doublex-valuep

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

Theorem: no-doublex-value-when-unsupported

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

Function: doublex-value-fix

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

Theorem: doublex-valuep-of-doublex-value-fix

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

Theorem: doublex-value-fix-when-doublex-valuep

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

Function: doublex-value

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

Theorem: doublex-valuep-of-doublex-value

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

Function: doublex-value->doublex

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

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

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

Theorem: doublex-value->doublex-of-doublex-value

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

Subtopics

Doublex-valuep
Recognizer of Java double values in the double-extended-exponent value set.
Doublex-value->doublex
Destructor of Java double values in the double-extended-exponent value set.
Doublex-value-fix
Fixer of Java double values in the double-extended-exponent value set.
Doublex-value
Constructor of Java double values in the double-extended-exponent value set.