Naive, O(n) lookup of a vl-paramdecl in a list by its name.
(vl-find-paramdecl name x) → paramdecl?
Function:
(defun vl-find-paramdecl (name x) (declare (xargs :guard (and (stringp name) (vl-paramdecllist-p x)))) (let ((__function__ 'vl-find-paramdecl)) (declare (ignorable __function__)) (cond ((atom x) nil) ((equal (string-fix name) (vl-paramdecl->name (car x))) (vl-paramdecl-fix (car x))) (t (vl-find-paramdecl name (cdr x))))))
Theorem:
(defthm return-type-of-vl-find-paramdecl (b* ((paramdecl? (vl-find-paramdecl name x))) (iff (vl-paramdecl-p paramdecl?) paramdecl?)) :rule-classes :rewrite)
Theorem:
(defthm vl-find-paramdecl-under-iff (iff (vl-find-paramdecl name x) (member-equal (string-fix name) (vl-paramdecllist->names x))))
Theorem:
(defthm vl-paramdecl->name-of-vl-find-paramdecl (implies (vl-find-paramdecl name x) (equal (vl-paramdecl->name (vl-find-paramdecl name x)) (string-fix name))))
Theorem:
(defthm tag-of-vl-find-paramdecl (equal (tag (vl-find-paramdecl name x)) (if (vl-find-paramdecl name x) :vl-paramdecl nil)))
Theorem:
(defthm member-equal-of-vl-find-paramdecl (implies (force (vl-paramdecllist-p x)) (iff (member-equal (vl-find-paramdecl name x) x) (vl-find-paramdecl name x))))
Theorem:
(defthm consp-of-vl-find-paramdecl-when-member-equal (implies (and (member-equal name (vl-paramdecllist->names x)) (force (stringp name))) (consp (vl-find-paramdecl name x))))
Theorem:
(defthm vl-find-paramdecl-of-str-fix-name (equal (vl-find-paramdecl (str-fix name) x) (vl-find-paramdecl name x)))
Theorem:
(defthm vl-find-paramdecl-streqv-congruence-on-name (implies (streqv name name-equiv) (equal (vl-find-paramdecl name x) (vl-find-paramdecl name-equiv x))) :rule-classes :congruence)
Theorem:
(defthm vl-find-paramdecl-of-vl-paramdecllist-fix-x (equal (vl-find-paramdecl name (vl-paramdecllist-fix x)) (vl-find-paramdecl name x)))
Theorem:
(defthm vl-find-paramdecl-vl-paramdecllist-equiv-congruence-on-x (implies (vl-paramdecllist-equiv x x-equiv) (equal (vl-find-paramdecl name x) (vl-find-paramdecl name x-equiv))) :rule-classes :congruence)