• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
          • Defbyte
            • Defbytelist
            • Defbyte-standard-instances
            • Defbyte-ihs-theorems
            • Defbyte-implementation
              • Defbyte-fn
              • Defbyte-infop
              • Defbyte-check-size
              • Defbyte-fix-support-lemma
                • Defbyte-table
                • Defbyte-macro-definition
                • *defbyte-table-name*
            • Defresult
            • Fold
            • Specific-types
            • Defsubtype
            • Defset
            • Defflatsum
            • Deflist-of-len
            • Pos-list
            • Defomap
            • Defbytelist
            • Defbyte-standard-instances
            • Deffixtype-alias
            • Defbytelist-standard-instances
            • Defunit
            • Byte-list
            • Database
            • Byte
            • String-option
            • Pos-option
            • Nibble
            • Nat-option
            • Ubyte32-option
            • Byte-list20
            • Byte-list32
            • Byte-list64
            • Pseudo-event-form
            • Natoption/natoptionlist
            • Nati
            • Character-list
            • Nat/natlist
            • Maybe-string
            • Nibble-list
            • Natoption/natoptionlist-result
            • Nat/natlist-result
            • Nat-option-list-result
            • Set
            • String-result
            • String-list-result
            • Nat-result
            • Nat-option-result
            • Nat-list-result
            • Maybe-string-result
            • Integer-result
            • Character-result
            • Character-list-result
            • Boolean-result
            • Map
            • Dependencies
            • Bag
            • Pos-set
            • Hex-digit-char-list
            • Dec-digit-char-list
            • Pseudo-event-form-list
            • Nat-option-list
            • Character-any-map
            • Any-nat-map
            • Symbol-set
            • String-set
            • Nat-set
            • Character-set
            • Oct-digit-char-list
            • Bin-digit-char-list
            • Bit-list
          • Isar
          • Kestrel-utilities
          • Set
          • C
          • Soft
          • Bv
          • Imp-language
          • Ethereum
          • Event-macros
          • Java
          • Riscv
          • Bitcoin
          • Zcash
          • Yul
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Axe
          • Lists-light
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Defbyte-implementation

    Defbyte-fix-support-lemma

    Support lemma for generated fixing theorem.

    In the events generated by defbyte, proving that the fixer returns a value that satisfies the recognizer boils down to proving that 0 satisfies the recognizer. This is easy when the size of the bytes is known: the proof is done via the executable counterparts of the functions. When the size of the bytes is a nullary function call, we need a bit of arithmetic reasoning, based on the fact that the size must be provably positive.

    The following general lemma is referenced in the hints generated by defbyte.

    Definitions and Theorems

    Theorem: defbyte-fix-support-lemma

    (defthm defbyte-fix-support-lemma
      (implies (posp z)
               (and (<= (- (expt 2 (1- z))) 0)
                    (< 0 (expt 2 (1- z)))
                    (< 0 (expt 2 z))))
      :rule-classes nil)