• 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
          • Defresult
          • Fold
          • Specific-types
          • Defsubtype
          • Defset
          • Defflatsum
          • Deflist-of-len
          • Pos-list
          • Defomap
          • Defbytelist
            • Defbytelist-standard-instances
              • Ubyte8-list
              • Ubyte4-list
                • Ubyte4-list-fix
                • Ubyte4-list-equiv
                • Ubyte4-listp
                  • Ubyte4-listp-basics
                • Ubyte32-list
                • Ubyte256-list
                • Ubyte128-list
                • Ubyte64-list
                • Ubyte3-list
                • Ubyte2-list
                • Ubyte16-list
                • Ubyte11-list
                • Ubyte1-list
                • Sbyte8-list
                • Sbyte64-list
                • Sbyte4-list
                • Sbyte32-list
                • Sbyte3-list
                • Sbyte256-list
                • Sbyte2-list
                • Sbyte16-list
                • Sbyte128-list
                • Sbyte1-list
                • Defubytelist
                • Defsbytelist
              • Defbytelist-implementation
            • Defbyte-standard-instances
            • Deffixtype-alias
            • Defbytelist-standard-instances
              • Ubyte8-list
              • Ubyte4-list
                • Ubyte4-list-fix
                • Ubyte4-list-equiv
                • Ubyte4-listp
                  • Ubyte4-listp-basics
                • Ubyte32-list
                • Ubyte256-list
                • Ubyte128-list
                • Ubyte64-list
                • Ubyte3-list
                • Ubyte2-list
                • Ubyte16-list
                • Ubyte11-list
                • Ubyte1-list
                • Sbyte8-list
                • Sbyte64-list
                • Sbyte4-list
                • Sbyte32-list
                • Sbyte3-list
                • Sbyte256-list
                • Sbyte2-list
                • Sbyte16-list
                • Sbyte128-list
                • Sbyte1-list
                • Defubytelist
                • Defsbytelist
              • 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
      • Ubyte4-listp

      Ubyte4-listp-basics

      Basic theorems about ubyte4-listp, generated by std::deflist.

      Definitions and Theorems

      Theorem: ubyte4-listp-of-cons

      (defthm ubyte4-listp-of-cons
        (equal (ubyte4-listp (cons a x))
               (and (ubyte4p a) (ubyte4-listp x)))
        :rule-classes ((:rewrite)))

      Theorem: ubyte4-listp-of-cdr-when-ubyte4-listp

      (defthm ubyte4-listp-of-cdr-when-ubyte4-listp
        (implies (ubyte4-listp (double-rewrite x))
                 (ubyte4-listp (cdr x)))
        :rule-classes ((:rewrite)))

      Theorem: ubyte4-listp-when-not-consp

      (defthm ubyte4-listp-when-not-consp
        (implies (not (consp x))
                 (equal (ubyte4-listp x) (not x)))
        :rule-classes ((:rewrite)))

      Theorem: ubyte4p-of-car-when-ubyte4-listp

      (defthm ubyte4p-of-car-when-ubyte4-listp
        (implies (ubyte4-listp x)
                 (iff (ubyte4p (car x)) (consp x)))
        :rule-classes ((:rewrite)))

      Theorem: true-listp-when-ubyte4-listp-compound-recognizer

      (defthm true-listp-when-ubyte4-listp-compound-recognizer
        (implies (ubyte4-listp x)
                 (true-listp x))
        :rule-classes :compound-recognizer)

      Theorem: ubyte4-listp-of-list-fix

      (defthm ubyte4-listp-of-list-fix
        (implies (ubyte4-listp x)
                 (ubyte4-listp (list-fix x)))
        :rule-classes ((:rewrite)))

      Theorem: ubyte4-listp-of-sfix

      (defthm ubyte4-listp-of-sfix
        (iff (ubyte4-listp (set::sfix x))
             (or (ubyte4-listp x)
                 (not (set::setp x))))
        :rule-classes ((:rewrite)))

      Theorem: ubyte4-listp-of-insert

      (defthm ubyte4-listp-of-insert
        (iff (ubyte4-listp (set::insert a x))
             (and (ubyte4-listp (set::sfix x))
                  (ubyte4p a)))
        :rule-classes ((:rewrite)))

      Theorem: ubyte4-listp-of-delete

      (defthm ubyte4-listp-of-delete
        (implies (ubyte4-listp x)
                 (ubyte4-listp (set::delete k x)))
        :rule-classes ((:rewrite)))

      Theorem: ubyte4-listp-of-mergesort

      (defthm ubyte4-listp-of-mergesort
        (iff (ubyte4-listp (set::mergesort x))
             (ubyte4-listp (list-fix x)))
        :rule-classes ((:rewrite)))

      Theorem: ubyte4-listp-of-union

      (defthm ubyte4-listp-of-union
        (iff (ubyte4-listp (set::union x y))
             (and (ubyte4-listp (set::sfix x))
                  (ubyte4-listp (set::sfix y))))
        :rule-classes ((:rewrite)))

      Theorem: ubyte4-listp-of-intersect-1

      (defthm ubyte4-listp-of-intersect-1
        (implies (ubyte4-listp x)
                 (ubyte4-listp (set::intersect x y)))
        :rule-classes ((:rewrite)))

      Theorem: ubyte4-listp-of-intersect-2

      (defthm ubyte4-listp-of-intersect-2
        (implies (ubyte4-listp y)
                 (ubyte4-listp (set::intersect x y)))
        :rule-classes ((:rewrite)))

      Theorem: ubyte4-listp-of-difference

      (defthm ubyte4-listp-of-difference
        (implies (ubyte4-listp x)
                 (ubyte4-listp (set::difference x y)))
        :rule-classes ((:rewrite)))

      Theorem: ubyte4-listp-of-duplicated-members

      (defthm ubyte4-listp-of-duplicated-members
        (implies (ubyte4-listp x)
                 (ubyte4-listp (duplicated-members x)))
        :rule-classes ((:rewrite)))

      Theorem: ubyte4-listp-of-rev

      (defthm ubyte4-listp-of-rev
        (equal (ubyte4-listp (rev x))
               (ubyte4-listp (list-fix x)))
        :rule-classes ((:rewrite)))

      Theorem: ubyte4-listp-of-append

      (defthm ubyte4-listp-of-append
        (equal (ubyte4-listp (append a b))
               (and (ubyte4-listp (list-fix a))
                    (ubyte4-listp b)))
        :rule-classes ((:rewrite)))

      Theorem: ubyte4-listp-of-rcons

      (defthm ubyte4-listp-of-rcons
        (iff (ubyte4-listp (rcons a x))
             (and (ubyte4p a)
                  (ubyte4-listp (list-fix x))))
        :rule-classes ((:rewrite)))

      Theorem: ubyte4p-when-member-equal-of-ubyte4-listp

      (defthm ubyte4p-when-member-equal-of-ubyte4-listp
        (and (implies (and (member-equal a x)
                           (ubyte4-listp x))
                      (ubyte4p a))
             (implies (and (ubyte4-listp x)
                           (member-equal a x))
                      (ubyte4p a)))
        :rule-classes ((:rewrite)))

      Theorem: ubyte4-listp-when-subsetp-equal

      (defthm ubyte4-listp-when-subsetp-equal
        (and (implies (and (subsetp-equal x y)
                           (ubyte4-listp y))
                      (equal (ubyte4-listp x) (true-listp x)))
             (implies (and (ubyte4-listp y)
                           (subsetp-equal x y))
                      (equal (ubyte4-listp x)
                             (true-listp x))))
        :rule-classes ((:rewrite)))

      Theorem: ubyte4-listp-of-set-difference-equal

      (defthm ubyte4-listp-of-set-difference-equal
        (implies (ubyte4-listp x)
                 (ubyte4-listp (set-difference-equal x y)))
        :rule-classes ((:rewrite)))

      Theorem: ubyte4-listp-of-intersection-equal-1

      (defthm ubyte4-listp-of-intersection-equal-1
        (implies (ubyte4-listp (double-rewrite x))
                 (ubyte4-listp (intersection-equal x y)))
        :rule-classes ((:rewrite)))

      Theorem: ubyte4-listp-of-intersection-equal-2

      (defthm ubyte4-listp-of-intersection-equal-2
        (implies (ubyte4-listp (double-rewrite y))
                 (ubyte4-listp (intersection-equal x y)))
        :rule-classes ((:rewrite)))

      Theorem: ubyte4-listp-of-union-equal

      (defthm ubyte4-listp-of-union-equal
        (equal (ubyte4-listp (union-equal x y))
               (and (ubyte4-listp (list-fix x))
                    (ubyte4-listp (double-rewrite y))))
        :rule-classes ((:rewrite)))

      Theorem: ubyte4-listp-of-take

      (defthm ubyte4-listp-of-take
        (implies (ubyte4-listp (double-rewrite x))
                 (iff (ubyte4-listp (take n x))
                      (or (ubyte4p nil)
                          (<= (nfix n) (len x)))))
        :rule-classes ((:rewrite)))

      Theorem: ubyte4-listp-of-repeat

      (defthm ubyte4-listp-of-repeat
        (iff (ubyte4-listp (repeat n x))
             (or (ubyte4p x) (zp n)))
        :rule-classes ((:rewrite)))

      Theorem: ubyte4p-of-nth-when-ubyte4-listp

      (defthm ubyte4p-of-nth-when-ubyte4-listp
        (implies (ubyte4-listp x)
                 (iff (ubyte4p (nth n x))
                      (< (nfix n) (len x))))
        :rule-classes ((:rewrite)))

      Theorem: ubyte4-listp-of-update-nth

      (defthm ubyte4-listp-of-update-nth
        (implies (ubyte4-listp (double-rewrite x))
                 (iff (ubyte4-listp (update-nth n y x))
                      (and (ubyte4p y)
                           (or (<= (nfix n) (len x))
                               (ubyte4p nil)))))
        :rule-classes ((:rewrite)))

      Theorem: ubyte4-listp-of-butlast

      (defthm ubyte4-listp-of-butlast
        (implies (ubyte4-listp (double-rewrite x))
                 (ubyte4-listp (butlast x n)))
        :rule-classes ((:rewrite)))

      Theorem: ubyte4-listp-of-nthcdr

      (defthm ubyte4-listp-of-nthcdr
        (implies (ubyte4-listp (double-rewrite x))
                 (ubyte4-listp (nthcdr n x)))
        :rule-classes ((:rewrite)))

      Theorem: ubyte4-listp-of-last

      (defthm ubyte4-listp-of-last
        (implies (ubyte4-listp (double-rewrite x))
                 (ubyte4-listp (last x)))
        :rule-classes ((:rewrite)))

      Theorem: ubyte4-listp-of-remove

      (defthm ubyte4-listp-of-remove
        (implies (ubyte4-listp x)
                 (ubyte4-listp (remove a x)))
        :rule-classes ((:rewrite)))

      Theorem: ubyte4-listp-of-revappend

      (defthm ubyte4-listp-of-revappend
        (equal (ubyte4-listp (revappend x y))
               (and (ubyte4-listp (list-fix x))
                    (ubyte4-listp y)))
        :rule-classes ((:rewrite)))