Determine where to load a file from, given its (absolute or relative) name and a list of directories to search.
Signature: (vl-find-file filename searchpath state) returns
The
The
If we find the file in any of the search directories, we essentially return
Function:
(defun vl-find-file (filename searchpath state) (declare (xargs :guard (and (stringp filename) (string-listp searchpath) (state-p state)))) (if (acl2::absolute-pathname-string-p filename nil (acl2::os (w state))) (mv filename state) (vl-find-file-aux filename searchpath state)))
Theorem:
(defthm state-p1-of-vl-find-file (implies (and (force (state-p1 state)) (force (stringp filename))) (state-p1 (mv-nth 1 (vl-find-file filename searchpath state)))))
Theorem:
(defthm stringp-of-vl-find-file (implies (force (stringp filename)) (equal (stringp (mv-nth 0 (vl-find-file filename searchpath state))) (if (mv-nth 0 (vl-find-file filename searchpath state)) t nil))) :rule-classes ((:rewrite) (:type-prescription :corollary (implies (force (stringp filename)) (or (not (mv-nth 0 (vl-find-file filename searchpath state))) (stringp (mv-nth 0 (vl-find-file filename searchpath state))))))))