(json-to-comp-db-get-directory entry) → (mv erp directory)
Function:
(defun json-to-comp-db-get-directory (entry) (declare (xargs :guard (json::valuep entry))) (declare (xargs :guard (eq (json::value-kind entry) :object))) (b* (((reterr) "") (entry (json::value-fix entry)) (values (json::object-member-values "directory" entry)) ((when (endp values)) (retmsg$ "JSON compilation entry has no \"directory\" member. ~ Compilation entry: ~x0" entry)) ((unless (endp (rest values))) (retmsg$ "JSON compilation entry has multiple \"directory\" members. ~ Compilation entry: ~x0" entry)) (value (first values))) (json::value-case value :string (retok value.get) :otherwise (retmsg$ "Expected string type in member field \"directory\" ~ of JSON compilation database entry. Found ~x0 instead." (json::value-kind value)))))
Theorem:
(defthm stringp-of-json-to-comp-db-get-directory.directory (b* (((mv acl2::?erp common-lisp::?directory) (json-to-comp-db-get-directory entry))) (stringp directory)) :rule-classes :rewrite)
Theorem:
(defthm json-to-comp-db-get-directory-of-value-fix-entry (equal (json-to-comp-db-get-directory (json::value-fix entry)) (json-to-comp-db-get-directory entry)))
Theorem:
(defthm json-to-comp-db-get-directory-value-equiv-congruence-on-entry (implies (json::value-equiv entry entry-equiv) (equal (json-to-comp-db-get-directory entry) (json-to-comp-db-get-directory entry-equiv))) :rule-classes :congruence)