Process an
(isodata-process-iso iso k old$ verify-guards$ names-to-avoid ctx state) → (mv erp result state)
If
If instead
When
When
If the processing is successful,
we return the isomorphic mapping record specified by
Function:
(defun isodata-process-iso (iso k old$ verify-guards$ names-to-avoid ctx state) (declare (xargs :stobjs (state))) (declare (xargs :guard (and (posp k) (symbolp old$) (booleanp verify-guards$) (symbol-listp names-to-avoid)))) (let ((__function__ 'isodata-process-iso)) (declare (ignorable __function__)) (if (atom iso) (b* (((er &) (ensure-value-is-symbol$ iso (msg "The ~n0 ISO component ~x1 ~ of the second input ~ must be a symbol or a list. ~ Since it is an atom," (list k) iso) t nil)) (info (defiso-lookup iso (w state))) ((unless info) (er-soft+ ctx t nil "The ~n0 ISO component of the second input, ~ which is the symbol ~x1, ~ must be the name of an existing DEFISO, ~ but no DEFISO with this name exists. ~ See :DOC DEFISO." (list k) iso)) ((defmapping-info info) info) ((when (and verify-guards$ (null info.doma-guard))) (er-soft+ ctx t nil "Since the :VERIFY-GUARDS input is T, ~ or it is (perhaps by default) :AUTO ~ and the target function ~x0 is guard-verified, ~ the DEFISO ~x1 must include ~ the guard-related theorems, ~ but it does not. ~ See :DOC DEFISO." old$ iso)) (isomap (make-isodata-isomap :isoname iso :localp nil :oldp info.doma :newp info.domb :forth info.alpha :back info.beta :forth-image info.alpha-image :back-image info.beta-image :back-of-forth info.beta-of-alpha :forth-of-back info.alpha-of-beta :forth-injective info.alpha-injective :back-injective info.beta-injective :oldp-guard info.doma-guard :newp-guard info.domb-guard :forth-guard info.alpha-guard :back-guard info.beta-guard :hints nil))) (value (list isomap names-to-avoid))) (b* ((wrld (w state)) (isoname (packn-pos (list 'defiso-isodata- old$ '- k) old$)) (isoname (isodata-fresh-defiso-name-with-*s-suffix isoname wrld)) ((mv forth-image back-image back-of-forth forth-of-back oldp-guard newp-guard forth-guard back-guard forth-injective back-injective names-to-avoid) (isodata-fresh-defiso-thm-names isoname verify-guards$ names-to-avoid wrld)) ((unless (true-listp iso)) (er-soft+ ctx t nil "The ~n0 ISO component ~x1 of the second input ~ must be a symbol or a list. ~ Since it is not an atom, it must be a list." (list k) iso)) ((unless (or (= (len iso) 4) (= (len iso) 6))) (er-soft+ ctx t nil "The ~n0 ISO component ~x1 of the second input ~ must be a list of length 4 or 6." (list k) iso)) (oldp (first iso)) (newp (second iso)) (forth (third iso)) (back (fourth iso)) ((unless (or (= (len iso) 4) (eq (fifth iso) :hints))) (er-soft+ ctx t nil "The fifth component ~x0 ~ of the ~n1 ISO component ~x2 ~ of the second input ~ must be the keyword :HINTS." (fifth iso) (list k) iso)) (hints (and (= (len iso) 6) (sixth iso))) (ctx-defiso (cons 'defiso isoname)) ((er (list oldp$ newp$ forth$ back$)) (acl2::defmapping-process-functions oldp newp forth back verify-guards$ ctx-defiso state)) (oldp-arity (arity oldp$ wrld)) ((unless (= oldp-arity 1)) (er-soft+ ctx t nil "The first component ~x0 ~ of the ~n1 ISO component ~ of the third input ~ must have one argument, but it has ~x2 arguments instead." oldp (list k) oldp-arity)) (newp-arity (arity newp$ wrld)) ((unless (= newp-arity 1)) (er-soft+ ctx t nil "The second component ~x0 ~ of the ~n1 ISO component ~ of the third input ~ must have one argument, but it has ~x2 arguments instead." newp (list k) newp-arity)) (isomap (make-isodata-isomap :isoname isoname :localp t :oldp oldp$ :newp newp$ :forth forth$ :back back$ :forth-image forth-image :back-image back-image :back-of-forth back-of-forth :forth-of-back forth-of-back :forth-injective forth-injective :back-injective back-injective :oldp-guard oldp-guard :newp-guard newp-guard :forth-guard forth-guard :back-guard back-guard :hints hints))) (value (list isomap names-to-avoid))))))