Heuristically estimate an expression's size.
(vl-expr-probable-selfsize x ss) → size
There's no reason to believe the size it returns will be the
eventual size of the expression because size propagation hasn't been taken into
account; in fact we may just fail and return
On the other hand, I think it should be the case that the final size of the
expression will always be at least as much as this selfsize, if it returns a
non-
Function:
(defun vl-expr-probable-selfsize (x ss) (declare (xargs :guard (and (vl-expr-p x) (vl-scopestack-p ss)))) (let ((__function__ 'vl-expr-probable-selfsize)) (declare (ignorable __function__)) (b* (((mv & size) (vl-expr-selfsize x ss (vl-elabscopes-init-ss ss)))) size)))
Theorem:
(defthm maybe-natp-of-vl-expr-probable-selfsize (b* ((size (vl-expr-probable-selfsize x ss))) (maybe-natp size)) :rule-classes :type-prescription)
Theorem:
(defthm vl-expr-probable-selfsize-of-vl-expr-fix-x (equal (vl-expr-probable-selfsize (vl-expr-fix x) ss) (vl-expr-probable-selfsize x ss)))
Theorem:
(defthm vl-expr-probable-selfsize-vl-expr-equiv-congruence-on-x (implies (vl-expr-equiv x x-equiv) (equal (vl-expr-probable-selfsize x ss) (vl-expr-probable-selfsize x-equiv ss))) :rule-classes :congruence)
Theorem:
(defthm vl-expr-probable-selfsize-of-vl-scopestack-fix-ss (equal (vl-expr-probable-selfsize x (vl-scopestack-fix ss)) (vl-expr-probable-selfsize x ss)))
Theorem:
(defthm vl-expr-probable-selfsize-vl-scopestack-equiv-congruence-on-ss (implies (vl-scopestack-equiv ss ss-equiv) (equal (vl-expr-probable-selfsize x ss) (vl-expr-probable-selfsize x ss-equiv))) :rule-classes :congruence)