• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • 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
        • C
        • Soft
        • Bv
        • Imp-language
        • Ethereum
        • Event-macros
        • Java
          • Atj
          • Aij
          • Language
            • Syntax
            • Semantics
              • Primitive-function-macros
              • Primitive-values
                • Floating-pointx-value
                • Doublex-value-fns
                • 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
                  • Floating-point-value-fix
                    • Floating-point-value-equiv
                    • Floating-point-value-float
                    • Floating-point-value-double
                    • Floating-point-valuep
                    • Floating-point-value-kind
                  • 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
          • Riscv
          • Bitcoin
          • Zcash
          • Yul
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Axe
          • Lists-light
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Floating-point-value

    Floating-point-value-fix

    Fixing function for floating-point-value structures.

    Signature
    (floating-point-value-fix acl2::x) → new-x
    Arguments
    acl2::x — Guard (floating-point-valuep acl2::x).
    Returns
    new-x — Type (floating-point-valuep new-x).

    Definitions and Theorems

    Function: floating-point-value-fix$inline

    (defun floating-point-value-fix$inline (acl2::x)
      (declare (xargs :guard (floating-point-valuep acl2::x)))
      (let ((__function__ 'floating-point-value-fix))
        (declare (ignorable __function__))
        (mbe :logic
             (case (floating-point-value-kind acl2::x)
               (:float (b* ((get (float-value-fix acl2::x)))
                         get))
               (:double (b* ((get (double-value-fix acl2::x)))
                          get)))
             :exec acl2::x)))

    Theorem: floating-point-valuep-of-floating-point-value-fix

    (defthm floating-point-valuep-of-floating-point-value-fix
      (b* ((new-x (floating-point-value-fix$inline acl2::x)))
        (floating-point-valuep new-x))
      :rule-classes :rewrite)

    Theorem: floating-point-value-fix-when-floating-point-valuep

    (defthm floating-point-value-fix-when-floating-point-valuep
      (implies (floating-point-valuep acl2::x)
               (equal (floating-point-value-fix acl2::x)
                      acl2::x)))

    Function: floating-point-value-equiv$inline

    (defun floating-point-value-equiv$inline (acl2::x acl2::y)
      (declare (xargs :guard (and (floating-point-valuep acl2::x)
                                  (floating-point-valuep acl2::y))))
      (equal (floating-point-value-fix acl2::x)
             (floating-point-value-fix acl2::y)))

    Theorem: floating-point-value-equiv-is-an-equivalence

    (defthm floating-point-value-equiv-is-an-equivalence
      (and (booleanp (floating-point-value-equiv x y))
           (floating-point-value-equiv x x)
           (implies (floating-point-value-equiv x y)
                    (floating-point-value-equiv y x))
           (implies (and (floating-point-value-equiv x y)
                         (floating-point-value-equiv y z))
                    (floating-point-value-equiv x z)))
      :rule-classes (:equivalence))

    Theorem: floating-point-value-equiv-implies-equal-floating-point-value-fix-1

    (defthm
     floating-point-value-equiv-implies-equal-floating-point-value-fix-1
     (implies (floating-point-value-equiv acl2::x x-equiv)
              (equal (floating-point-value-fix acl2::x)
                     (floating-point-value-fix x-equiv)))
     :rule-classes (:congruence))

    Theorem: floating-point-value-fix-under-floating-point-value-equiv

    (defthm floating-point-value-fix-under-floating-point-value-equiv
      (floating-point-value-equiv (floating-point-value-fix acl2::x)
                                  acl2::x)
      :rule-classes (:rewrite :rewrite-quoted-constant))

    Theorem: equal-of-floating-point-value-fix-1-forward-to-floating-point-value-equiv

    (defthm
     equal-of-floating-point-value-fix-1-forward-to-floating-point-value-equiv
     (implies (equal (floating-point-value-fix acl2::x)
                     acl2::y)
              (floating-point-value-equiv acl2::x acl2::y))
     :rule-classes :forward-chaining)

    Theorem: equal-of-floating-point-value-fix-2-forward-to-floating-point-value-equiv

    (defthm
     equal-of-floating-point-value-fix-2-forward-to-floating-point-value-equiv
     (implies (equal acl2::x
                     (floating-point-value-fix acl2::y))
              (floating-point-value-equiv acl2::x acl2::y))
     :rule-classes :forward-chaining)

    Theorem: floating-point-value-equiv-of-floating-point-value-fix-1-forward

    (defthm
       floating-point-value-equiv-of-floating-point-value-fix-1-forward
     (implies
          (floating-point-value-equiv (floating-point-value-fix acl2::x)
                                      acl2::y)
          (floating-point-value-equiv acl2::x acl2::y))
     :rule-classes :forward-chaining)

    Theorem: floating-point-value-equiv-of-floating-point-value-fix-2-forward

    (defthm
       floating-point-value-equiv-of-floating-point-value-fix-2-forward
     (implies
         (floating-point-value-equiv acl2::x
                                     (floating-point-value-fix acl2::y))
         (floating-point-value-equiv acl2::x acl2::y))
     :rule-classes :forward-chaining)

    Theorem: floating-point-value-kind$inline-of-floating-point-value-fix-x

    (defthm
         floating-point-value-kind$inline-of-floating-point-value-fix-x
      (equal (floating-point-value-kind$inline
                  (floating-point-value-fix acl2::x))
             (floating-point-value-kind$inline acl2::x)))

    Theorem: floating-point-value-kind$inline-floating-point-value-equiv-congruence-on-x

    (defthm
     floating-point-value-kind$inline-floating-point-value-equiv-congruence-on-x
     (implies (floating-point-value-equiv acl2::x x-equiv)
              (equal (floating-point-value-kind$inline acl2::x)
                     (floating-point-value-kind$inline x-equiv)))
     :rule-classes :congruence)

    Theorem: consp-of-floating-point-value-fix

    (defthm consp-of-floating-point-value-fix
      (consp (floating-point-value-fix acl2::x))
      :rule-classes :type-prescription)