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