• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
      • Std/lists
      • Omaps
      • Std/alists
      • Obags
      • Std/util
      • Std/strings
      • Std/osets
      • Std/io
      • Std/basic
      • Std/system
        • Fresh-logical-name-with-$s-suffix
        • Irrelevant-formals-info
        • Std/system/function-queries
        • Std/system/term-queries
        • Std/system/term-transformations
        • Std/system/enhanced-utilities
        • Install-not-normalized-event
        • Install-not-normalized-event-lst
        • Std/system/term-function-recognizers
          • Pseudo-termfnp
          • Pseudo-lambdap
          • Lambdap
          • Termfnp
          • Pseudo-lambda-listp
          • Pseudo-termfn-listp
          • Termfn-listp
            • Termfn-listp-basics
            • Lambda-listp
          • Genvar$
          • Std/system/event-name-queries
          • Pseudo-tests-and-call-listp
          • Maybe-pseudo-event-formp
          • Add-suffix-to-fn-or-const
          • Chk-irrelevant-formals-ok
          • Table-alist+
          • Pseudo-tests-and-callp
          • Add-suffix-to-fn-or-const-lst
          • Known-packages+
          • Add-suffix-to-fn-lst
          • Unquote-term
          • Event-landmark-names
          • Add-suffix-lst
          • Std/system/theorem-queries
          • Unquote-term-list
          • Std/system/macro-queries
          • Pseudo-command-landmark-listp
          • Install-not-normalized$
          • Pseudo-event-landmark-listp
          • Known-packages
          • Std/system/partition-rest-and-keyword-args
          • Rune-enabledp
          • Rune-disabledp
          • Included-books
          • Std/system/pseudo-event-formp
          • Std/system/plist-worldp-with-formals
          • Std/system/w
          • Std/system/geprops
          • Std/system/arglistp
          • Std/system/constant-queries
        • Std/typed-lists
        • Std/bitsets
        • Std/testing
        • Std/typed-alists
        • Std/stobjs
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Termfn-listp

    Termfn-listp-basics

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

    Definitions and Theorems

    Theorem: termfn-listp-of-cons

    (defthm termfn-listp-of-cons
      (equal (termfn-listp (cons a x) wrld)
             (and (termfnp a wrld)
                  (termfn-listp x wrld)))
      :rule-classes ((:rewrite)))

    Theorem: termfn-listp-of-cdr-when-termfn-listp

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

    Theorem: termfn-listp-when-not-consp

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

    Theorem: termfnp-of-car-when-termfn-listp

    (defthm termfnp-of-car-when-termfn-listp
      (implies (termfn-listp x wrld)
               (iff (termfnp (car x) wrld)
                    (or (consp x) (termfnp nil wrld))))
      :rule-classes ((:rewrite)))

    Theorem: true-listp-when-termfn-listp

    (defthm true-listp-when-termfn-listp
      (implies (termfn-listp x wrld)
               (true-listp x))
      :rule-classes ((:rewrite)))

    Theorem: termfn-listp-of-list-fix

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

    Theorem: termfn-listp-of-sfix

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

    Theorem: termfn-listp-of-insert

    (defthm termfn-listp-of-insert
      (iff (termfn-listp (set::insert a x) wrld)
           (and (termfn-listp (set::sfix x) wrld)
                (termfnp a wrld)))
      :rule-classes ((:rewrite)))

    Theorem: termfn-listp-of-delete

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

    Theorem: termfn-listp-of-mergesort

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

    Theorem: termfn-listp-of-union

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

    Theorem: termfn-listp-of-intersect-1

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

    Theorem: termfn-listp-of-intersect-2

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

    Theorem: termfn-listp-of-difference

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

    Theorem: termfn-listp-of-duplicated-members

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

    Theorem: termfn-listp-of-rev

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

    Theorem: termfn-listp-of-append

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

    Theorem: termfn-listp-of-rcons

    (defthm termfn-listp-of-rcons
      (iff (termfn-listp (rcons a x) wrld)
           (and (termfnp a wrld)
                (termfn-listp (list-fix x) wrld)))
      :rule-classes ((:rewrite)))

    Theorem: termfnp-when-member-equal-of-termfn-listp

    (defthm termfnp-when-member-equal-of-termfn-listp
      (and (implies (and (member-equal a x)
                         (termfn-listp x wrld))
                    (termfnp a wrld))
           (implies (and (termfn-listp x wrld)
                         (member-equal a x))
                    (termfnp a wrld)))
      :rule-classes ((:rewrite)))

    Theorem: termfn-listp-when-subsetp-equal

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

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

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

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

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

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

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

    Theorem: termfn-listp-of-union-equal

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

    Theorem: termfn-listp-of-take

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

    Theorem: termfn-listp-of-repeat

    (defthm termfn-listp-of-repeat
      (iff (termfn-listp (repeat n x) wrld)
           (or (termfnp x wrld) (zp n)))
      :rule-classes ((:rewrite)))

    Theorem: termfnp-of-nth-when-termfn-listp

    (defthm termfnp-of-nth-when-termfn-listp
      (implies (and (termfn-listp x wrld)
                    (< (nfix n) (len x)))
               (termfnp (nth n x) wrld))
      :rule-classes ((:rewrite)))

    Theorem: termfn-listp-of-update-nth

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

    Theorem: termfn-listp-of-butlast

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

    Theorem: termfn-listp-of-nthcdr

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

    Theorem: termfn-listp-of-last

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

    Theorem: termfn-listp-of-remove

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

    Theorem: termfn-listp-of-revappend

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