File data at a certain path in a file set.
This is the value associated to the key (path) in the map, which the guard requires to be in the file set.
It is more concise, and more abstract, than accessing the map and then looking up the path.
Together with fileset-paths, it can be used an as API to inspect a file set.
Function:
(defun file-at-path (path files) (declare (xargs :guard (and (filepathp path) (filesetp files)))) (declare (xargs :guard (in path (fileset-paths files)))) (let ((__function__ 'file-at-path)) (declare (ignorable __function__)) (filedata-fix (omap::lookup (filepath-fix path) (fileset->unwrap files)))))
Theorem:
(defthm filedatap-of-file-at-path (b* ((data (file-at-path path files))) (filedatap data)) :rule-classes :rewrite)
Theorem:
(defthm file-at-path-of-filepath-fix-path (equal (file-at-path (filepath-fix path) files) (file-at-path path files)))
Theorem:
(defthm file-at-path-filepath-equiv-congruence-on-path (implies (filepath-equiv path path-equiv) (equal (file-at-path path files) (file-at-path path-equiv files))) :rule-classes :congruence)
Theorem:
(defthm file-at-path-of-fileset-fix-files (equal (file-at-path path (fileset-fix files)) (file-at-path path files)))
Theorem:
(defthm file-at-path-fileset-equiv-congruence-on-files (implies (fileset-equiv files files-equiv) (equal (file-at-path path files) (file-at-path path files-equiv))) :rule-classes :congruence)