(vcd-idxhash-p x len) recognizes association lists where every key satisfies vcd-index-p and each value satisfies not.
This is an ordinary defalist.
Function:
(defun vcd-idxhash-p (x len) (declare (xargs :guard (natp len))) (if (consp x) (and (consp (car x)) (vcd-index-p (caar x) len) (not (cdar x)) (vcd-idxhash-p (cdr x) len)) t))
Function:
(defun vcd-idxhash-p (x len) (declare (xargs :guard (natp len))) (if (consp x) (and (consp (car x)) (vcd-index-p (caar x) len) (not (cdar x)) (vcd-idxhash-p (cdr x) len)) t))
Theorem:
(defthm vcd-idxhash-p-of-revappend (equal (vcd-idxhash-p (revappend acl2::x acl2::y) len) (and (vcd-idxhash-p (list-fix acl2::x) len) (vcd-idxhash-p acl2::y len))) :rule-classes ((:rewrite)))
Theorem:
(defthm vcd-idxhash-p-of-remove (implies (vcd-idxhash-p acl2::x len) (vcd-idxhash-p (remove acl2::a acl2::x) len)) :rule-classes ((:rewrite)))
Theorem:
(defthm vcd-idxhash-p-of-last (implies (vcd-idxhash-p (double-rewrite acl2::x) len) (vcd-idxhash-p (last acl2::x) len)) :rule-classes ((:rewrite)))
Theorem:
(defthm vcd-idxhash-p-of-nthcdr (implies (vcd-idxhash-p (double-rewrite acl2::x) len) (vcd-idxhash-p (nthcdr acl2::n acl2::x) len)) :rule-classes ((:rewrite)))
Theorem:
(defthm vcd-idxhash-p-of-butlast (implies (vcd-idxhash-p (double-rewrite acl2::x) len) (vcd-idxhash-p (butlast acl2::x acl2::n) len)) :rule-classes ((:rewrite)))
Theorem:
(defthm vcd-idxhash-p-of-update-nth (implies (vcd-idxhash-p (double-rewrite acl2::x) len) (iff (vcd-idxhash-p (update-nth acl2::n acl2::y acl2::x) len) (and (and (consp acl2::y) (vcd-index-p (car acl2::y) len) (not (cdr acl2::y))) (or (<= (nfix acl2::n) (len acl2::x)) (and (consp nil) (vcd-index-p (car nil) len) (not (cdr nil))))))) :rule-classes ((:rewrite)))
Theorem:
(defthm vcd-idxhash-p-of-repeat (iff (vcd-idxhash-p (repeat acl2::n acl2::x) len) (or (and (consp acl2::x) (vcd-index-p (car acl2::x) len) (not (cdr acl2::x))) (zp acl2::n))) :rule-classes ((:rewrite)))
Theorem:
(defthm vcd-idxhash-p-of-take (implies (vcd-idxhash-p (double-rewrite acl2::x) len) (iff (vcd-idxhash-p (take acl2::n acl2::x) len) (or (and (consp nil) (vcd-index-p (car nil) len) (not (cdr nil))) (<= (nfix acl2::n) (len acl2::x))))) :rule-classes ((:rewrite)))
Theorem:
(defthm vcd-idxhash-p-of-union-equal (equal (vcd-idxhash-p (union-equal acl2::x acl2::y) len) (and (vcd-idxhash-p (list-fix acl2::x) len) (vcd-idxhash-p (double-rewrite acl2::y) len))) :rule-classes ((:rewrite)))
Theorem:
(defthm vcd-idxhash-p-of-intersection-equal-2 (implies (vcd-idxhash-p (double-rewrite acl2::y) len) (vcd-idxhash-p (intersection-equal acl2::x acl2::y) len)) :rule-classes ((:rewrite)))
Theorem:
(defthm vcd-idxhash-p-of-intersection-equal-1 (implies (vcd-idxhash-p (double-rewrite acl2::x) len) (vcd-idxhash-p (intersection-equal acl2::x acl2::y) len)) :rule-classes ((:rewrite)))
Theorem:
(defthm vcd-idxhash-p-of-set-difference-equal (implies (vcd-idxhash-p acl2::x len) (vcd-idxhash-p (set-difference-equal acl2::x acl2::y) len)) :rule-classes ((:rewrite)))
Theorem:
(defthm vcd-idxhash-p-set-equiv-congruence (implies (set-equiv acl2::x acl2::y) (equal (vcd-idxhash-p acl2::x len) (vcd-idxhash-p acl2::y len))) :rule-classes :congruence)
Theorem:
(defthm vcd-idxhash-p-when-subsetp-equal (and (implies (and (subsetp-equal acl2::x acl2::y) (vcd-idxhash-p acl2::y len)) (vcd-idxhash-p acl2::x len)) (implies (and (vcd-idxhash-p acl2::y len) (subsetp-equal acl2::x acl2::y)) (vcd-idxhash-p acl2::x len))) :rule-classes ((:rewrite)))
Theorem:
(defthm vcd-idxhash-p-of-rcons (iff (vcd-idxhash-p (acl2::rcons acl2::a acl2::x) len) (and (and (consp acl2::a) (vcd-index-p (car acl2::a) len) (not (cdr acl2::a))) (vcd-idxhash-p (list-fix acl2::x) len))) :rule-classes ((:rewrite)))
Theorem:
(defthm vcd-idxhash-p-of-rev (equal (vcd-idxhash-p (rev acl2::x) len) (vcd-idxhash-p (list-fix acl2::x) len)) :rule-classes ((:rewrite)))
Theorem:
(defthm vcd-idxhash-p-of-duplicated-members (implies (vcd-idxhash-p acl2::x len) (vcd-idxhash-p (duplicated-members acl2::x) len)) :rule-classes ((:rewrite)))
Theorem:
(defthm vcd-idxhash-p-of-difference (implies (vcd-idxhash-p acl2::x len) (vcd-idxhash-p (difference acl2::x acl2::y) len)) :rule-classes ((:rewrite)))
Theorem:
(defthm vcd-idxhash-p-of-intersect-2 (implies (vcd-idxhash-p acl2::y len) (vcd-idxhash-p (intersect acl2::x acl2::y) len)) :rule-classes ((:rewrite)))
Theorem:
(defthm vcd-idxhash-p-of-intersect-1 (implies (vcd-idxhash-p acl2::x len) (vcd-idxhash-p (intersect acl2::x acl2::y) len)) :rule-classes ((:rewrite)))
Theorem:
(defthm vcd-idxhash-p-of-union (iff (vcd-idxhash-p (union acl2::x acl2::y) len) (and (vcd-idxhash-p (sfix acl2::x) len) (vcd-idxhash-p (sfix acl2::y) len))) :rule-classes ((:rewrite)))
Theorem:
(defthm vcd-idxhash-p-of-mergesort (iff (vcd-idxhash-p (mergesort acl2::x) len) (vcd-idxhash-p (list-fix acl2::x) len)) :rule-classes ((:rewrite)))
Theorem:
(defthm vcd-idxhash-p-of-delete (implies (vcd-idxhash-p acl2::x len) (vcd-idxhash-p (delete acl2::k acl2::x) len)) :rule-classes ((:rewrite)))
Theorem:
(defthm vcd-idxhash-p-of-insert (iff (vcd-idxhash-p (insert acl2::a acl2::x) len) (and (vcd-idxhash-p (sfix acl2::x) len) (and (consp acl2::a) (vcd-index-p (car acl2::a) len) (not (cdr acl2::a))))) :rule-classes ((:rewrite)))
Theorem:
(defthm vcd-idxhash-p-of-sfix (iff (vcd-idxhash-p (sfix acl2::x) len) (or (vcd-idxhash-p acl2::x len) (not (setp acl2::x)))) :rule-classes ((:rewrite)))
Theorem:
(defthm vcd-idxhash-p-of-list-fix (equal (vcd-idxhash-p (list-fix acl2::x) len) (vcd-idxhash-p acl2::x len)) :rule-classes ((:rewrite)))
Theorem:
(defthm vcd-idxhash-p-of-append (equal (vcd-idxhash-p (append acl2::a acl2::b) len) (and (vcd-idxhash-p acl2::a len) (vcd-idxhash-p acl2::b len))) :rule-classes ((:rewrite)))
Theorem:
(defthm vcd-idxhash-p-when-not-consp (implies (not (consp acl2::x)) (vcd-idxhash-p acl2::x len)) :rule-classes ((:rewrite)))
Theorem:
(defthm vcd-idxhash-p-of-cdr-when-vcd-idxhash-p (implies (vcd-idxhash-p (double-rewrite acl2::x) len) (vcd-idxhash-p (cdr acl2::x) len)) :rule-classes ((:rewrite)))
Theorem:
(defthm vcd-idxhash-p-of-cons (equal (vcd-idxhash-p (cons acl2::a acl2::x) len) (and (and (consp acl2::a) (vcd-index-p (car acl2::a) len) (not (cdr acl2::a))) (vcd-idxhash-p acl2::x len))) :rule-classes ((:rewrite)))
Theorem:
(defthm vcd-idxhash-p-of-make-fal (implies (and (vcd-idxhash-p acl2::x len) (vcd-idxhash-p acl2::y len)) (vcd-idxhash-p (make-fal acl2::x acl2::y) len)) :rule-classes ((:rewrite)))
Theorem:
(defthm not-of-cdr-when-member-equal-of-vcd-idxhash-p (and (implies (and (vcd-idxhash-p acl2::x len) (member-equal acl2::a acl2::x)) (not (cdr acl2::a))) (implies (and (member-equal acl2::a acl2::x) (vcd-idxhash-p acl2::x len)) (not (cdr acl2::a)))) :rule-classes ((:rewrite)))
Theorem:
(defthm vcd-index-p-of-car-when-member-equal-of-vcd-idxhash-p (and (implies (and (vcd-idxhash-p acl2::x len) (member-equal acl2::a acl2::x)) (vcd-index-p (car acl2::a) len)) (implies (and (member-equal acl2::a acl2::x) (vcd-idxhash-p acl2::x len)) (vcd-index-p (car acl2::a) len))) :rule-classes ((:rewrite)))
Theorem:
(defthm consp-when-member-equal-of-vcd-idxhash-p (implies (and (vcd-idxhash-p acl2::x len) (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) (vcd-idxhash-p acl2::x len) 'nil) (consp acl2::a)))))
Theorem:
(defthm not-of-cdr-of-assoc-when-vcd-idxhash-p (implies (vcd-idxhash-p acl2::x len) (not (cdr (assoc-equal acl2::k acl2::x)))) :rule-classes ((:rewrite)))
Theorem:
(defthm vcd-idxhash-p-of-fast-alist-clean (implies (vcd-idxhash-p acl2::x len) (vcd-idxhash-p (fast-alist-clean acl2::x) len)) :rule-classes ((:rewrite)))
Theorem:
(defthm vcd-idxhash-p-of-hons-shrink-alist (implies (and (vcd-idxhash-p acl2::x len) (vcd-idxhash-p acl2::y len)) (vcd-idxhash-p (hons-shrink-alist acl2::x acl2::y) len)) :rule-classes ((:rewrite)))
Theorem:
(defthm vcd-idxhash-p-of-hons-acons (equal (vcd-idxhash-p (hons-acons acl2::a acl2::n acl2::x) len) (and (vcd-index-p acl2::a len) (not acl2::n) (vcd-idxhash-p acl2::x len))) :rule-classes ((:rewrite)))
Theorem:
(defthm not-of-cdr-of-hons-assoc-equal-when-vcd-idxhash-p (implies (vcd-idxhash-p acl2::x len) (not (cdr (hons-assoc-equal acl2::k acl2::x)))) :rule-classes ((:rewrite)))
Theorem:
(defthm vcd-index-p-of-caar-when-vcd-idxhash-p (implies (vcd-idxhash-p acl2::x len) (iff (vcd-index-p (caar acl2::x) len) (consp acl2::x))) :rule-classes ((:rewrite)))
Theorem:
(defthm not-of-cdar-when-vcd-idxhash-p (implies (vcd-idxhash-p acl2::x len) (not (cdar acl2::x))) :rule-classes ((:rewrite)))