(sd-keylist->indicies x) maps sd-key->index across a list.
(sd-keylist->indicies x) → *
This is an ordinary defprojection.
Function:
(defun sd-keylist->indicies-exec (x acc) (declare (xargs :guard (sd-keylist-p x))) (let ((__function__ 'sd-keylist->indicies-exec)) (declare (ignorable __function__)) (if (consp x) (sd-keylist->indicies-exec (cdr x) (cons (sd-key->index (car x)) acc)) acc)))
Function:
(defun sd-keylist->indicies-nrev (x nrev) (declare (xargs :stobjs (nrev))) (declare (xargs :guard (sd-keylist-p x))) (let ((__function__ 'sd-keylist->indicies-nrev)) (declare (ignorable __function__)) (if (atom x) (nrev-fix nrev) (let ((nrev (nrev-push (sd-key->index (car x)) nrev))) (sd-keylist->indicies-nrev (cdr x) nrev)))))
Function:
(defun sd-keylist->indicies (x) (declare (xargs :guard (sd-keylist-p x))) (let ((__function__ 'sd-keylist->indicies)) (declare (ignorable __function__)) (mbe :logic (if (consp x) (cons (sd-key->index (car x)) (sd-keylist->indicies (cdr x))) nil) :exec (if (atom x) nil (with-local-nrev (sd-keylist->indicies-nrev x nrev))))))
Theorem:
(defthm sd-keylist->indicies-of-update-nth (implies (<= (nfix acl2::n) (len acl2::x)) (equal (sd-keylist->indicies (update-nth acl2::n acl2::v acl2::x)) (update-nth acl2::n (sd-key->index acl2::v) (sd-keylist->indicies acl2::x)))) :rule-classes ((:rewrite)))
Theorem:
(defthm sd-keylist->indicies-of-revappend (equal (sd-keylist->indicies (revappend acl2::x acl2::y)) (revappend (sd-keylist->indicies acl2::x) (sd-keylist->indicies acl2::y))) :rule-classes ((:rewrite)))
Theorem:
(defthm nthcdr-of-sd-keylist->indicies (equal (nthcdr acl2::n (sd-keylist->indicies acl2::x)) (sd-keylist->indicies (nthcdr acl2::n acl2::x))) :rule-classes ((:rewrite)))
Theorem:
(defthm nth-of-sd-keylist->indicies (equal (nth acl2::n (sd-keylist->indicies acl2::x)) (and (< (nfix acl2::n) (len acl2::x)) (sd-key->index (nth acl2::n acl2::x)))) :rule-classes ((:rewrite)))
Theorem:
(defthm sd-keylist->indicies-nrev-removal (equal (sd-keylist->indicies-nrev acl2::x nrev) (append nrev (sd-keylist->indicies acl2::x))) :rule-classes ((:rewrite)))
Theorem:
(defthm sd-keylist->indicies-exec-removal (equal (sd-keylist->indicies-exec acl2::x acl2::acc) (revappend (sd-keylist->indicies acl2::x) acl2::acc)) :rule-classes ((:rewrite)))
Theorem:
(defthm sd-keylist->indicies-of-take (implies (<= (nfix acl2::n) (len acl2::x)) (equal (sd-keylist->indicies (take acl2::n acl2::x)) (take acl2::n (sd-keylist->indicies acl2::x)))) :rule-classes ((:rewrite)))
Theorem:
(defthm set-equiv-congruence-over-sd-keylist->indicies (implies (set-equiv acl2::x acl2::y) (set-equiv (sd-keylist->indicies acl2::x) (sd-keylist->indicies acl2::y))) :rule-classes ((:congruence)))
Theorem:
(defthm subsetp-of-sd-keylist->indicies-when-subsetp (implies (subsetp acl2::x acl2::y) (subsetp (sd-keylist->indicies acl2::x) (sd-keylist->indicies acl2::y))) :rule-classes ((:rewrite)))
Theorem:
(defthm member-of-sd-key->index-in-sd-keylist->indicies (implies (member acl2::k acl2::x) (member (sd-key->index acl2::k) (sd-keylist->indicies acl2::x))) :rule-classes ((:rewrite)))
Theorem:
(defthm sd-keylist->indicies-of-rev (equal (sd-keylist->indicies (rev acl2::x)) (rev (sd-keylist->indicies acl2::x))) :rule-classes ((:rewrite)))
Theorem:
(defthm sd-keylist->indicies-of-list-fix (equal (sd-keylist->indicies (list-fix acl2::x)) (sd-keylist->indicies acl2::x)) :rule-classes ((:rewrite)))
Theorem:
(defthm sd-keylist->indicies-of-append (equal (sd-keylist->indicies (append acl2::a acl2::b)) (append (sd-keylist->indicies acl2::a) (sd-keylist->indicies acl2::b))) :rule-classes ((:rewrite)))
Theorem:
(defthm cdr-of-sd-keylist->indicies (equal (cdr (sd-keylist->indicies acl2::x)) (sd-keylist->indicies (cdr acl2::x))) :rule-classes ((:rewrite)))
Theorem:
(defthm car-of-sd-keylist->indicies (equal (car (sd-keylist->indicies acl2::x)) (and (consp acl2::x) (sd-key->index (car acl2::x)))) :rule-classes ((:rewrite)))
Theorem:
(defthm sd-keylist->indicies-under-iff (iff (sd-keylist->indicies acl2::x) (consp acl2::x)) :rule-classes ((:rewrite)))
Theorem:
(defthm consp-of-sd-keylist->indicies (equal (consp (sd-keylist->indicies acl2::x)) (consp acl2::x)) :rule-classes ((:rewrite)))
Theorem:
(defthm len-of-sd-keylist->indicies (equal (len (sd-keylist->indicies acl2::x)) (len acl2::x)) :rule-classes ((:rewrite)))
Theorem:
(defthm true-listp-of-sd-keylist->indicies (true-listp (sd-keylist->indicies acl2::x)) :rule-classes :type-prescription)
Theorem:
(defthm sd-keylist->indicies-when-not-consp (implies (not (consp acl2::x)) (equal (sd-keylist->indicies acl2::x) nil)) :rule-classes ((:rewrite)))
Theorem:
(defthm sd-keylist->indicies-of-cons (equal (sd-keylist->indicies (cons acl2::a acl2::b)) (cons (sd-key->index acl2::a) (sd-keylist->indicies acl2::b))) :rule-classes ((:rewrite)))