(vl-keyvallist-update-subexprs x subexprs) → new-x
Function:
(defun vl-keyvallist-update-subexprs (x subexprs) (declare (xargs :guard (and (vl-keyvallist-p x) (vl-exprlist-p subexprs)))) (declare (xargs :guard (equal (len subexprs) (len (vl-keyvallist->subexprs x))))) (let ((__function__ 'vl-keyvallist-update-subexprs)) (declare (ignorable __function__)) (b* ((x (vl-keyvallist-fix x))) (if (atom x) x (let* ((len (len (vl-patternkey->subexprs (caar x)))) (subexprs (vl-exprlist-fix subexprs))) (cons (cons (vl-patternkey-update-subexprs (caar x) (take len subexprs)) (vl-expr-fix (car (nthcdr len subexprs)))) (vl-keyvallist-update-subexprs (cdr x) (nthcdr (+ 1 len) subexprs))))))))
Theorem:
(defthm vl-keyvallist-p-of-vl-keyvallist-update-subexprs (b* ((new-x (vl-keyvallist-update-subexprs x subexprs))) (vl-keyvallist-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm vl-keyvallist-update-subexprs-identity (equal (vl-keyvallist-update-subexprs x (vl-keyvallist->subexprs x)) (vl-keyvallist-fix x)))
Theorem:
(defthm vl-keyvallist-update-subexprs-identity2 (implies (equal (len y) (len (vl-keyvallist->subexprs x))) (equal (vl-keyvallist->subexprs (vl-keyvallist-update-subexprs x y)) (vl-exprlist-fix y))))
Theorem:
(defthm vl-keyvallist-update-subexprs-of-vl-keyvallist-fix-x (equal (vl-keyvallist-update-subexprs (vl-keyvallist-fix x) subexprs) (vl-keyvallist-update-subexprs x subexprs)))
Theorem:
(defthm vl-keyvallist-update-subexprs-vl-keyvallist-equiv-congruence-on-x (implies (vl-keyvallist-equiv x x-equiv) (equal (vl-keyvallist-update-subexprs x subexprs) (vl-keyvallist-update-subexprs x-equiv subexprs))) :rule-classes :congruence)
Theorem:
(defthm vl-keyvallist-update-subexprs-of-vl-exprlist-fix-subexprs (equal (vl-keyvallist-update-subexprs x (vl-exprlist-fix subexprs)) (vl-keyvallist-update-subexprs x subexprs)))
Theorem:
(defthm vl-keyvallist-update-subexprs-vl-exprlist-equiv-congruence-on-subexprs (implies (vl-exprlist-equiv subexprs subexprs-equiv) (equal (vl-keyvallist-update-subexprs x subexprs) (vl-keyvallist-update-subexprs x subexprs-equiv))) :rule-classes :congruence)