Find the block from a generate array corresponding to some index.
(vl-genblocklist-find-block idx x) → blk
Function:
(defun vl-genblocklist-find-block (idx x) (declare (xargs :guard (and (integerp idx) (vl-genblocklist-p x)))) (let ((__function__ 'vl-genblocklist-find-block)) (declare (ignorable __function__)) (cond ((atom x) nil) ((eql (vl-genblock->name (car x)) (lifix idx)) (vl-genblock-fix (car x))) (t (vl-genblocklist-find-block idx (cdr x))))))
Theorem:
(defthm return-type-of-vl-genblocklist-find-block (b* ((blk (vl-genblocklist-find-block idx x))) (iff (vl-genblock-p blk) blk)) :rule-classes :rewrite)
Theorem:
(defthm vl-genblocklist-find-block-of-ifix-idx (equal (vl-genblocklist-find-block (ifix idx) x) (vl-genblocklist-find-block idx x)))
Theorem:
(defthm vl-genblocklist-find-block-int-equiv-congruence-on-idx (implies (acl2::int-equiv idx idx-equiv) (equal (vl-genblocklist-find-block idx x) (vl-genblocklist-find-block idx-equiv x))) :rule-classes :congruence)
Theorem:
(defthm vl-genblocklist-find-block-of-vl-genblocklist-fix-x (equal (vl-genblocklist-find-block idx (vl-genblocklist-fix x)) (vl-genblocklist-find-block idx x)))
Theorem:
(defthm vl-genblocklist-find-block-vl-genblocklist-equiv-congruence-on-x (implies (vl-genblocklist-equiv x x-equiv) (equal (vl-genblocklist-find-block idx x) (vl-genblocklist-find-block idx x-equiv))) :rule-classes :congruence)