Transform a compilation-database to prepare for use in preprocessing.
(to-preprocess-db db path drop-shared state) → (mv er? db$)
Function:
(defun to-preprocess-db (db path drop-shared state) (declare (xargs :stobjs (state))) (declare (xargs :guard (and (comp-dbp db) (stringp path) (booleanp drop-shared)))) (b* (((reterr) (comp-db-fix db)) (path (mbe :logic (acl2::str-fix path) :exec path)) (path$ (canonical-pathname path t state)) ((unless path$) (retmsg$ "The specified path does not exist or is not a directory: ~x0" path)) (db (comp-db-drop-non-c db)) (db (if drop-shared (comp-db-drop-shared db) db)) (db (comp-db-keep-only-preprocessor-args db)) (db (comp-db-absolute-dirs db state)) ((erp db) (comp-db-relativize-keys db path$)) (db (comp-db-escape-for-shell db))) (retok db)))
Theorem:
(defthm maybe-msgp-of-to-preprocess-db.er? (b* (((mv ?er? ?db$) (to-preprocess-db db path drop-shared state))) (maybe-msgp er?)) :rule-classes :rewrite)
Theorem:
(defthm comp-dbp-of-to-preprocess-db.db$ (b* (((mv ?er? ?db$) (to-preprocess-db db path drop-shared state))) (comp-dbp db$)) :rule-classes :rewrite)
Theorem:
(defthm to-preprocess-db-of-comp-db-fix-db (equal (to-preprocess-db (comp-db-fix db) path drop-shared state) (to-preprocess-db db path drop-shared state)))
Theorem:
(defthm to-preprocess-db-comp-db-equiv-congruence-on-db (implies (comp-db-equiv db db-equiv) (equal (to-preprocess-db db path drop-shared state) (to-preprocess-db db-equiv path drop-shared state))) :rule-classes :congruence)
Theorem:
(defthm to-preprocess-db-of-str-fix-path (equal (to-preprocess-db db (acl2::str-fix path) drop-shared state) (to-preprocess-db db path drop-shared state)))
Theorem:
(defthm to-preprocess-db-streqv-congruence-on-path (implies (acl2::streqv path path-equiv) (equal (to-preprocess-db db path drop-shared state) (to-preprocess-db db path-equiv drop-shared state))) :rule-classes :congruence)
Theorem:
(defthm to-preprocess-db-of-bool-fix-drop-shared (equal (to-preprocess-db db path (bool-fix drop-shared) state) (to-preprocess-db db path drop-shared state)))
Theorem:
(defthm to-preprocess-db-iff-congruence-on-drop-shared (implies (iff drop-shared drop-shared-equiv) (equal (to-preprocess-db db path drop-shared state) (to-preprocess-db db path drop-shared-equiv state))) :rule-classes :congruence)