• 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
              • Ihs/logapp-lemmas
              • Logapp*
              • Logapp-basics
            • 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

Logapp

(logapp size i j) is a binary append of i to j, where i effectively becomes the 'low' bits and j becomes the 'high' bits.

Signature
(logapp size i j) → int
Arguments
size — Guard (and (integerp size) (<= 0 size)).
i — Guard (integerp i).
j — Guard (integerp j).
Returns
int — Type (integerp int).

logapp is a specification for merging integers. Note that i is truncated to size bits before merging with j, and that j is shifted to the left by size bits before the merge.

Definitions and Theorems

Function: logapp

(defun logapp (size i j)
  (declare (type unsigned-byte size))
  (declare (xargs :guard (and (and (integerp size) (<= 0 size))
                              (integerp i)
                              (integerp j))))
  (declare (xargs :split-types t))
  (let ((__function__ 'logapp))
    (declare (ignorable __function__))
    (mbe :logic
         (let ((j (ifix j)))
           (+ (loghead size i) (* j (expt2 size))))
         :exec (+ (loghead size i) (ash j size)))))

Theorem: logapp-type

(defthm logapp-type
  (b* ((int (logapp size i j)))
    (integerp int))
  :rule-classes :type-prescription)

Subtopics

Ihs/logapp-lemmas
Lemmas about logapp from the logops-lemmas book.
Logapp*
Recursive definition of logapp.
Logapp-basics