• 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
              • Ihs/logtail-lemmas
              • Self-bounds-for-logtail
              • Logtail*
            • Logapp
            • Logsat
            • Binary--
            • Logcdr
            • Logcar
            • Logbit
            • Logextu
            • Logcons
            • Lshu
            • Logrpl
            • Ashu
            • 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

Logtail

(logtail pos i) returns the high-order part of i, starting at bit position pos.

Signature
(logtail pos i) → int
Arguments
pos — Guard (and (integerp pos) (<= 0 pos)).
i — Guard (integerp i).
Returns
int — Type (integerp int).

In languages like C, this might be written as i >> pos.

Definitions and Theorems

Function: logtail$inline

(defun logtail$inline (pos i)
  (declare (type unsigned-byte pos))
  (declare (xargs :guard (and (and (integerp pos) (<= 0 pos))
                              (integerp i))))
  (declare (xargs :split-types t))
  (let ((__function__ 'logtail))
    (declare (ignorable __function__))
    (mbe :logic (ifloor i (expt2 pos))
         :exec (ash i (- (the unsigned-byte pos))))))

Theorem: logtail-type

(defthm logtail-type
  (b* ((int (logtail$inline pos i)))
    (integerp int))
  :rule-classes :type-prescription)

Subtopics

Ihs/logtail-lemmas
Lemmas about logtail from the logops-lemmas book.
Self-bounds-for-logtail
Lemmas for the bounds of (logtail n a) versus a.
Logtail*
Recursive definition of logtail.