• 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
                • Char-value
                • Byte-value
                • Short-value
                  • Short-value-fix
                    • Short-valuep
                    • Short-value-equiv
                    • Make-short-value
                    • Short-value->int
                    • Change-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
    • Short-value

    Short-value-fix

    Fixing function for short-value structures.

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

    Definitions and Theorems

    Function: short-value-fix$inline

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

    Theorem: short-valuep-of-short-value-fix

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

    Theorem: short-value-fix-when-short-valuep

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

    Function: short-value-equiv$inline

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

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

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

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

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

    Theorem: short-value-fix-under-short-value-equiv

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

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

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

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

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

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

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

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

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