(************************************************************************) (* * The Rocq Prover / The Rocq Development Team *) (* v * Copyright INRIA, CNRS and contributors *) (* e | RecursionNotOnInductiveType c -> RecursionNotOnInductiveType (f c) | RecursionOnIllegalTerm (n, (env, c), l1_l2) -> RecursionOnIllegalTerm (n, (env, f c), l1_l2) | FixpointOnNonEliminable (s, s') -> FixpointOnNonEliminable (s, s') let map_pcofix_guard_error f = function | CodomainNotInductiveType c -> CodomainNotInductiveType (f c) | NestedRecursiveOccurrences -> NestedRecursiveOccurrences | UnguardedRecursiveCall c -> UnguardedRecursiveCall (f c) | RecCallInTypeOfAbstraction c -> RecCallInTypeOfAbstraction (f c) | RecCallInNonRecArgOfConstructor c -> RecCallInNonRecArgOfConstructor (f c) | RecCallInTypeOfDef c -> RecCallInTypeOfDef (f c) | RecCallInNonMainMutual c -> RecCallInNonMainMutual (f c) | RecCallInCaseFun c -> RecCallInCaseFun (f c) | RecCallInCaseArg c -> RecCallInCaseArg (f c) | RecCallInCasePred c -> RecCallInCasePred (f c) | NotGuardedForm c -> NotGuardedForm (f c) | ReturnPredicateNotCoInductive c -> ReturnPredicateNotCoInductive (f c) let map_pguard_error f = function | FixGuardError e -> FixGuardError (map_pfix_guard_error f e) | CoFixGuardError e -> CoFixGuardError (map_pcofix_guard_error f e) let map_ptype_error fr f = function | UnboundRel _ | UnboundVar _ | CaseOnPrivateInd _ | IllFormedCaseParams | UndeclaredQualities _ | UndeclaredUniverses _ | NotAllowedSProp | UnsatisfiedUnivConstraints _ | UnsatisfiedPConstraints _ | ReferenceVariables _ | BadInvert | BadVariance _ | UndeclaredUsedVariables _ | IllFormedConstant _ | IllFormedInductive _ as e -> e | NotAType j -> NotAType (on_judgment f j) | BadAssumption j -> BadAssumption (on_judgment f j) | ElimArity (pi, c, ar) -> ElimArity (pi, f c, ar) | CaseNotInductive j -> CaseNotInductive (on_judgment f j) | WrongCaseInfo (pi, ci) -> WrongCaseInfo (pi, ci) | NumberBranches (j, n) -> NumberBranches (on_judgment f j, n) | IllFormedBranch (c, pc, t1, t2) -> IllFormedBranch (f c, pc, f t1, f t2) | BadProjType (j, p) -> BadProjType (on_judgment f j, p) | Generalization ((na, t), j) -> Generalization ((na, f t), on_judgment f j) | ActualType (j, t) -> ActualType (on_judgment f j, f t) | IncorrectPrimitive (p, t) -> IncorrectPrimitive ({p with uj_type=f p.uj_type}, f t) | CantApplyBadType ((n, c1, c2), j, vj) -> CantApplyBadType ((n, f c1, f c2), on_judgment f j, Array.map (on_judgment f) vj) | CantApplyNonFunctional (j, jv) -> CantApplyNonFunctional (on_judgment f j, Array.map (on_judgment f) jv) | IllFormedRecBody (ge, na, n, env, jv) -> IllFormedRecBody (map_pguard_error f ge, Array.map (Context.map_annot_relevance_het fr) na, n, env, Array.map (on_judgment f) jv) | IllTypedRecBody (n, na, jv, t) -> IllTypedRecBody (n, Array.map (Context.map_annot_relevance_het fr) na, Array.map (on_judgment f) jv, Array.map f t) | BadBinderRelevance (rlv, decl) -> BadBinderRelevance (fr rlv, Context.Rel.Declaration.map_constr_het fr f decl) | BadCaseRelevance (rlv, case) -> BadCaseRelevance (fr rlv, f case)