Alternative to vl-find-file that can take a list of extensions.
(vl-find-basename/extension filename extensions searchcache warnings) → (mv realpath warnings)
Function:
(defun vl-find-basename/extension (filename extensions searchcache warnings) (declare (xargs :guard (and (stringp filename) (string-listp extensions) (vl-dirxlist-cache-p searchcache) (vl-warninglist-p warnings)))) (let ((__function__ 'vl-find-basename/extension)) (declare (ignorable __function__)) (b* ((searchcache (vl-dirxlist-cache-fix searchcache)) ((when (atom searchcache)) (mv nil (ok))) ((cons dir dirxcache) (car searchcache)) ((mv realfile warnings) (vl-find-basename/extension-aux filename extensions dir dirxcache warnings)) ((when realfile) (mv realfile warnings))) (vl-find-basename/extension filename extensions (cdr searchcache) warnings))))
Theorem:
(defthm maybe-stringp-of-vl-find-basename/extension.realpath (b* (((mv ?realpath ?warnings) (vl-find-basename/extension filename extensions searchcache warnings))) (maybe-stringp realpath)) :rule-classes :type-prescription)
Theorem:
(defthm vl-warninglist-p-of-vl-find-basename/extension.warnings (b* (((mv ?realpath ?warnings) (vl-find-basename/extension filename extensions searchcache warnings))) (vl-warninglist-p warnings)) :rule-classes :rewrite)
Theorem:
(defthm vl-find-basename/extension-of-str-fix-filename (equal (vl-find-basename/extension (str-fix filename) extensions searchcache warnings) (vl-find-basename/extension filename extensions searchcache warnings)))
Theorem:
(defthm vl-find-basename/extension-streqv-congruence-on-filename (implies (streqv filename filename-equiv) (equal (vl-find-basename/extension filename extensions searchcache warnings) (vl-find-basename/extension filename-equiv extensions searchcache warnings))) :rule-classes :congruence)
Theorem:
(defthm vl-find-basename/extension-of-string-list-fix-extensions (equal (vl-find-basename/extension filename (string-list-fix extensions) searchcache warnings) (vl-find-basename/extension filename extensions searchcache warnings)))
Theorem:
(defthm vl-find-basename/extension-string-list-equiv-congruence-on-extensions (implies (str::string-list-equiv extensions extensions-equiv) (equal (vl-find-basename/extension filename extensions searchcache warnings) (vl-find-basename/extension filename extensions-equiv searchcache warnings))) :rule-classes :congruence)
Theorem:
(defthm vl-find-basename/extension-of-vl-dirxlist-cache-fix-searchcache (equal (vl-find-basename/extension filename extensions (vl-dirxlist-cache-fix searchcache) warnings) (vl-find-basename/extension filename extensions searchcache warnings)))
Theorem:
(defthm vl-find-basename/extension-vl-dirxlist-cache-equiv-congruence-on-searchcache (implies (vl-dirxlist-cache-equiv searchcache searchcache-equiv) (equal (vl-find-basename/extension filename extensions searchcache warnings) (vl-find-basename/extension filename extensions searchcache-equiv warnings))) :rule-classes :congruence)
Theorem:
(defthm vl-find-basename/extension-of-vl-warninglist-fix-warnings (equal (vl-find-basename/extension filename extensions searchcache (vl-warninglist-fix warnings)) (vl-find-basename/extension filename extensions searchcache warnings)))
Theorem:
(defthm vl-find-basename/extension-vl-warninglist-equiv-congruence-on-warnings (implies (vl-warninglist-equiv warnings warnings-equiv) (equal (vl-find-basename/extension filename extensions searchcache warnings) (vl-find-basename/extension filename extensions searchcache warnings-equiv))) :rule-classes :congruence)