Gather initial candidates for propagation.
(candidates-for-propagation x limits) → sigma
We're basically just looking for assignments like:
assign identifier = expr;
These are just initial candidates, and later we'll eliminate some of them because propagation would be too hard.
Function:
(defun candidates-for-propagation (x limits) (declare (xargs :guard (and (vl-assignlist-p x) (propagate-limits-p limits)))) (let ((__function__ 'candidates-for-propagation)) (declare (ignorable __function__)) (b* (((when (atom x)) nil) ((vl-assign x1) (car x)) ((when (and (vl-idexpr-p x1.lvalue) (propagate-expr-limits-okp x1.expr limits))) (cons (cons (vl-idexpr->name x1.lvalue) x1.expr) (candidates-for-propagation (cdr x) limits)))) (candidates-for-propagation (cdr x) limits))))
Theorem:
(defthm vl-sigma-p-of-candidates-for-propagation (implies (force (vl-assignlist-p x)) (b* ((sigma (candidates-for-propagation x limits))) (vl-sigma-p sigma))) :rule-classes :rewrite)
Theorem:
(defthm alistp-of-candidates-for-propagation (alistp (candidates-for-propagation x limits)))