X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=components%2Facic_content%2FcicNotationUtil.ml;h=f331b79ca8d2da4c3a545c54b6789dcb1eb59a7b;hb=0dfad591e92a2c1174313ed7be80da0084b618b3;hp=8e487ed11ed293374f4737a39bbc0e975b0165ff;hpb=7f2444c2670cadafddd8785b687ef312158376b0;p=helm.git diff --git a/components/acic_content/cicNotationUtil.ml b/components/acic_content/cicNotationUtil.ml index 8e487ed11..f331b79ca 100644 --- a/components/acic_content/cicNotationUtil.ml +++ b/components/acic_content/cicNotationUtil.ml @@ -40,7 +40,9 @@ let visit_ast ?(special_k = fun _ -> assert false) k = | Ast.LetRec (kind, definitions, term) -> let definitions = List.map - (fun (var, ty, n) -> aux_capture_variable var, k ty, n) + (fun (params, var, ty, decrno) -> + List.map aux_capture_variable params, aux_capture_variable var, + k ty, decrno) definitions in Ast.LetRec (kind, definitions, k term) @@ -213,7 +215,8 @@ let meta_names_of_term term = aux term and aux_pattern (head, _, vars) = List.iter aux_capture_var vars - and aux_definition (var, term, i) = + and aux_definition (params, var, term, decrno) = + List.iter aux_capture_var params ; aux_capture_var var ; aux term and aux_substs substs = List.iter (fun (_, term) -> aux term) substs @@ -366,7 +369,10 @@ let freshen_obj obj = let index = ref 0 in let freshen_term = freshen_term ~index in let freshen_name_ty = List.map (fun (n, t) -> (n, freshen_term t)) in - let freshen_name_ty_b = List.map (fun (n, t, b) -> (n, freshen_term t, b)) in + let freshen_name_ty_b = List.map (fun (n,t,b,i) -> (n,freshen_term t,b,i)) in + let freshen_capture_variables = + List.map (fun (n,t) -> (freshen_term n, HExtlib.map_option freshen_term t)) + in match obj with | CicNotationPt.Inductive (params, indtypes) -> let indtypes = @@ -374,15 +380,15 @@ let freshen_obj obj = (fun (n, co, ty, ctors) -> (n, co, ty, freshen_name_ty ctors)) indtypes in - CicNotationPt.Inductive (freshen_name_ty params, indtypes) + CicNotationPt.Inductive (freshen_capture_variables params, indtypes) | CicNotationPt.Theorem (flav, n, t, ty_opt) -> let ty_opt = match ty_opt with None -> None | Some ty -> Some (freshen_term ty) in CicNotationPt.Theorem (flav, n, freshen_term t, ty_opt) | CicNotationPt.Record (params, n, ty, fields) -> - CicNotationPt.Record (freshen_name_ty params, n, freshen_term ty, - freshen_name_ty_b fields) + CicNotationPt.Record (freshen_capture_variables params, n, + freshen_term ty, freshen_name_ty_b fields) let freshen_term = freshen_term ?index:None