• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • Soft
        • C
        • Bv
        • Imp-language
        • Event-macros
        • Java
        • Bitcoin
        • Ethereum
          • Mmp-trees
          • Semaphore
          • Database
          • Cryptography
          • Rlp
          • Transactions
          • Hex-prefix
          • Basics
            • Byte-arrays
            • Bytes
            • Words
              • Word
                • Wordp
                  • Word-fix
              • Nibbles
              • Scalars
              • Nibble-arrays
            • Addresses
          • Yul
          • Zcash
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Lists-light
          • Axe
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Word

    Wordp

    Recognizer for word.

    Signature
    (wordp x) → yes/no
    Returns
    yes/no — Type (booleanp yes/no).

    Definitions and Theorems

    Function: wordp

    (defun wordp (x)
     (declare (xargs :guard t))
     (mbe
      :logic (unsigned-byte-p 256 x)
      :exec
      (and
       (integerp x)
       (<= 0 x)
       (<
        x
        115792089237316195423570985008687907853269984665640564039457584007913129639936))))

    Theorem: booleanp-of-wordp

    (defthm booleanp-of-wordp
      (b* ((yes/no (wordp x)))
        (booleanp yes/no))
      :rule-classes :rewrite)

    Theorem: wordp-forward-unsigned-byte-p

    (defthm wordp-forward-unsigned-byte-p
      (implies (wordp x)
               (unsigned-byte-p 256 x))
      :rule-classes :forward-chaining)

    Theorem: unsigned-byte-p-rewrite-wordp

    (defthm unsigned-byte-p-rewrite-wordp
      (equal (unsigned-byte-p 256 x)
             (wordp x)))

    Theorem: natp-when-wordp

    (defthm natp-when-wordp
      (implies (wordp x) (natp x))
      :rule-classes :compound-recognizer)