Lemmas about lists of pseudo-termps, available in the std/typed-lists library.

Most of these are generated automatically with std::deflist.

**Theorem: **

(defthm pseudo-term-listp-of-cons (equal (pseudo-term-listp (cons a x)) (and (pseudo-termp a) (pseudo-term-listp x))))

**Theorem: **

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

**Theorem: **

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

**Theorem: **

(defthm pseudo-termp-of-car-when-pseudo-term-listp (implies (pseudo-term-listp x) (pseudo-termp (car x))) :rule-classes ((:rewrite)))

**Theorem: **

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

**Theorem: **

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

**Theorem: **

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

**Theorem: **

(defthm pseudo-term-listp-of-insert (iff (pseudo-term-listp (set::insert a x)) (and (pseudo-term-listp (set::sfix x)) (pseudo-termp a))) :rule-classes ((:rewrite)))

**Theorem: **

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

**Theorem: **

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

**Theorem: **

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

**Theorem: **

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

**Theorem: **

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

**Theorem: **

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

**Theorem: **

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

**Theorem: **

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

**Theorem: **

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

**Theorem: **

(defthm pseudo-term-listp-of-rcons (iff (pseudo-term-listp (rcons a x)) (and (pseudo-termp a) (pseudo-term-listp (list-fix x)))) :rule-classes ((:rewrite)))

**Theorem: **

(defthm pseudo-termp-when-member-equal-of-pseudo-term-listp (and (implies (and (member-equal a x) (pseudo-term-listp x)) (pseudo-termp a)) (implies (and (pseudo-term-listp x) (member-equal a x)) (pseudo-termp a))) :rule-classes ((:rewrite)))

**Theorem: **

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

**Theorem: **

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

**Theorem: **

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

**Theorem: **

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

**Theorem: **

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

**Theorem: **

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

**Theorem: **

(defthm pseudo-term-listp-of-repeat (iff (pseudo-term-listp (repeat n x)) (or (pseudo-termp x) (zp n))) :rule-classes ((:rewrite)))

**Theorem: **

(defthm pseudo-termp-of-nth-when-pseudo-term-listp (implies (pseudo-term-listp x) (pseudo-termp (nth n x))) :rule-classes ((:rewrite)))

**Theorem: **

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

**Theorem: **

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

**Theorem: **

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

**Theorem: **

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

**Theorem: **

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

**Theorem: **

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

**Theorem: **

(defthm pseudo-term-listp-of-remove-equal (implies (pseudo-term-listp x) (pseudo-term-listp (remove-equal a x))))

**Theorem: **

(defthm pseudo-term-listp-of-remove1-equal (implies (pseudo-term-listp x) (pseudo-term-listp (remove1-equal a x))))

**Theorem: **

(defthm pseudo-term-listp-of-make-list-ac (equal (pseudo-term-listp (make-list-ac n x ac)) (and (pseudo-term-listp ac) (or (pseudo-termp x) (zp n)))))

**Theorem: **

(defthm pseudo-term-listp-when-symbol-listp (implies (symbol-listp syms) (pseudo-term-listp syms)))

**Theorem: **

(defthm true-listp-when-pseudo-term-listp (implies (pseudo-term-listp x) (true-listp x)))