• 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
            • Rotate-right
            • Rotate-left
              • Rotate-left**
              • Rotate-right-1
              • Rotate-left-1
              • Rotate-right**
              • Rotate-left**
              • Bitops/equal-by-logbitp
              • Bitops/ash-bounds
              • Limited-shifts
              • 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
      • Bitops/rotate
      • Rotate-left

      Rotate-left**

      Alternate, recursive definitions of rotate-left.

      Here are both tail-recursive and non tail-recursive versions of rotate-left. These rules are disabled by default and must be explicitly enabled when you want to use them.

      Definitions and Theorems

      Theorem: rotate-left**

      (defthm rotate-left**
        (equal (rotate-left x width places)
               (if (zp places)
                   (loghead width x)
                 (rotate-left-1 (rotate-left x width (- places 1))
                                width)))
        :rule-classes
        ((:definition :clique (rotate-left)
                      :controller-alist ((rotate-left nil nil t)))))

      Theorem: rotate-left**-tr

      (defthm rotate-left**-tr
        (equal (rotate-left x width places)
               (if (zp places)
                   (loghead width x)
                 (rotate-left (rotate-left-1 x width)
                              width (- places 1))))
        :rule-classes
        ((:definition :clique (rotate-left)
                      :controller-alist ((rotate-left nil nil t)))))