Transform a file path.
We only support file paths that consist of strings.
We transform the path by interposing
Note that this kind of file path transformations
supports chaining of transformations,
e.g.
Function:
(defun simpadd0-filepath (path) (declare (xargs :guard (filepathp path))) (let ((__function__ 'simpadd0-filepath)) (declare (ignorable __function__)) (b* ((string (filepath->unwrap path)) ((unless (stringp string)) (raise "Misusage error: file path ~x0 is not a string." string) (filepath "irrelevant")) (chars (acl2::explode string)) (dot-pos-in-rev (index-of #\. (rev chars))) ((when (not dot-pos-in-rev)) (filepath (acl2::implode (append chars (acl2::explode ".simpadd0"))))) (last-dot-pos (- (len chars) dot-pos-in-rev)) (new-chars (append (take last-dot-pos chars) (acl2::explode "simpadd0.") (nthcdr last-dot-pos chars))) (new-string (acl2::implode new-chars))) (filepath new-string))))
Theorem:
(defthm filepathp-of-simpadd0-filepath (b* ((new-path (simpadd0-filepath path))) (filepathp new-path)) :rule-classes :rewrite)
Theorem:
(defthm simpadd0-filepath-of-filepath-fix-path (equal (simpadd0-filepath (c$::filepath-fix path)) (simpadd0-filepath path)))
Theorem:
(defthm simpadd0-filepath-filepath-equiv-congruence-on-path (implies (c$::filepath-equiv path path-equiv) (equal (simpadd0-filepath path) (simpadd0-filepath path-equiv))) :rule-classes :congruence)