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