Filter port declarations by direction.
(vl-portdecls-with-dir dir x) → sub-x
Function:
(defun vl-portdecls-with-dir (dir x) (declare (xargs :guard (and (vl-direction-p dir) (vl-portdecllist-p x)))) (let ((__function__ 'vl-portdecls-with-dir)) (declare (ignorable __function__)) (cond ((atom x) nil) ((eq (vl-direction-fix dir) (vl-portdecl->dir (car x))) (cons (vl-portdecl-fix (car x)) (vl-portdecls-with-dir dir (cdr x)))) (t (vl-portdecls-with-dir dir (cdr x))))))
Theorem:
(defthm vl-portdecllist-p-of-vl-portdecls-with-dir (b* ((sub-x (vl-portdecls-with-dir dir x))) (vl-portdecllist-p sub-x)) :rule-classes :rewrite)
Theorem:
(defthm vl-portdecls-with-dir-of-vl-direction-fix-dir (equal (vl-portdecls-with-dir (vl-direction-fix dir) x) (vl-portdecls-with-dir dir x)))
Theorem:
(defthm vl-portdecls-with-dir-vl-direction-equiv-congruence-on-dir (implies (vl-direction-equiv dir dir-equiv) (equal (vl-portdecls-with-dir dir x) (vl-portdecls-with-dir dir-equiv x))) :rule-classes :congruence)
Theorem:
(defthm vl-portdecls-with-dir-of-vl-portdecllist-fix-x (equal (vl-portdecls-with-dir dir (vl-portdecllist-fix x)) (vl-portdecls-with-dir dir x)))
Theorem:
(defthm vl-portdecls-with-dir-vl-portdecllist-equiv-congruence-on-x (implies (vl-portdecllist-equiv x x-equiv) (equal (vl-portdecls-with-dir dir x) (vl-portdecls-with-dir dir x-equiv))) :rule-classes :congruence)