• 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
          • Defbyte-standard-instances
          • Deffixtype-alias
          • Defbytelist-standard-instances
            • Ubyte8-list
            • Ubyte4-list
            • Ubyte32-list
            • Ubyte256-list
            • Ubyte128-list
            • Ubyte64-list
            • Ubyte3-list
            • Ubyte2-list
              • Ubyte2-list-fix
              • Ubyte2-list-equiv
              • Ubyte2-listp
                • Ubyte2-listp-basics
              • 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
    • Ubyte2-listp

    Ubyte2-listp-basics

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

    Definitions and Theorems

    Theorem: ubyte2-listp-of-cons

    (defthm ubyte2-listp-of-cons
      (equal (ubyte2-listp (cons a x))
             (and (ubyte2p a) (ubyte2-listp x)))
      :rule-classes ((:rewrite)))

    Theorem: ubyte2-listp-of-cdr-when-ubyte2-listp

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

    Theorem: ubyte2-listp-when-not-consp

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

    Theorem: ubyte2p-of-car-when-ubyte2-listp

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

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

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

    Theorem: ubyte2-listp-of-list-fix

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

    Theorem: ubyte2-listp-of-sfix

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

    Theorem: ubyte2-listp-of-insert

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

    Theorem: ubyte2-listp-of-delete

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

    Theorem: ubyte2-listp-of-mergesort

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

    Theorem: ubyte2-listp-of-union

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

    Theorem: ubyte2-listp-of-intersect-1

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

    Theorem: ubyte2-listp-of-intersect-2

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

    Theorem: ubyte2-listp-of-difference

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

    Theorem: ubyte2-listp-of-duplicated-members

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

    Theorem: ubyte2-listp-of-rev

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

    Theorem: ubyte2-listp-of-append

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

    Theorem: ubyte2-listp-of-rcons

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

    Theorem: ubyte2p-when-member-equal-of-ubyte2-listp

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

    Theorem: ubyte2-listp-when-subsetp-equal

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

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

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

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

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

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

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

    Theorem: ubyte2-listp-of-union-equal

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

    Theorem: ubyte2-listp-of-take

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

    Theorem: ubyte2-listp-of-repeat

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

    Theorem: ubyte2p-of-nth-when-ubyte2-listp

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

    Theorem: ubyte2-listp-of-update-nth

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

    Theorem: ubyte2-listp-of-butlast

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

    Theorem: ubyte2-listp-of-nthcdr

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

    Theorem: ubyte2-listp-of-last

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

    Theorem: ubyte2-listp-of-remove

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

    Theorem: ubyte2-listp-of-revappend

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