• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Debugging
    • Projects
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
    • Testing-utilities
    • Math
      • 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
            • Logcons
            • Logbit
            • Logextu
            • Lshu
            • Logrpl
            • Ashu
            • Logmaskp
            • Lognotu
            • Logmask
            • Ifloor
            • Imod
              • Bitmaskp
              • Bfix
              • Logite
              • Expt2
              • *logops-functions*
              • Zbp
              • 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
    • Logops-definitions

    Imod

    (imod i j) is the same as mod, except that it coerces its arguments to integers.

    Signature
    (imod i j) → int
    Arguments
    i — Guard (integerp i).
    j — Guard (and (integerp j) (not (= 0 j))).
    Returns
    int — Type (integerp int).

    Definitions and Theorems

    Function: imod$inline

    (defun
         imod$inline (i j)
         (declare (xargs :guard (and (integerp i)
                                     (and (integerp j) (not (= 0 j))))))
         (let ((__function__ 'imod))
              (declare (ignorable __function__))
              (mbe :logic (mod (ifix i) (ifix j))
                   :exec (mod i j))))

    Theorem: imod-type

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