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