• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
    • Math
      • 100-theorems
      • Arithmetic
      • Bit-vectors
        • Sparseint
        • Bitops
          • Bitops/merge
          • Bitops-compatibility
          • Bitops-books
          • Logbitp-reasoning
          • Bitops/signed-byte-p
          • Fast-part-select
          • Bitops/integer-length
          • Bitops/extra-defs
          • Install-bit
          • Trailing-0-count
          • Bitops/defaults
          • Logbitp-mismatch
          • Trailing-1-count
          • Bitops/rotate
          • Bitops/equal-by-logbitp
          • Bitops/ash-bounds
          • Limited-shifts
            • Logcollapse
            • Limshift-loghead-of-logapp
            • Limshift-logext-of-logapp
            • Limshift-loghead-of-logsquash
              • Limshift-loghead-of-ash
            • Bitops/fast-logrev
            • Bitops/part-select
            • Bitops/parity
            • Bitops/saturate
            • Bitops/part-install
            • Bitops/logbitp-bounds
            • Bitops/ihsext-basics
            • Bitops/fast-rotate
            • Bitops/fast-logext
            • Bitops/ihs-extensions
          • Bv
          • Ihs
          • Rtl
        • Algebra
      • Testing-utilities
    • Limited-shifts

    Limshift-loghead-of-logsquash

    Computes (loghead full-width (logsquash squash-width x)).

    Signature
    (limshift-loghead-of-logsquash full-width squash-width x) 
      → 
    shifted
    Arguments
    full-width — Guard (natp full-width).
    squash-width — Guard (natp squash-width).
    x — Guard (integerp x).
    Returns
    shifted — Type (integerp shifted).

    Definitions and Theorems

    Function: limshift-loghead-of-logsquash

    (defun limshift-loghead-of-logsquash (full-width squash-width x)
     (declare (xargs :guard (and (natp full-width)
                                 (natp squash-width)
                                 (integerp x))))
     (let ((__function__ 'limshift-loghead-of-logsquash))
       (declare (ignorable __function__))
       (b*
         ((squash-width (lnfix squash-width))
          (full-width (lnfix full-width))
          (x (lifix x))
          (squash-width-limited (logcollapse (integer-length full-width)
                                             squash-width)))
         (loghead full-width
                  (logsquash squash-width-limited x)))))

    Theorem: integerp-of-limshift-loghead-of-logsquash

    (defthm integerp-of-limshift-loghead-of-logsquash
      (b*
       ((shifted
             (limshift-loghead-of-logsquash full-width squash-width x)))
       (integerp shifted))
      :rule-classes :type-prescription)

    Theorem: limshift-loghead-of-logsquash-correct

    (defthm limshift-loghead-of-logsquash-correct
      (equal (limshift-loghead-of-logsquash full-width squash-width x)
             (loghead full-width (logsquash squash-width x))))