• 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
        • 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
            • 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
    • Logops-definitions

    Expt2

    (expt2 n) is the same as (expt 2 n), except that it coerces its argument to a natural.

    Signature
    (expt2 n) → nat
    Arguments
    n — Guard (natp n).
    Returns
    nat — Type (natp nat).

    Definitions and Theorems

    Function: expt2$inline

    (defun expt2$inline (n)
      (declare (xargs :guard (natp n)))
      (let ((__function__ 'expt2))
        (declare (ignorable __function__))
        (mbe :logic (expt 2 (nfix n))
             :exec (the unsigned-byte
                        (ash 1 (the unsigned-byte n))))))

    Theorem: expt2-type

    (defthm expt2-type
      (b* ((nat (expt2$inline n))) (natp nat))
      :rule-classes :type-prescription)