• 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
        • Bv
        • Ihs
          • Logops-definitions
            • Logops-byte-functions
            • Defword
            • Defbytetype
            • Logext
            • Loghead
            • Logrev
            • Logops-bit-functions
            • Logapp
            • Logtail
              • Ihs/logtail-lemmas
              • Self-bounds-for-logtail
                • Logtail*
              • Logsat
              • Binary--
              • Logcdr
              • Logcar
              • Logbit
              • Logextu
              • Logcons
              • Lshu
              • Logrpl
              • Logappn
              • Ashu
              • Logmaskp
              • Lognotu
              • Logmask
              • Imod
              • Ifloor
              • Bfix
              • Bitmaskp
              • Logite
              • Expt2
              • Logsquash
              • Zbp
              • *logops-functions*
              • Word/bit-macros
              • Logops-definitions-theory
              • Logops-functions
              • Lbfix
              • Logextu-guard
              • Lshu-guard
              • Logtail-guard
              • Logrpl-guard
              • Logrev-guard
              • Lognotu-guard
              • Logmask-guard
              • Loghead-guard
              • Logext-guard
              • Logbit-guard
              • Logapp-guard
              • Ashu-guard
            • Math-lemmas
            • Ihs-theories
            • Ihs-init
            • Logops
          • Rtl
        • Algebra
      • Testing-utilities
    • Bitops/ash-bounds
    • Logtail

    Self-bounds-for-logtail

    Lemmas for the bounds of (logtail n a) versus a.

    These are lemmas for:

    • (< (logtail n a) a)
    • (= a (logtail n a))
    • (< a (logtail n a))

    Definitions and Theorems

    Theorem: (< (logtail n a) a)

    (defthm |(< (logtail n a) a)|
     (equal (< (logtail n a) a)
            (if (zip a)
                (< 0 a)
              (and (posp a) (posp n))))
     :rule-classes ((:rewrite)
                    (:linear :corollary (implies (and (posp a) (posp n))
                                                 (< (logtail n a) a)))))

    Theorem: (= a (logtail n a))

    (defthm |(= a (logtail n a))|
      (equal (= a (logtail n a))
             (if (zip a)
                 (equal a 0)
               (or (zp n) (equal a -1)))))

    Theorem: (< a (logtail n a))

    (defthm |(< a (logtail n a))|
     (equal (< a (logtail n a))
            (if (zip a)
                (< a 0)
              (and (posp n) (< a -1))))
     :rule-classes ((:rewrite)
                    (:linear :corollary (implies (and (posp n) (< a -1))
                                                 (< a (logtail n a))))))