• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
        • Syntax-for-tools
        • Atc
        • Language
          • Abstract-syntax
          • Integer-ranges
          • Implementation-environments
          • Dynamic-semantics
          • Static-semantics
          • Grammar
          • Integer-formats
          • Types
          • Portable-ascii-identifiers
          • Values
          • Integer-operations
          • Computation-states
          • Object-designators
          • Operations
          • Errors
          • Tag-environments
          • Function-environments
          • Character-sets
          • Flexible-array-member-removal
          • Arithmetic-operations
          • Pointer-operations
          • Bytes
            • Byte
              • Bytep
                • Byte-fix
              • Char-bit
              • Char-bit-constrp
            • Keywords
            • Real-operations
            • Array-operations
            • Scalar-operations
            • Structure-operations
          • Representation
          • Transformation-tools
          • Insertion-sort
          • Pack
        • Farray
        • Rp-rewriter
        • Instant-runoff-voting
        • Imp-language
        • Sidekick
        • Leftist-trees
        • Java
        • Taspi
        • Bitcoin
        • Riscv
        • Des
        • Ethereum
        • X86isa
        • Sha-2
        • Yul
        • Zcash
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Poseidon
        • Where-do-i-place-my-book
        • Axe
        • Bigmems
        • Builtins
        • Execloader
        • Aleo
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Byte

    Bytep

    Recognizer for byte.

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

    Definitions and Theorems

    Function: bytep

    (defun bytep (x)
      (declare (xargs :guard t))
      (mbe :logic (unsigned-byte-p (char-bit) x)
           :exec (and (integerp x)
                      (<= 0 x)
                      (< x (expt 2 (char-bit))))))

    Theorem: booleanp-of-bytep

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

    Theorem: bytep-forward-unsigned-byte-p

    (defthm bytep-forward-unsigned-byte-p
      (implies (bytep x)
               (unsigned-byte-p (char-bit) x))
      :rule-classes :forward-chaining)

    Theorem: unsigned-byte-p-rewrite-bytep

    (defthm unsigned-byte-p-rewrite-bytep
      (equal (unsigned-byte-p (char-bit) x)
             (bytep x)))

    Theorem: natp-when-bytep

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