Recognize alists from symbols to true lists.
This is an ordinary std::defalist.
Function:
(defun symbol-truelist-alistp (x) (declare (xargs :guard t)) (if (consp x) (and (consp (car x)) (symbolp (caar x)) (true-listp (cdar x)) (symbol-truelist-alistp (cdr x))) (null x)))
Function:
(defun symbol-truelist-alistp (x) (declare (xargs :guard t)) (if (consp x) (and (consp (car x)) (symbolp (caar x)) (true-listp (cdar x)) (symbol-truelist-alistp (cdr x))) (null x)))
Theorem:
(defthm symbol-truelist-alistp-of-revappend (equal (symbol-truelist-alistp (revappend x y)) (and (symbol-truelist-alistp (list-fix x)) (symbol-truelist-alistp y))) :rule-classes ((:rewrite)))
Theorem:
(defthm symbol-truelist-alistp-of-remove (implies (symbol-truelist-alistp x) (symbol-truelist-alistp (remove a x))) :rule-classes ((:rewrite)))
Theorem:
(defthm symbol-truelist-alistp-of-last (implies (symbol-truelist-alistp (double-rewrite x)) (symbol-truelist-alistp (last x))) :rule-classes ((:rewrite)))
Theorem:
(defthm symbol-truelist-alistp-of-nthcdr (implies (symbol-truelist-alistp (double-rewrite x)) (symbol-truelist-alistp (nthcdr n x))) :rule-classes ((:rewrite)))
Theorem:
(defthm symbol-truelist-alistp-of-butlast (implies (symbol-truelist-alistp (double-rewrite x)) (symbol-truelist-alistp (butlast x n))) :rule-classes ((:rewrite)))
Theorem:
(defthm symbol-truelist-alistp-of-update-nth (implies (symbol-truelist-alistp (double-rewrite x)) (iff (symbol-truelist-alistp (update-nth n y x)) (and (and (consp y) (symbolp (car y)) (true-listp (cdr y))) (or (<= (nfix n) (len x)) (and (consp nil) (symbolp (car nil)) (true-listp (cdr nil))))))) :rule-classes ((:rewrite)))
Theorem:
(defthm symbol-truelist-alistp-of-repeat (iff (symbol-truelist-alistp (repeat n x)) (or (and (consp x) (symbolp (car x)) (true-listp (cdr x))) (zp n))) :rule-classes ((:rewrite)))
Theorem:
(defthm symbol-truelist-alistp-of-take (implies (symbol-truelist-alistp (double-rewrite x)) (iff (symbol-truelist-alistp (take n x)) (or (and (consp nil) (symbolp (car nil)) (true-listp (cdr nil))) (<= (nfix n) (len x))))) :rule-classes ((:rewrite)))
Theorem:
(defthm symbol-truelist-alistp-of-union-equal (equal (symbol-truelist-alistp (union-equal x y)) (and (symbol-truelist-alistp (list-fix x)) (symbol-truelist-alistp (double-rewrite y)))) :rule-classes ((:rewrite)))
Theorem:
(defthm symbol-truelist-alistp-of-intersection-equal-2 (implies (symbol-truelist-alistp (double-rewrite y)) (symbol-truelist-alistp (intersection-equal x y))) :rule-classes ((:rewrite)))
Theorem:
(defthm symbol-truelist-alistp-of-intersection-equal-1 (implies (symbol-truelist-alistp (double-rewrite x)) (symbol-truelist-alistp (intersection-equal x y))) :rule-classes ((:rewrite)))
Theorem:
(defthm symbol-truelist-alistp-of-set-difference-equal (implies (symbol-truelist-alistp x) (symbol-truelist-alistp (set-difference-equal x y))) :rule-classes ((:rewrite)))
Theorem:
(defthm symbol-truelist-alistp-when-subsetp-equal (and (implies (and (subsetp-equal x y) (symbol-truelist-alistp y)) (equal (symbol-truelist-alistp x) (true-listp x))) (implies (and (symbol-truelist-alistp y) (subsetp-equal x y)) (equal (symbol-truelist-alistp x) (true-listp x)))) :rule-classes ((:rewrite)))
Theorem:
(defthm symbol-truelist-alistp-of-rcons (iff (symbol-truelist-alistp (rcons a x)) (and (and (consp a) (symbolp (car a)) (true-listp (cdr a))) (symbol-truelist-alistp (list-fix x)))) :rule-classes ((:rewrite)))
Theorem:
(defthm symbol-truelist-alistp-of-append (equal (symbol-truelist-alistp (append a b)) (and (symbol-truelist-alistp (list-fix a)) (symbol-truelist-alistp b))) :rule-classes ((:rewrite)))
Theorem:
(defthm symbol-truelist-alistp-of-rev (equal (symbol-truelist-alistp (rev x)) (symbol-truelist-alistp (list-fix x))) :rule-classes ((:rewrite)))
Theorem:
(defthm symbol-truelist-alistp-of-duplicated-members (implies (symbol-truelist-alistp x) (symbol-truelist-alistp (duplicated-members x))) :rule-classes ((:rewrite)))
Theorem:
(defthm symbol-truelist-alistp-of-difference (implies (symbol-truelist-alistp x) (symbol-truelist-alistp (set::difference x y))) :rule-classes ((:rewrite)))
Theorem:
(defthm symbol-truelist-alistp-of-intersect-2 (implies (symbol-truelist-alistp y) (symbol-truelist-alistp (set::intersect x y))) :rule-classes ((:rewrite)))
Theorem:
(defthm symbol-truelist-alistp-of-intersect-1 (implies (symbol-truelist-alistp x) (symbol-truelist-alistp (set::intersect x y))) :rule-classes ((:rewrite)))
Theorem:
(defthm symbol-truelist-alistp-of-union (iff (symbol-truelist-alistp (set::union x y)) (and (symbol-truelist-alistp (set::sfix x)) (symbol-truelist-alistp (set::sfix y)))) :rule-classes ((:rewrite)))
Theorem:
(defthm symbol-truelist-alistp-of-mergesort (iff (symbol-truelist-alistp (set::mergesort x)) (symbol-truelist-alistp (list-fix x))) :rule-classes ((:rewrite)))
Theorem:
(defthm symbol-truelist-alistp-of-delete (implies (symbol-truelist-alistp x) (symbol-truelist-alistp (set::delete k x))) :rule-classes ((:rewrite)))
Theorem:
(defthm symbol-truelist-alistp-of-insert (iff (symbol-truelist-alistp (set::insert a x)) (and (symbol-truelist-alistp (set::sfix x)) (and (consp a) (symbolp (car a)) (true-listp (cdr a))))) :rule-classes ((:rewrite)))
Theorem:
(defthm symbol-truelist-alistp-of-sfix (iff (symbol-truelist-alistp (set::sfix x)) (or (symbol-truelist-alistp x) (not (set::setp x)))) :rule-classes ((:rewrite)))
Theorem:
(defthm symbol-truelist-alistp-of-list-fix (implies (symbol-truelist-alistp x) (symbol-truelist-alistp (list-fix x))) :rule-classes ((:rewrite)))
Theorem:
(defthm true-listp-when-symbol-truelist-alistp-compound-recognizer (implies (symbol-truelist-alistp x) (true-listp x)) :rule-classes :compound-recognizer)
Theorem:
(defthm symbol-truelist-alistp-when-not-consp (implies (not (consp x)) (equal (symbol-truelist-alistp x) (not x))) :rule-classes ((:rewrite)))
Theorem:
(defthm symbol-truelist-alistp-of-cdr-when-symbol-truelist-alistp (implies (symbol-truelist-alistp (double-rewrite x)) (symbol-truelist-alistp (cdr x))) :rule-classes ((:rewrite)))
Theorem:
(defthm symbol-truelist-alistp-of-cons (equal (symbol-truelist-alistp (cons a x)) (and (and (consp a) (symbolp (car a)) (true-listp (cdr a))) (symbol-truelist-alistp x))) :rule-classes ((:rewrite)))
Theorem:
(defthm symbol-truelist-alistp-of-make-fal (implies (and (symbol-truelist-alistp x) (symbol-truelist-alistp y)) (symbol-truelist-alistp (make-fal x y))) :rule-classes ((:rewrite)))
Theorem:
(defthm true-listp-of-cdr-when-member-equal-of-symbol-truelist-alistp (and (implies (and (symbol-truelist-alistp x) (member-equal a x)) (true-listp (cdr a))) (implies (and (member-equal a x) (symbol-truelist-alistp x)) (true-listp (cdr a)))) :rule-classes ((:rewrite)))
Theorem:
(defthm symbolp-of-car-when-member-equal-of-symbol-truelist-alistp (and (implies (and (symbol-truelist-alistp x) (member-equal a x)) (symbolp (car a))) (implies (and (member-equal a x) (symbol-truelist-alistp x)) (symbolp (car a)))) :rule-classes ((:rewrite)))
Theorem:
(defthm consp-when-member-equal-of-symbol-truelist-alistp (implies (and (symbol-truelist-alistp x) (member-equal a x)) (consp a)) :rule-classes ((:rewrite :backchain-limit-lst (0 0)) (:rewrite :backchain-limit-lst (0 0) :corollary (implies (if (member-equal a x) (symbol-truelist-alistp x) 'nil) (consp a)))))
Theorem:
(defthm symbol-truelist-alistp-of-remove-assoc (implies (symbol-truelist-alistp x) (symbol-truelist-alistp (remove-assoc-equal name x))) :rule-classes ((:rewrite)))
Theorem:
(defthm true-listp-of-cdr-of-assoc-when-symbol-truelist-alistp (implies (symbol-truelist-alistp x) (true-listp (cdr (assoc-equal k x)))) :rule-classes ((:rewrite)))
Theorem:
(defthm symbol-truelist-alistp-of-put-assoc (implies (and (symbol-truelist-alistp x)) (iff (symbol-truelist-alistp (put-assoc-equal name val x)) (and (symbolp name) (true-listp val)))) :rule-classes ((:rewrite)))
Theorem:
(defthm symbol-truelist-alistp-of-fast-alist-clean (implies (symbol-truelist-alistp x) (symbol-truelist-alistp (fast-alist-clean x))) :rule-classes ((:rewrite)))
Theorem:
(defthm symbol-truelist-alistp-of-hons-shrink-alist (implies (and (symbol-truelist-alistp x) (symbol-truelist-alistp y)) (symbol-truelist-alistp (hons-shrink-alist x y))) :rule-classes ((:rewrite)))
Theorem:
(defthm symbol-truelist-alistp-of-hons-acons (equal (symbol-truelist-alistp (hons-acons a n x)) (and (symbolp a) (true-listp n) (symbol-truelist-alistp x))) :rule-classes ((:rewrite)))
Theorem:
(defthm true-listp-of-cdr-of-hons-assoc-equal-when-symbol-truelist-alistp (implies (symbol-truelist-alistp x) (true-listp (cdr (hons-assoc-equal k x)))) :rule-classes ((:rewrite)))
Theorem:
(defthm alistp-when-symbol-truelist-alistp-rewrite (implies (symbol-truelist-alistp x) (alistp x)) :rule-classes ((:rewrite)))
Theorem:
(defthm alistp-when-symbol-truelist-alistp (implies (symbol-truelist-alistp x) (alistp x)) :rule-classes :tau-system)
Theorem:
(defthm true-listp-of-cdar-when-symbol-truelist-alistp (implies (symbol-truelist-alistp x) (true-listp (cdar x))) :rule-classes ((:rewrite)))
Theorem:
(defthm symbolp-of-caar-when-symbol-truelist-alistp (implies (symbol-truelist-alistp x) (symbolp (caar x))) :rule-classes ((:rewrite)))