• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
    • Testing-utilities
    • Math
      • 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
          • Bitops/fast-logrev
          • Limited-shifts
            • Logcollapse
            • Limshift-loghead-of-logapp
              • Limshift-logext-of-logapp
              • Limshift-loghead-of-ash
            • 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
    • Limited-shifts

    Limshift-loghead-of-logapp

    Computes (loghead full-width (logapp concat-width x y)).

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

    Definitions and Theorems

    Function: limshift-loghead-of-logapp

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

    Theorem: integerp-of-limshift-loghead-of-logapp

    (defthm
     integerp-of-limshift-loghead-of-logapp
     (b*
        ((shifted
              (limshift-loghead-of-logapp full-width concat-width x y)))
        (integerp shifted))
     :rule-classes :type-prescription)

    Theorem: limshift-loghead-of-logapp-correct

    (defthm
         limshift-loghead-of-logapp-correct
         (equal (limshift-loghead-of-logapp full-width concat-width x y)
                (loghead full-width (logapp concat-width x y))))