• 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

    Word-fix

    Fixer for word.

    Signature
    (word-fix x) → fixed-x
    Arguments
    x — Guard (wordp x).
    Returns
    fixed-x — Type (wordp fixed-x).

    Definitions and Theorems

    Function: word-fix

    (defun word-fix (x)
      (declare (xargs :guard (wordp x)))
      (mbe :logic (if (wordp x) x 0) :exec x))

    Theorem: wordp-of-word-fix

    (defthm wordp-of-word-fix
      (b* ((fixed-x (word-fix x)))
        (wordp fixed-x))
      :rule-classes :rewrite)

    Theorem: word-fix-when-wordp

    (defthm word-fix-when-wordp
      (implies (wordp x)
               (equal (word-fix x) x)))