• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Debugging
    • Projects
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Error-checking
        • Apt
        • Abnf
        • Fty-extensions
        • Isar
        • Kestrel-utilities
          • Omaps
          • Directed-untranslate
          • Include-book-paths
          • Ubi
          • Checkpoint-list
          • Context-message-pair
          • Numbered-names
          • With-auto-termination
          • Digits-any-base
          • Theorems-about-true-list-lists
          • Make-termination-theorem
          • Sublis-expr+
          • Prove$
          • Defthm<w
          • System-utilities-non-built-in
          • Integer-range-fix
          • Add-const-to-untranslate-preprocess
          • Integers-from-to
          • Minimize-ruler-extenders
          • Unsigned-byte-fix
          • Signed-byte-fix
          • Defthmr
          • Paired-names
          • Unsigned-byte-list-fix
          • Signed-byte-list-fix
          • Show-books
          • Checkpoint-list-pretty
          • List-utilities
          • Skip-in-book
          • Typed-tuplep
          • Defunt
          • Keyword-value-list-to-alist
          • Magic-macroexpand
          • Top-command-number-fn
          • Bits-as-digits-in-base-2
          • Show-checkpoint-list
          • Ubyte11s-as-digits-in-base-2048
          • Named-formulas
          • Bytes-as-digits-in-base-256
          • String-utilities
          • Make-keyword-value-list-from-keys-and-value
          • Integer-range-listp
          • Defmacroq
          • Apply-fn-if-known
          • Trans-eval-error-triple
          • Checkpoint-info-list
          • Previous-subsumer-hints
          • Fms!-lst
          • Zp-listp
          • Doublets-to-alist
          • Trans-eval-state
          • Injections
          • Theorems-about-osets
          • Typed-list-utilities
            • Bit-listp
              • Bit-listp-basics
                • Bit-list
              • Nat-list-fix-theorems
            • Book-runes-alist
            • User-interface
            • Bits/ubyte11s-digit-grouping
            • Bits/bytes-digit-grouping
            • Message-utilities
            • Subsetp-eq-linear
            • Strict-merge-sort-<
            • Miscellaneous-enumerations
            • Maybe-unquote
            • Oset-utilities
            • Thm<w
            • Defthmd<w
          • Prime-field-constraint-systems
          • Soft
          • Bv
          • Imp-language
          • Event-macros
          • Bitcoin
          • Ethereum
          • Yul
          • Zcash
          • ACL2-programming-language
          • Prime-fields
          • Java
          • C
          • Syntheto
          • Number-theory
          • Cryptography
          • Lists-light
          • File-io-light
          • Json
          • Built-ins
          • Solidity
          • Axe
          • Std-extensions
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Execloader
        • Axe
      • Testing-utilities
      • Math
    • Bit-listp

    Bit-listp-basics

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

    Definitions and Theorems

    Theorem: bit-listp-of-cons

    (defthm bit-listp-of-cons
            (equal (bit-listp (cons a x))
                   (and (bitp a) (bit-listp x)))
            :rule-classes ((:rewrite)))

    Theorem: bit-listp-of-cdr-when-bit-listp

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

    Theorem: bit-listp-when-not-consp

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

    Theorem: bitp-of-car-when-bit-listp

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

    Theorem: true-listp-when-bit-listp

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

    Theorem: bit-listp-of-list-fix

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

    Theorem: bit-listp-of-sfix

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

    Theorem: bit-listp-of-insert

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

    Theorem: bit-listp-of-delete

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

    Theorem: bit-listp-of-mergesort

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

    Theorem: bit-listp-of-union

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

    Theorem: bit-listp-of-intersect-1

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

    Theorem: bit-listp-of-intersect-2

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

    Theorem: bit-listp-of-difference

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

    Theorem: bit-listp-of-duplicated-members

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

    Theorem: bit-listp-of-rev

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

    Theorem: bit-listp-of-append

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

    Theorem: bit-listp-of-rcons

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

    Theorem: bitp-when-member-equal-of-bit-listp

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

    Theorem: bit-listp-when-subsetp-equal

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

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

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

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

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

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

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

    Theorem: bit-listp-of-union-equal

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

    Theorem: bit-listp-of-take

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

    Theorem: bit-listp-of-repeat

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

    Theorem: bitp-of-nth-when-bit-listp

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

    Theorem: bit-listp-of-update-nth

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

    Theorem: bit-listp-of-butlast

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

    Theorem: bit-listp-of-nthcdr

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

    Theorem: bit-listp-of-last

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

    Theorem: bit-listp-of-remove

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

    Theorem: bit-listp-of-revappend

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