A measure for recurring over expressions but ignoring attributes.
(vl-expr-count-noatts x) → *
Theorem:
(defthm vl-exprlist-count-noatts-of-cons (equal (vl-exprlist-count-noatts (cons a x)) (+ 1 (vl-expr-count-noatts a) (vl-exprlist-count-noatts x))))
Theorem:
(defthm vl-expr-count-noatts-of-car-weak (<= (vl-expr-count-noatts (car x)) (vl-exprlist-count-noatts x)) :rule-classes ((:rewrite) (:linear)))
Theorem:
(defthm vl-expr-count-noatts-of-car-strong (implies (consp x) (< (vl-expr-count-noatts (car x)) (vl-exprlist-count-noatts x))) :rule-classes ((:rewrite) (:linear)))
Theorem:
(defthm vl-expr-kind-when-vl-expr-count-noatts-is-1-fwd (implies (equal (vl-expr-count-noatts x) 1) (equal (vl-expr-kind x) :atom)) :rule-classes ((:forward-chaining)))
Theorem:
(defthm vl-exprlist-count-noatts-of-cdr-weak (<= (vl-exprlist-count-noatts (cdr x)) (vl-exprlist-count-noatts x)) :rule-classes ((:rewrite) (:linear)))
Theorem:
(defthm vl-exprlist-count-noatts-of-cdr-strong (implies (consp x) (< (vl-exprlist-count-noatts (cdr x)) (vl-exprlist-count-noatts x))) :rule-classes ((:rewrite) (:linear)))
Theorem:
(defthm vl-exprlist-count-noatts-of-vl-nonatom->args-strong (implies (equal (vl-expr-kind x) :nonatom) (< (vl-exprlist-count-noatts (vl-nonatom->args x)) (vl-expr-count-noatts x))) :rule-classes ((:rewrite) (:linear)))
Theorem:
(defthm vl-expr-count-noatts-of-vl-expr-fix-x (equal (vl-expr-count-noatts (vl-expr-fix x)) (vl-expr-count-noatts x)))
Theorem:
(defthm vl-exprlist-count-noatts-of-vl-exprlist-fix-x (equal (vl-exprlist-count-noatts (vl-exprlist-fix x)) (vl-exprlist-count-noatts x)))
Theorem:
(defthm vl-expr-count-noatts-vl-expr-equiv-congruence-on-x (implies (vl-expr-equiv x x-equiv) (equal (vl-expr-count-noatts x) (vl-expr-count-noatts x-equiv))) :rule-classes :congruence)
Theorem:
(defthm vl-exprlist-count-noatts-vl-exprlist-equiv-congruence-on-x (implies (vl-exprlist-equiv x x-equiv) (equal (vl-exprlist-count-noatts x) (vl-exprlist-count-noatts x-equiv))) :rule-classes :congruence)