• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
        • Deftreeops
        • Defdefparse
        • Defgrammar
        • Tree-utilities
        • Notation
          • Syntax-abstraction
          • Semantics
            • Tree-terminatedp
            • Tree->string
            • String-has-finite-parse-trees-p
            • Parse-trees-of-string-p
            • Tree-match-element-p
            • Parse-treep
            • Symbol
            • String-unambiguousp
            • Tree-match-num-val-p
            • Nat-match-insensitive-char-p
            • Nats-match-insensitive-chars-p
            • Tree-option
            • String-parsablep
            • Lookup-rulename
            • Nats-match-sensitive-chars-p
            • Numrep-match-repeat-range-p
            • Tree-match-char-val-p
            • Tree-list-match-repetition-p
            • String-ambiguousp
            • Parse
            • Tree-match-prose-val-p
            • Nat-match-sensitive-char-p
            • Theorems-about-terminated-trees-matching-elements
            • Tree-option-result
            • Tree-list-result
            • Tree-list-list-result
            • Tree-result
            • Tree-list-list-match-concatenation-p
            • Languagep
            • Terminal-string-for-rules-p
            • Tree-list-list-match-alternation-p
            • Tree-list-match-element-p
            • Parse!
            • String
            • Tree-set
            • Trees
              • Tree
              • Tree-list
                • Tree-listp
                  • Tree-listp-basics
                  • Tree-list-equiv
                  • Tree-list-fix
                • Tree-list-list
            • Abstract-syntax
            • Core-rules
            • Concrete-syntax
          • Grammar-parser
          • Meta-circular-validation
          • Parsing-primitives-defresult
          • Parsing-primitives-seq
          • Operations
          • Examples
          • Differences-with-paper
          • Constructor-utilities
          • Grammar-printer
          • Parsing-tools
        • Vwsim
        • Isar
        • Wp-gen
        • Dimacs-reader
        • Pfcs
        • Legacy-defrstobj
        • C
        • Proof-checker-array
        • Soft
        • Farray
        • Rp-rewriter
        • Instant-runoff-voting
        • Imp-language
        • Sidekick
        • Ethereum
        • Leftist-trees
        • Java
        • Riscv
        • Taspi
        • Bitcoin
        • Zcash
        • Des
        • X86isa
        • Sha-2
        • Yul
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Axe
        • Poseidon
        • Where-do-i-place-my-book
        • Aleo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Community
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Tree-listp

    Tree-listp-basics

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

    Definitions and Theorems

    Theorem: tree-listp-of-cons

    (defthm tree-listp-of-cons
      (equal (tree-listp (cons acl2::a acl2::x))
             (and (treep acl2::a)
                  (tree-listp acl2::x)))
      :rule-classes ((:rewrite)))

    Theorem: tree-listp-of-cdr-when-tree-listp

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

    Theorem: tree-listp-when-not-consp

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

    Theorem: treep-of-car-when-tree-listp

    (defthm treep-of-car-when-tree-listp
      (implies (tree-listp acl2::x)
               (iff (treep (car acl2::x))
                    (consp acl2::x)))
      :rule-classes ((:rewrite)))

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

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

    Theorem: tree-listp-of-list-fix

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

    Theorem: tree-listp-of-sfix

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

    Theorem: tree-listp-of-insert

    (defthm tree-listp-of-insert
      (iff (tree-listp (insert acl2::a acl2::x))
           (and (tree-listp (sfix acl2::x))
                (treep acl2::a)))
      :rule-classes ((:rewrite)))

    Theorem: tree-listp-of-delete

    (defthm tree-listp-of-delete
      (implies (tree-listp acl2::x)
               (tree-listp (delete acl2::k acl2::x)))
      :rule-classes ((:rewrite)))

    Theorem: tree-listp-of-mergesort

    (defthm tree-listp-of-mergesort
      (iff (tree-listp (mergesort acl2::x))
           (tree-listp (list-fix acl2::x)))
      :rule-classes ((:rewrite)))

    Theorem: tree-listp-of-union

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

    Theorem: tree-listp-of-intersect-1

    (defthm tree-listp-of-intersect-1
      (implies (tree-listp acl2::x)
               (tree-listp (intersect acl2::x acl2::y)))
      :rule-classes ((:rewrite)))

    Theorem: tree-listp-of-intersect-2

    (defthm tree-listp-of-intersect-2
      (implies (tree-listp acl2::y)
               (tree-listp (intersect acl2::x acl2::y)))
      :rule-classes ((:rewrite)))

    Theorem: tree-listp-of-difference

    (defthm tree-listp-of-difference
      (implies (tree-listp acl2::x)
               (tree-listp (difference acl2::x acl2::y)))
      :rule-classes ((:rewrite)))

    Theorem: tree-listp-of-duplicated-members

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

    Theorem: tree-listp-of-rev

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

    Theorem: tree-listp-of-append

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

    Theorem: tree-listp-of-rcons

    (defthm tree-listp-of-rcons
      (iff (tree-listp (rcons acl2::a acl2::x))
           (and (treep acl2::a)
                (tree-listp (list-fix acl2::x))))
      :rule-classes ((:rewrite)))

    Theorem: treep-when-member-equal-of-tree-listp

    (defthm treep-when-member-equal-of-tree-listp
      (and (implies (and (member-equal acl2::a acl2::x)
                         (tree-listp acl2::x))
                    (treep acl2::a))
           (implies (and (tree-listp acl2::x)
                         (member-equal acl2::a acl2::x))
                    (treep acl2::a)))
      :rule-classes ((:rewrite)))

    Theorem: tree-listp-when-subsetp-equal

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

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

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

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

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

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

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

    Theorem: tree-listp-of-union-equal

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

    Theorem: tree-listp-of-take

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

    Theorem: tree-listp-of-repeat

    (defthm tree-listp-of-repeat
      (iff (tree-listp (repeat acl2::n acl2::x))
           (or (treep acl2::x) (zp acl2::n)))
      :rule-classes ((:rewrite)))

    Theorem: treep-of-nth-when-tree-listp

    (defthm treep-of-nth-when-tree-listp
      (implies (tree-listp acl2::x)
               (iff (treep (nth acl2::n acl2::x))
                    (< (nfix acl2::n) (len acl2::x))))
      :rule-classes ((:rewrite)))

    Theorem: tree-listp-of-update-nth

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

    Theorem: tree-listp-of-butlast

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

    Theorem: tree-listp-of-nthcdr

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

    Theorem: tree-listp-of-last

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

    Theorem: tree-listp-of-remove

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

    Theorem: tree-listp-of-revappend

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