• 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
          • Digits-any-base
          • Context-message-pair
          • Numbered-names
          • With-auto-termination
          • Make-termination-theorem
          • Theorems-about-true-list-lists
          • Checkpoint-list
          • Sublis-expr+
          • Prove$
          • Defthm<w
          • System-utilities-non-built-in
          • Integer-range-fix
          • Add-const-to-untranslate-preprocess
          • Minimize-ruler-extenders
          • Integers-from-to
          • Unsigned-byte-fix
          • Signed-byte-fix
          • Defthmr
          • Paired-names
          • Unsigned-byte-list-fix
          • Signed-byte-list-fix
          • Show-books
          • List-utilities
          • Skip-in-book
          • Typed-tuplep
          • 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
            • Zp-listp-basics
            • Trans-eval-state
            • Injections
            • Doublets-to-alist
            • Theorems-about-osets
            • Typed-list-utilities
            • 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
            • Io-utilities
          • 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
          • Axe
          • Solidity
          • Std-extensions
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Testing-utilities
      • Math
    • Zp-listp

    Zp-listp-basics

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

    Definitions and Theorems

    Theorem: zp-listp-of-cons

    (defthm zp-listp-of-cons
      (equal (zp-listp (cons a x))
             (and (not (posp a)) (zp-listp x)))
      :rule-classes ((:rewrite)))

    Theorem: zp-listp-of-cdr-when-zp-listp

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

    Theorem: zp-listp-when-not-consp

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

    Theorem: posp-of-car-when-zp-listp

    (defthm posp-of-car-when-zp-listp
      (implies (zp-listp x)
               (not (posp (car x))))
      :rule-classes ((:rewrite)))

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

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

    Theorem: zp-listp-of-list-fix

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

    Theorem: zp-listp-of-sfix

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

    Theorem: zp-listp-of-insert

    (defthm zp-listp-of-insert
      (iff (zp-listp (set::insert a x))
           (and (zp-listp (set::sfix x))
                (not (posp a))))
      :rule-classes ((:rewrite)))

    Theorem: zp-listp-of-delete

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

    Theorem: zp-listp-of-mergesort

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

    Theorem: zp-listp-of-union

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

    Theorem: zp-listp-of-intersect-1

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

    Theorem: zp-listp-of-intersect-2

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

    Theorem: zp-listp-of-difference

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

    Theorem: zp-listp-of-duplicated-members

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

    Theorem: zp-listp-of-rev

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

    Theorem: zp-listp-of-append

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

    Theorem: zp-listp-of-rcons

    (defthm zp-listp-of-rcons
      (iff (zp-listp (rcons a x))
           (and (not (posp a))
                (zp-listp (list-fix x))))
      :rule-classes ((:rewrite)))

    Theorem: posp-when-member-equal-of-zp-listp

    (defthm posp-when-member-equal-of-zp-listp
      (and (implies (and (member-equal a x) (zp-listp x))
                    (not (posp a)))
           (implies (and (zp-listp x) (member-equal a x))
                    (not (posp a))))
      :rule-classes ((:rewrite)))

    Theorem: zp-listp-when-subsetp-equal

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

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

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

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

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

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

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

    Theorem: zp-listp-of-union-equal

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

    Theorem: zp-listp-of-take

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

    Theorem: zp-listp-of-repeat

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

    Theorem: posp-of-nth-when-zp-listp

    (defthm posp-of-nth-when-zp-listp
      (implies (zp-listp x)
               (not (posp (nth n x))))
      :rule-classes ((:rewrite)))

    Theorem: zp-listp-of-update-nth

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

    Theorem: zp-listp-of-butlast

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

    Theorem: zp-listp-of-nthcdr

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

    Theorem: zp-listp-of-last

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

    Theorem: zp-listp-of-remove

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

    Theorem: zp-listp-of-revappend

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