(vl-expr-update-subexprs x subexprs) → new-x
Function:
(defun vl-expr-update-subexprs (x subexprs) (declare (xargs :guard (and (vl-expr-p x) (vl-exprlist-p subexprs)))) (declare (xargs :guard (equal (len subexprs) (len (vl-expr->subexprs x))))) (let ((__function__ 'vl-expr-update-subexprs)) (declare (ignorable __function__)) (let* ((subexprs (vl-exprlist-fix subexprs))) (vl-expr-case x :vl-index (b* ((nscopesubs (len (vl-scopeexpr->subexprs x.scope))) (nindices (len x.indices))) (change-vl-index x :scope (vl-scopeexpr-update-subexprs x.scope (take nscopesubs subexprs)) :indices (take nindices (nthcdr nscopesubs subexprs)) :part (vl-partselect-update-subexprs x.part (nthcdr (+ nindices nscopesubs) subexprs)))) :vl-unary (change-vl-unary x :arg (car subexprs)) :vl-binary (change-vl-binary x :left (car subexprs) :right (cadr subexprs)) :vl-qmark (change-vl-qmark x :test (car subexprs) :then (cadr subexprs) :else (caddr subexprs)) :vl-mintypmax (change-vl-mintypmax x :min (car subexprs) :typ (cadr subexprs) :max (caddr subexprs)) :vl-concat (change-vl-concat x :parts subexprs) :vl-multiconcat (change-vl-multiconcat x :reps (car subexprs) :parts (cdr subexprs)) :vl-bitselect-expr (change-vl-bitselect-expr x :subexp (car subexprs) :index (cadr subexprs)) :vl-partselect-expr (change-vl-partselect-expr x :subexp (car subexprs) :part (vl-partselect-update-subexprs x.part (cdr subexprs))) :vl-stream (let ((nsizeexprs (len (vl-slicesize->subexprs x.size)))) (change-vl-stream x :size (vl-slicesize-update-subexprs x.size (take nsizeexprs subexprs)) :parts (vl-streamexprlist-update-subexprs x.parts (nthcdr nsizeexprs subexprs)))) :vl-call (let* ((nnameexprs (len (vl-scopeexpr->subexprs x.name))) (plainargexprs (len (vl-maybe-exprlist->subexprs x.plainargs)))) (change-vl-call x :name (vl-scopeexpr-update-subexprs x.name (take nnameexprs subexprs)) :plainargs (vl-maybe-exprlist-update-subexprs x.plainargs (take plainargexprs (nthcdr nnameexprs subexprs))) :namedargs (vl-call-namedargs-update-subexprs x.namedargs (nthcdr (+ nnameexprs plainargexprs) subexprs)))) :vl-cast (vl-casttype-case x.to :size (change-vl-cast x :to (change-vl-casttype-size x.to :size (car subexprs)) :expr (cadr subexprs)) :otherwise (change-vl-cast x :expr (car subexprs))) :vl-inside (change-vl-inside x :elem (car subexprs) :set (vl-valuerangelist-update-subexprs x.set (cdr subexprs))) :vl-tagged (if x.expr (change-vl-tagged x :expr (car subexprs)) (vl-expr-fix x)) :vl-pattern (change-vl-pattern x :pat (vl-assignpat-update-subexprs x.pat subexprs)) :vl-eventexpr (change-vl-eventexpr x :atoms (vl-evatomlist-update-subexprs x.atoms subexprs)) :otherwise (vl-expr-fix x)))))
Theorem:
(defthm vl-expr-p-of-vl-expr-update-subexprs (b* ((new-x (vl-expr-update-subexprs x subexprs))) (vl-expr-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm vl-expr-update-subexprs-identity (equal (vl-expr-update-subexprs x (vl-expr->subexprs x)) (vl-expr-fix x)))
Theorem:
(defthm vl-expr->atts-of-vl-expr-update-subexprs (b* ((?new-x (vl-expr-update-subexprs x subexprs))) (equal (vl-expr->atts new-x) (vl-expr->atts x))))
Theorem:
(defthm vl-expr-kind-of-vl-expr-update-subexprs (b* ((?new-x (vl-expr-update-subexprs x subexprs))) (equal (vl-expr-kind new-x) (vl-expr-kind x))))
Theorem:
(defthm vl-expr-update-subexprs-identity2 (implies (equal (len y) (len (vl-expr->subexprs x))) (equal (vl-expr->subexprs (vl-expr-update-subexprs x y)) (vl-exprlist-fix y))))
Theorem:
(defthm vl-expr-update-subexprs-of-vl-expr-fix-x (equal (vl-expr-update-subexprs (vl-expr-fix x) subexprs) (vl-expr-update-subexprs x subexprs)))
Theorem:
(defthm vl-expr-update-subexprs-vl-expr-equiv-congruence-on-x (implies (vl-expr-equiv x x-equiv) (equal (vl-expr-update-subexprs x subexprs) (vl-expr-update-subexprs x-equiv subexprs))) :rule-classes :congruence)
Theorem:
(defthm vl-expr-update-subexprs-of-vl-exprlist-fix-subexprs (equal (vl-expr-update-subexprs x (vl-exprlist-fix subexprs)) (vl-expr-update-subexprs x subexprs)))
Theorem:
(defthm vl-expr-update-subexprs-vl-exprlist-equiv-congruence-on-subexprs (implies (vl-exprlist-equiv subexprs subexprs-equiv) (equal (vl-expr-update-subexprs x subexprs) (vl-expr-update-subexprs x subexprs-equiv))) :rule-classes :congruence)