• 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
        • Isar
        • Kestrel-utilities
          • Directed-untranslate
          • Include-book-paths
          • Ubi
          • Numbered-names
          • Digits-any-base
          • Context-message-pair
          • With-auto-termination
          • Make-termination-theorem
          • Theorems-about-true-list-lists
          • Checkpoint-list
          • Sublis-expr+
          • Integers-from-to
          • Prove$
          • Defthm<w
          • System-utilities-non-built-in
          • Integer-range-fix
          • Minimize-ruler-extenders
          • Add-const-to-untranslate-preprocess
          • Unsigned-byte-fix
          • Signed-byte-fix
          • Defthmr
          • Paired-names
          • Unsigned-byte-list-fix
          • Signed-byte-list-fix
          • Show-books
          • Skip-in-book
          • Typed-tuplep
          • List-utilities
          • Checkpoint-list-pretty
          • 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
          • Defmacroq
          • Integer-range-listp
          • Apply-fn-if-known
          • Trans-eval-error-triple
          • Checkpoint-info-list
          • Previous-subsumer-hints
          • Fms!-lst
          • Zp-listp
          • Trans-eval-state
          • Injections
          • Doublets-to-alist
          • Theorems-about-osets
          • Typed-list-utilities
            • Bit-listp
              • Bit-listp-basics
                • Bit-list
              • Nat-list-fix-theorems
            • Message-utilities
            • Book-runes-alist
            • User-interface
            • Bits/ubyte11s-digit-grouping
            • Bits/bytes-digit-grouping
            • Subsetp-eq-linear
            • Oset-utilities
            • Strict-merge-sort-<
            • Miscellaneous-enumerations
            • Maybe-unquote
            • Thm<w
            • Defthmd<w
            • Io-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
    • 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-compound-recognizer

    (defthm true-listp-when-bit-listp-compound-recognizer
      (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)))