X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;ds=sidebyside;f=helm%2Focaml%2Fcic%2Fdeannotate.ml;h=ec98b9774214bd6b684f42813711225812ad77ec;hb=de2d3c16344df6b3463dd240ac05c7ba156f17f8;hp=2445c3771d17a0c70735f343b3d0606456ba9457;hpb=ae326f646ef4c01b43d6da04201b427d1e175400;p=helm.git diff --git a/helm/ocaml/cic/deannotate.ml b/helm/ocaml/cic/deannotate.ml index 2445c3771..ec98b9774 100644 --- a/helm/ocaml/cic/deannotate.ml +++ b/helm/ocaml/cic/deannotate.ml @@ -27,12 +27,21 @@ let expect_possible_parameters = ref false;; exception NotExpectingPossibleParameters;; +(* converts annotated terms into cic terms (forgetting ids and names) *) let rec deannotate_term = let module C = Cic in function C.ARel (_,n,_) -> C.Rel n | C.AVar (_,uri) -> C.Var uri - | C.AMeta (_,n) -> C.Meta n + | C.AMeta (_,n, l) -> + let l' = + List.map + (function + None -> None + | Some at -> Some (deannotate_term at) + ) l + in + C.Meta (n, l') | C.ASort (_,s) -> C.Sort s | C.AImplicit _ -> C.Implicit | C.ACast (_,va,ty) -> C.Cast (deannotate_term va, deannotate_term ty) @@ -44,7 +53,6 @@ let rec deannotate_term = C.LetIn (name, deannotate_term so, deannotate_term ta) | C.AAppl (_,l) -> C.Appl (List.map deannotate_term l) | C.AConst (_,uri, cookingsno) -> C.Const (uri, cookingsno) - | C.AAbst (_,uri) -> C.Abst uri | C.AMutInd (_,uri,cookingsno,i) -> C.MutInd (uri,cookingsno,i) | C.AMutConstruct (_,uri,cookingsno,i,j) -> C.MutConstruct (uri,cookingsno,i,j) @@ -89,8 +97,23 @@ let deannotate_obj = deannotate_term ty) | C.ACurrentProof (_, name, conjs, bo, ty) -> C.CurrentProof ( - name, List.map (fun (id,con) -> (id,deannotate_term con)) conjs, - deannotate_term bo, deannotate_term ty + name, + List.map + (function + (_,id,acontext,con) -> + let context = + List.map + (function + _,Some (n,(C.ADef at)) -> + Some (n,(C.Def (deannotate_term at))) + | _,Some (n,(C.ADecl at)) -> + Some (n,(C.Decl (deannotate_term at))) + | _,None -> None + ) acontext + in + (id,context,deannotate_term con) + ) conjs, + deannotate_term bo,deannotate_term ty ) | C.AInductiveDefinition (_, tys, params, parno) -> C.InductiveDefinition ( List.map deannotate_inductiveType tys,