(vl-rebuild-caselist x new-exprs new-stmts) → new-x
Function:
(defun vl-rebuild-caselist (x new-exprs new-stmts) (declare (xargs :guard (and (vl-caselist-p x) (vl-exprlist-p new-exprs) (vl-stmtlist-p new-stmts)))) (declare (xargs :guard (let ((x (vl-caselist-fix x))) (and (same-lengthp new-exprs (flatten (alist-keys x))) (same-lengthp new-stmts x))))) (let ((__function__ 'vl-rebuild-caselist)) (declare (ignorable __function__)) (b* ((x (vl-caselist-fix x)) ((when (atom x)) nil) ((cons match-exprs ?stmt) (car x)) (exprs1 (mbe :logic (append (vl-exprlist-fix (first-n (len match-exprs) new-exprs)) (acl2::final-cdr (caar x))) :exec (if (true-listp (caar x)) (first-n (len match-exprs) new-exprs) (append (first-n (len match-exprs) new-exprs) (acl2::final-cdr (caar x)))))) (stmt1 (vl-stmt-fix (car new-stmts))) (exprs2 (rest-n (len match-exprs) new-exprs))) (cons (cons exprs1 stmt1) (vl-rebuild-caselist (cdr x) exprs2 (cdr new-stmts))))))
Theorem:
(defthm vl-caselist-p-of-vl-rebuild-caselist (b* ((new-x (vl-rebuild-caselist x new-exprs new-stmts))) (vl-caselist-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm vl-rebuild-caselist-identity (implies (vl-caselist-p x) (equal (vl-rebuild-caselist x (flatten (alist-keys x)) (alist-vals x)) x)))
Theorem:
(defthm alist-vals-of-vl-rebuild-caselist (implies (and (vl-caselist-p x) (equal (len (alist-keys x)) (len stmts))) (equal (alist-vals (vl-rebuild-caselist x exprs stmts)) (vl-stmtlist-fix stmts))))
Theorem:
(defthm flatten-of-alist-keys-of-vl-rebuild-caselist (implies (and (vl-caselist-p x) (same-lengthp exprs (flatten (alist-keys x)))) (equal (flatten (alist-keys (vl-rebuild-caselist x exprs stmts))) (vl-exprlist-fix (list-fix exprs)))))
Theorem:
(defthm vl-rebuild-caselist-of-vl-caselist-fix-x (equal (vl-rebuild-caselist (vl-caselist-fix x) new-exprs new-stmts) (vl-rebuild-caselist x new-exprs new-stmts)))
Theorem:
(defthm vl-rebuild-caselist-vl-caselist-equiv-congruence-on-x (implies (vl-caselist-equiv x x-equiv) (equal (vl-rebuild-caselist x new-exprs new-stmts) (vl-rebuild-caselist x-equiv new-exprs new-stmts))) :rule-classes :congruence)
Theorem:
(defthm vl-rebuild-caselist-of-vl-exprlist-fix-new-exprs (equal (vl-rebuild-caselist x (vl-exprlist-fix new-exprs) new-stmts) (vl-rebuild-caselist x new-exprs new-stmts)))
Theorem:
(defthm vl-rebuild-caselist-vl-exprlist-equiv-congruence-on-new-exprs (implies (vl-exprlist-equiv new-exprs new-exprs-equiv) (equal (vl-rebuild-caselist x new-exprs new-stmts) (vl-rebuild-caselist x new-exprs-equiv new-stmts))) :rule-classes :congruence)
Theorem:
(defthm vl-rebuild-caselist-of-vl-stmtlist-fix-new-stmts (equal (vl-rebuild-caselist x new-exprs (vl-stmtlist-fix new-stmts)) (vl-rebuild-caselist x new-exprs new-stmts)))
Theorem:
(defthm vl-rebuild-caselist-vl-stmtlist-equiv-congruence-on-new-stmts (implies (vl-stmtlist-equiv new-stmts new-stmts-equiv) (equal (vl-rebuild-caselist x new-exprs new-stmts) (vl-rebuild-caselist x new-exprs new-stmts-equiv))) :rule-classes :congruence)