Process the
(defmapping-process-thm-names thm-names name$ beta-of-alpha-thm$ alpha-of-beta-thm$ guard-thms$ ctx state) → (mv erp thm-names$ state)
We compute the names of all the theorems to generate, and we return them as a complete alist from the keywords that identify the theorems to the corresponding theorem names. The alist has unique keys.
If an explicit theorem name is supplied in the
Function:
(defun defmapping-process-thm-names-aux (thm-keywords thm-names-alist name$ ctx state) (declare (xargs :stobjs (state))) (declare (xargs :guard (and (symbol-listp thm-keywords) (symbol-symbol-alistp thm-names-alist) (symbolp name$)))) (let ((__function__ 'defmapping-process-thm-names-aux)) (declare (ignorable __function__)) (if (endp thm-keywords) (value nil) (b* ((thm-keyword (car thm-keywords)) (pair (assoc-eq thm-keyword thm-names-alist)) (thm-name (if pair (cdr pair) (add-suffix-to-fn name$ (concatenate 'string "." (symbol-name thm-keyword))))) (description (msg "The name ~x0 of the ~x1 theorem, ~@2," thm-name thm-keyword (if pair "supplied in the :THM-NAMES input" "automatically generated"))) ((er &) (ensure-value-is-symbol$ thm-name description t nil)) ((er &) (ensure-symbol-new-event-name$ thm-name description t nil)) ((er alist) (defmapping-process-thm-names-aux (cdr thm-keywords) thm-names-alist name$ ctx state))) (value (acons thm-keyword thm-name alist))))))
Function:
(defun defmapping-process-thm-names (thm-names name$ beta-of-alpha-thm$ alpha-of-beta-thm$ guard-thms$ ctx state) (declare (xargs :stobjs (state))) (declare (xargs :guard (and (symbolp name$) (booleanp beta-of-alpha-thm$) (booleanp alpha-of-beta-thm$) (booleanp guard-thms$)))) (let ((__function__ 'defmapping-process-thm-names)) (declare (ignorable __function__)) (b* (((er &) (ensure-keyword-value-list$ thm-names "The :THM-NAMES input" t nil)) (thm-names-alist (keyword-value-list-to-alist thm-names)) (keys (strip-cars thm-names-alist)) (description (msg "The list ~x0 of keywords of the :THM-NAMES input" keys)) ((er &) (ensure-list-has-no-duplicates$ keys description t nil)) (thm-keywords (defmapping-thm-keywords beta-of-alpha-thm$ alpha-of-beta-thm$ guard-thms$)) ((er &) (ensure-list-subset$ keys thm-keywords description t nil)) ((er thm-names$) (defmapping-process-thm-names-aux thm-keywords thm-names-alist name$ ctx state)) (names (strip-cdrs thm-names$)) (description (msg "The list ~x0 of theorem names, ~ some of which may be supplied ~ in the :THM-NAMES input," names)) ((er &) (ensure-list-has-no-duplicates$ names description t nil))) (value thm-names$))))