(comp-db-relativize-keys db path) → (mv er? db$)
Function:
(defun comp-db-relativize-keys (db path) (declare (xargs :guard (and (comp-dbp db) (stringp path)))) (b* ((db (comp-db-fix db)) ((reterr) db) (path (mbe :logic (acl2::str-fix path) :exec path)) ((when (endp db)) (retok nil)) (file (car (first db))) (entry (cdr (first db))) ((erp file$) (relativize-path file path) :iferr (msg$ "Cannot make file path ~x0 relative to base path ~x1." file path)) ((erp rest-db) (comp-db-relativize-keys (rest db) path))) (retok (cons (cons file$ entry) rest-db))))
Theorem:
(defthm maybe-msgp-of-comp-db-relativize-keys.er? (b* (((mv ?er? ?db$) (comp-db-relativize-keys db path))) (maybe-msgp er?)) :rule-classes :rewrite)
Theorem:
(defthm comp-dbp-of-comp-db-relativize-keys.db$ (b* (((mv ?er? ?db$) (comp-db-relativize-keys db path))) (comp-dbp db$)) :rule-classes :rewrite)
Theorem:
(defthm comp-db-relativize-keys-of-comp-db-fix-db (equal (comp-db-relativize-keys (comp-db-fix db) path) (comp-db-relativize-keys db path)))
Theorem:
(defthm comp-db-relativize-keys-comp-db-equiv-congruence-on-db (implies (comp-db-equiv db db-equiv) (equal (comp-db-relativize-keys db path) (comp-db-relativize-keys db-equiv path))) :rule-classes :congruence)
Theorem:
(defthm comp-db-relativize-keys-of-str-fix-path (equal (comp-db-relativize-keys db (acl2::str-fix path)) (comp-db-relativize-keys db path)))
Theorem:
(defthm comp-db-relativize-keys-streqv-congruence-on-path (implies (acl2::streqv path path-equiv) (equal (comp-db-relativize-keys db path) (comp-db-relativize-keys db path-equiv))) :rule-classes :congruence)