• 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
          • Syntax-for-tools
          • Atc
          • Language
            • Abstract-syntax
            • Integer-ranges
            • Implementation-environments
            • Dynamic-semantics
            • Static-semantics
            • Grammar
            • Integer-formats
            • Types
            • Portable-ascii-identifiers
            • Values
            • Integer-operations
            • Computation-states
            • Object-designators
            • Operations
              • Bitxor-values
              • Bitior-values
              • Bitand-values
              • Shr-values
                • Shl-values
                • Test-value
                • Rem-values
                • Lt-values
                • Le-values
                • Gt-values
                • Ge-values
                • Sub-values
                • Mul-values
                • Div-values
                • Add-values
                • Ne-values
                • Eq-values
                • Bitnot-value
                • Plus-value
                • Minus-value
                • Lognot-value
              • Errors
              • Tag-environments
              • Function-environments
              • Character-sets
              • Flexible-array-member-removal
              • Arithmetic-operations
              • Pointer-operations
              • Bytes
              • Keywords
              • Real-operations
              • Array-operations
              • Scalar-operations
              • Structure-operations
            • Representation
            • Transformation-tools
            • Insertion-sort
            • Pack
          • Bv
          • Imp-language
          • Event-macros
          • Java
          • 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
    • Operations

    Shr-values

    Apply >> to values [C17:6.5.7/2] [C17:6.5.7/3] [C17:6.5.7/5].

    Signature
    (shr-values val1 val2) → resval
    Arguments
    val1 — Guard (valuep val1).
    val2 — Guard (valuep val2).
    Returns
    resval — Type (value-resultp resval).

    It is an error if the values are not integers. If they are integers, we promote them and then we call the operation on integer values.

    Definitions and Theorems

    Function: shr-values

    (defun shr-values (val1 val2)
      (declare (xargs :guard (and (valuep val1) (valuep val2))))
      (let ((__function__ 'shr-values))
        (declare (ignorable __function__))
        (if (and (value-integerp val1)
                 (value-integerp val2))
            (shr-integer-values (promote-value val1)
                                (promote-value val2))
          (error (list :shr-mistype :required :integer
                       :integer :supplied (value-fix val1)
                       (value-fix val2))))))

    Theorem: value-resultp-of-shr-values

    (defthm value-resultp-of-shr-values
      (b* ((resval (shr-values val1 val2)))
        (value-resultp resval))
      :rule-classes :rewrite)

    Theorem: shr-values-of-value-fix-val1

    (defthm shr-values-of-value-fix-val1
      (equal (shr-values (value-fix val1) val2)
             (shr-values val1 val2)))

    Theorem: shr-values-value-equiv-congruence-on-val1

    (defthm shr-values-value-equiv-congruence-on-val1
      (implies (value-equiv val1 val1-equiv)
               (equal (shr-values val1 val2)
                      (shr-values val1-equiv val2)))
      :rule-classes :congruence)

    Theorem: shr-values-of-value-fix-val2

    (defthm shr-values-of-value-fix-val2
      (equal (shr-values val1 (value-fix val2))
             (shr-values val1 val2)))

    Theorem: shr-values-value-equiv-congruence-on-val2

    (defthm shr-values-value-equiv-congruence-on-val2
      (implies (value-equiv val2 val2-equiv)
               (equal (shr-values val1 val2)
                      (shr-values val1 val2-equiv)))
      :rule-classes :congruence)