• 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
          • 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
          • Bv
          • Imp-language
          • Event-macros
          • Java
          • Bitcoin
          • Ethereum
          • 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
    • Byte

    Byte-fix

    Fixer for byte.

    Signature
    (byte-fix x) → fixed-x
    Arguments
    x — Guard (bytep x).
    Returns
    fixed-x — Type (bytep fixed-x).

    Definitions and Theorems

    Function: byte-fix

    (defun byte-fix (x)
      (declare (xargs :guard (bytep x)))
      (mbe :logic (if (bytep x) x 0) :exec x))

    Theorem: bytep-of-byte-fix

    (defthm bytep-of-byte-fix
      (b* ((fixed-x (byte-fix x)))
        (bytep fixed-x))
      :rule-classes :rewrite)

    Theorem: byte-fix-when-bytep

    (defthm byte-fix-when-bytep
      (implies (bytep x)
               (equal (byte-fix x) x)))