13 | C.Implicit as t -> t
14 | C.Cast (te,ty) -> C.Cast (liftaux k te, liftaux k ty)
15 | C.Prod (n,s,t) -> C.Prod (n, liftaux k s, liftaux (k+1) t)
16 | C.Lambda (n,s,t) -> C.Lambda (n, liftaux k s, liftaux (k+1) t)
17 | C.Appl l -> C.Appl (List.map (liftaux k) l)
20 | C.MutInd _ as t -> t
21 | C.MutConstruct _ as t -> t
22 | C.MutCase (sp,cookingsno,i,outty,t,pl) ->
23 C.MutCase (sp, cookingsno, i, liftaux k outty, liftaux k t,
24 List.map (liftaux k) pl)
26 let len = List.length fl in
29 (fun (name, i, ty, bo) -> (name, i, liftaux k ty, liftaux (k+len) bo))
34 let len = List.length fl in
37 (fun (name, ty, bo) -> (name, liftaux k ty, liftaux (k+len) bo))
51 n when n = k -> lift (k - 1) arg
58 | C.Implicit as t -> t
59 | C.Cast (te,ty) -> C.Cast (substaux k te, substaux k ty) (*CSC ??? *)
60 | C.Prod (n,s,t) -> C.Prod (n, substaux k s, substaux (k + 1) t)
61 | C.Lambda (n,s,t) -> C.Lambda (n, substaux k s, substaux (k + 1) t)
62 | C.Appl l -> C.Appl (List.map (substaux k) l)
65 | C.MutInd _ as t -> t
66 | C.MutConstruct _ as t -> t
67 | C.MutCase (sp,cookingsno,i,outt,t,pl) ->
68 C.MutCase (sp,cookingsno,i,substaux k outt, substaux k t,
69 List.map (substaux k) pl)
71 let len = List.length fl in
74 (fun (name,i,ty,bo) -> (name, i, substaux k ty, substaux (k+len) bo))
77 C.Fix (i, substitutedfl)
79 let len = List.length fl in
82 (fun (name,ty,bo) -> (name, substaux k ty, substaux (k+len) bo))
85 C.CoFix (i, substitutedfl)
90 let undebrujin_inductive_def uri =
92 Cic.InductiveDefinition (dl,params,n_ind_params) ->
95 (fun (name,inductive,arity,constructors) ->
100 let counter = ref (List.length dl) in
104 subst (Cic.MutInd (uri,0,!counter))
110 (name,inductive,arity,constructors')
113 Cic.InductiveDefinition (dl', params, n_ind_params)