(vl-find-description name descs) retrieves the first description named
(vl-find-description name descs) → *
This is the logically simplest expression of looking up a description, and is our preferred normal form for rewriting.
This function is not efficient. It carries out an
Function:
(defun vl-find-description (name descs) (declare (xargs :guard (and (stringp name) (vl-descriptionlist-p descs)))) (let ((__function__ 'vl-find-description)) (declare (ignorable __function__)) (b* (((when (atom descs)) nil) (desc1 (vl-description-fix (car descs))) (name1 (vl-description->name desc1)) ((when (and name1 (equal name name1))) desc1)) (vl-find-description name (cdr descs)))))
Theorem:
(defthm vl-find-description-when-atom (implies (atom descs) (equal (vl-find-description name descs) nil)))
Theorem:
(defthm vl-find-description-of-cons (equal (vl-find-description name (cons a x)) (if (and (vl-description->name a) (equal name (vl-description->name a))) (vl-description-fix a) (vl-find-description name x))))
Theorem:
(defthm vl-find-description-of-nil (equal (vl-find-description nil descs) nil))
Theorem:
(defthm vl-description-p-of-vl-find-description (equal (vl-description-p (vl-find-description name descs)) (if (member-equal name (vl-descriptionlist->names descs)) t nil)))
Theorem:
(defthm vl-find-description-under-iff (iff (vl-find-description name descs) (member-equal name (vl-descriptionlist->names descs))))
Theorem:
(defthm vl-description->name-of-vl-find-description (implies (vl-find-description name descs) (equal (vl-description->name (vl-find-description name descs)) (string-fix name))))
Theorem:
(defthm vl-find-description-of-vl-descriptionlist-fix-descs (equal (vl-find-description name (vl-descriptionlist-fix descs)) (vl-find-description name descs)))
Theorem:
(defthm vl-find-description-vl-descriptionlist-equiv-congruence-on-descs (implies (vl-descriptionlist-equiv descs descs-equiv) (equal (vl-find-description name descs) (vl-find-description name descs-equiv))) :rule-classes :congruence)