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