Alternative to vl-slow-find-file-aux using a vl-dirlist-cache-p.
(vl-cache-find-file-aux filename searchcache) → realpath
Function:
(defun vl-cache-find-file-aux (filename searchcache) (declare (xargs :guard (and (stringp filename) (vl-dirlist-cache-p searchcache)))) (let ((__function__ 'vl-cache-find-file-aux)) (declare (ignorable __function__)) (b* ((filename (string-fix filename)) (searchcache (vl-dirlist-cache-fix searchcache)) ((when (atom searchcache)) nil) ((cons dir file-fal) (car searchcache)) (exists-p (hons-get filename file-fal)) ((when exists-p) (vl-extend-pathname dir filename))) (vl-cache-find-file-aux filename (cdr searchcache)))))
Theorem:
(defthm maybe-stringp-of-vl-cache-find-file-aux (b* ((realpath (vl-cache-find-file-aux filename searchcache))) (maybe-stringp realpath)) :rule-classes :type-prescription)
Theorem:
(defthm vl-cache-find-file-aux-of-str-fix-filename (equal (vl-cache-find-file-aux (str-fix filename) searchcache) (vl-cache-find-file-aux filename searchcache)))
Theorem:
(defthm vl-cache-find-file-aux-streqv-congruence-on-filename (implies (streqv filename filename-equiv) (equal (vl-cache-find-file-aux filename searchcache) (vl-cache-find-file-aux filename-equiv searchcache))) :rule-classes :congruence)
Theorem:
(defthm vl-cache-find-file-aux-of-vl-dirlist-cache-fix-searchcache (equal (vl-cache-find-file-aux filename (vl-dirlist-cache-fix searchcache)) (vl-cache-find-file-aux filename searchcache)))
Theorem:
(defthm vl-cache-find-file-aux-vl-dirlist-cache-equiv-congruence-on-searchcache (implies (vl-dirlist-cache-equiv searchcache searchcache-equiv) (equal (vl-cache-find-file-aux filename searchcache) (vl-cache-find-file-aux filename searchcache-equiv))) :rule-classes :congruence)