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