Substitute into a vl-expr-p.
(vl-expr-subst x sigma) → new-x
We substitute into an expression, replacing any simple
identifiers (i.e., atoms which are vl-id-p's) that are bound in
Note that this function does not descend into attributes. It is not clear whether that is the right behavior, but it seems that the handling of attributes is left up to the implementation.
Theorem:
(defthm return-type-of-vl-expr-subst.new-x (b* ((?new-x (vl-expr-subst x sigma))) (vl-expr-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm return-type-of-vl-exprlist-subst.new-x (b* ((?new-x (vl-exprlist-subst x sigma))) (and (vl-exprlist-p new-x) (equal (len new-x) (len x)))) :rule-classes :rewrite)
Theorem:
(defthm vl-exprlist-subst-of-update-nth (implies (<= (nfix acl2::n) (len acl2::x)) (equal (vl-exprlist-subst (update-nth acl2::n acl2::v acl2::x) sigma) (update-nth acl2::n (vl-expr-subst acl2::v sigma) (vl-exprlist-subst acl2::x sigma)))) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-exprlist-subst-of-revappend (equal (vl-exprlist-subst (revappend acl2::x acl2::y) sigma) (revappend (vl-exprlist-subst acl2::x sigma) (vl-exprlist-subst acl2::y sigma))) :rule-classes ((:rewrite)))
Theorem:
(defthm nthcdr-of-vl-exprlist-subst (equal (nthcdr acl2::n (vl-exprlist-subst acl2::x sigma)) (vl-exprlist-subst (nthcdr acl2::n acl2::x) sigma)) :rule-classes ((:rewrite)))
Theorem:
(defthm nth-of-vl-exprlist-subst (equal (nth acl2::n (vl-exprlist-subst acl2::x sigma)) (and (< (nfix acl2::n) (len acl2::x)) (vl-expr-subst (nth acl2::n acl2::x) sigma))) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-exprlist-subst-of-take (implies (<= (nfix acl2::n) (len acl2::x)) (equal (vl-exprlist-subst (take acl2::n acl2::x) sigma) (take acl2::n (vl-exprlist-subst acl2::x sigma)))) :rule-classes ((:rewrite)))
Theorem:
(defthm set-equiv-congruence-over-vl-exprlist-subst (implies (set-equiv acl2::x acl2::y) (set-equiv (vl-exprlist-subst acl2::x sigma) (vl-exprlist-subst acl2::y sigma))) :rule-classes ((:congruence)))
Theorem:
(defthm subsetp-of-vl-exprlist-subst-when-subsetp (implies (subsetp acl2::x acl2::y) (subsetp (vl-exprlist-subst acl2::x sigma) (vl-exprlist-subst acl2::y sigma))) :rule-classes ((:rewrite)))
Theorem:
(defthm member-of-vl-expr-subst-in-vl-exprlist-subst (implies (member acl2::k acl2::x) (member (vl-expr-subst acl2::k sigma) (vl-exprlist-subst acl2::x sigma))) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-exprlist-subst-of-rev (equal (vl-exprlist-subst (rev acl2::x) sigma) (rev (vl-exprlist-subst acl2::x sigma))) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-exprlist-subst-of-list-fix (equal (vl-exprlist-subst (list-fix acl2::x) sigma) (vl-exprlist-subst acl2::x sigma)) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-exprlist-subst-of-append (equal (vl-exprlist-subst (append acl2::a acl2::b) sigma) (append (vl-exprlist-subst acl2::a sigma) (vl-exprlist-subst acl2::b sigma))) :rule-classes ((:rewrite)))
Theorem:
(defthm cdr-of-vl-exprlist-subst (equal (cdr (vl-exprlist-subst acl2::x sigma)) (vl-exprlist-subst (cdr acl2::x) sigma)) :rule-classes ((:rewrite)))
Theorem:
(defthm car-of-vl-exprlist-subst (equal (car (vl-exprlist-subst acl2::x sigma)) (and (consp acl2::x) (vl-expr-subst (car acl2::x) sigma))) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-exprlist-subst-under-iff (iff (vl-exprlist-subst acl2::x sigma) (consp acl2::x)) :rule-classes ((:rewrite)))
Theorem:
(defthm consp-of-vl-exprlist-subst (equal (consp (vl-exprlist-subst acl2::x sigma)) (consp acl2::x)) :rule-classes ((:rewrite)))
Theorem:
(defthm len-of-vl-exprlist-subst (equal (len (vl-exprlist-subst acl2::x sigma)) (len acl2::x)) :rule-classes ((:rewrite)))
Theorem:
(defthm true-listp-of-vl-exprlist-subst (true-listp (vl-exprlist-subst acl2::x sigma)) :rule-classes :type-prescription)
Theorem:
(defthm vl-exprlist-subst-when-not-consp (implies (not (consp acl2::x)) (equal (vl-exprlist-subst acl2::x sigma) nil)) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-exprlist-subst-of-cons (equal (vl-exprlist-subst (cons acl2::a acl2::b) sigma) (cons (vl-expr-subst acl2::a sigma) (vl-exprlist-subst acl2::b sigma))) :rule-classes ((:rewrite)))
Theorem:
(defthm vl-expr-subst-of-vl-expr-fix-x (equal (vl-expr-subst (vl-expr-fix x) sigma) (vl-expr-subst x sigma)))
Theorem:
(defthm vl-expr-subst-of-vl-sigma-fix-sigma (equal (vl-expr-subst x (vl-sigma-fix sigma)) (vl-expr-subst x sigma)))
Theorem:
(defthm vl-exprlist-subst-of-vl-exprlist-fix-x (equal (vl-exprlist-subst (vl-exprlist-fix x) sigma) (vl-exprlist-subst x sigma)))
Theorem:
(defthm vl-exprlist-subst-of-vl-sigma-fix-sigma (equal (vl-exprlist-subst x (vl-sigma-fix sigma)) (vl-exprlist-subst x sigma)))
Theorem:
(defthm vl-expr-subst-vl-expr-equiv-congruence-on-x (implies (vl-expr-equiv x x-equiv) (equal (vl-expr-subst x sigma) (vl-expr-subst x-equiv sigma))) :rule-classes :congruence)
Theorem:
(defthm vl-expr-subst-vl-sigma-equiv-congruence-on-sigma (implies (vl-sigma-equiv sigma sigma-equiv) (equal (vl-expr-subst x sigma) (vl-expr-subst x sigma-equiv))) :rule-classes :congruence)
Theorem:
(defthm vl-exprlist-subst-vl-exprlist-equiv-congruence-on-x (implies (vl-exprlist-equiv x x-equiv) (equal (vl-exprlist-subst x sigma) (vl-exprlist-subst x-equiv sigma))) :rule-classes :congruence)
Theorem:
(defthm vl-exprlist-subst-vl-sigma-equiv-congruence-on-sigma (implies (vl-sigma-equiv sigma sigma-equiv) (equal (vl-exprlist-subst x sigma) (vl-exprlist-subst x sigma-equiv))) :rule-classes :congruence)
Theorem:
(defthm consp-of-vl-expr-subst (consp (vl-expr-subst x sigma)) :rule-classes :type-prescription)