• 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
            • Self-bounds-for-ash
              • Self-bounds-for-logtail
              • Monotonicity-properties-of-ash
              • (= 0 (ash 1 x))
            • Bitops/fast-logrev
            • Limited-shifts
            • 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
    • Bitops/ash-bounds
    • Ash

    Self-bounds-for-ash

    Lemmas for the bounds of (ash a b) versus a.

    These are lemmas for:

    • (< (ASH A B) A)
    • (= A (ASH A B))
    • (< A (ASH A B))

    BOZO these only address when A is positive. We should extend these to negative numbers.

    Definitions and Theorems

    Theorem: (< a (ash a b)) when (posp a)

    (defthm
     |(< a (ash a b)) when (posp a)|
     (implies (posp a)
              (equal (< a (ash a b)) (posp b)))
     :rule-classes ((:rewrite)
                    (:linear :corollary (implies (and (posp a) (posp b))
                                                 (< a (ash a b))))))

    Theorem: (= a (ash a b)) when (posp a)

    (defthm |(= a (ash a b)) when (posp a)|
            (implies (posp a)
                     (equal (equal a (ash a b)) (zip b))))

    Theorem: (< (ash a b) a) when (posp a)

    (defthm
     |(< (ash a b) a) when (posp a)|
     (implies (posp a)
              (equal (< (ash a b) a) (negp b)))
     :rule-classes ((:rewrite)
                    (:linear :corollary (implies (and (posp a) (negp b))
                                                 (< (ash a b) a)))))