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