• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • 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
            • Logrev
            • Loghead
            • Logops-bit-functions
            • Logtail
            • Logapp
            • Logsat
            • Binary--
            • Logcdr
            • Logcar
            • Logbit
            • Logextu
            • Logcons
            • Lshu
            • Logrpl
            • Ashu
              • Ashu-basics
            • Logmaskp
            • Lognotu
            • Logmask
            • Imod
            • Ifloor
            • Bfix
            • Bitmaskp
            • Logite
            • Expt2
            • 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
  • Logops-definitions

Ashu

Arithmetic shift, unsigned version.

Signature
(ashu size i cnt) → nat
Arguments
size — Guard (and (integerp size) (< 0 size)).
i — Guard (integerp i).
cnt — Guard (integerp cnt).
Returns
nat — Type (natp nat).

ashu is a fixed-width version of ash. The integer i is first coerced to a size-bit signed integer by sign-extension, then shifted with ash, and finally truncated back to a size-bit unsigned integer.

See also lshu for a logical (instead of arithmetic) shift.

Definitions and Theorems

Function: ashu

(defun ashu (size i cnt)
  (declare (xargs :guard (and (and (integerp size) (< 0 size))
                              (integerp i)
                              (integerp cnt))))
  (let ((__function__ 'ashu))
    (declare (ignorable __function__))
    (loghead size (ash (logext size i) cnt))))

Theorem: ashu-type

(defthm ashu-type
  (b* ((nat (ashu size i cnt)))
    (natp nat))
  :rule-classes :type-prescription)

Subtopics

Ashu-basics