Cause an error if a value is not a term.
(ensure-value-is-untranslated-term x description error-erp error-val ctx state) → (mv erp val state)
If successful,
return the translation of
If check-user-term fails, the error message it returns is incorporated into a larger error message. Since the message returned by check-user-term starts with the term, it can be incorporated into the larger message without capitalization concerns.
Function:
(defun ensure-value-is-untranslated-term (x description error-erp error-val ctx state) (declare (xargs :stobjs (state))) (declare (xargs :guard (and (msgp description) (not (null error-erp))))) (let ((__function__ 'ensure-value-is-untranslated-term)) (declare (ignorable __function__)) (b* (((mv term/msg stobjs-out) (check-user-term x (w state)))) (if (msgp term/msg) (er-soft+ ctx error-erp error-val "~@0 must be an untranslated term. ~@1" description term/msg) (value (list term/msg stobjs-out))))))