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