• 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
                • Primitive-value
                • Numericx-value
                • Numeric-value
                • Integral-value
                • Int-value
                  • Int-valuep
                  • Int-value-fix
                    • Int-value-equiv
                    • Make-int-value
                    • Int-value->int
                    • Change-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
    • Int-value

    Int-value-fix

    Fixing function for int-value structures.

    Signature
    (int-value-fix x) → new-x
    Arguments
    x — Guard (int-valuep x).
    Returns
    new-x — Type (int-valuep new-x).

    Definitions and Theorems

    Function: int-value-fix$inline

    (defun int-value-fix$inline (x)
      (declare (xargs :guard (int-valuep x)))
      (let ((__function__ 'int-value-fix))
        (declare (ignorable __function__))
        (mbe :logic
             (b* ((int (acl2::sbyte32-fix (std::da-nth 0 (cdr x)))))
               (cons :int (list int)))
             :exec x)))

    Theorem: int-valuep-of-int-value-fix

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

    Theorem: int-value-fix-when-int-valuep

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

    Function: int-value-equiv$inline

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

    Theorem: int-value-equiv-is-an-equivalence

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

    Theorem: int-value-equiv-implies-equal-int-value-fix-1

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

    Theorem: int-value-fix-under-int-value-equiv

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

    Theorem: equal-of-int-value-fix-1-forward-to-int-value-equiv

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

    Theorem: equal-of-int-value-fix-2-forward-to-int-value-equiv

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

    Theorem: int-value-equiv-of-int-value-fix-1-forward

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

    Theorem: int-value-equiv-of-int-value-fix-2-forward

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