X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Facic_content%2FtermAcicContent.ml;h=a25730e4d1fa0aed8e2279694d2d60d3a7d7deb7;hb=bc2834b671b7e7554159a284f13e52d93debfd03;hp=fddd777f7e13959fac65a76ff202f40ae23f4738;hpb=55b82bd235d82ff7f0a40d980effe1efde1f5073;p=helm.git diff --git a/helm/software/components/acic_content/termAcicContent.ml b/helm/software/components/acic_content/termAcicContent.ml index fddd777f7..a25730e4d 100644 --- a/helm/software/components/acic_content/termAcicContent.ml +++ b/helm/software/components/acic_content/termAcicContent.ml @@ -66,6 +66,8 @@ let constructor_of_inductive_type uri i j = fst (List.nth (constructors_of_inductive_type uri i) (j-1)) with Not_found -> assert false) +let hide_coercions = ref true;; + let ast_of_acic0 term_info acic k = let k = k term_info in let id_to_uris = term_info.uri in @@ -117,7 +119,23 @@ let ast_of_acic0 term_info acic k = | Cic.ALetIn (id,n,s,t) -> idref id (Ast.LetIn ((CicNotationUtil.name_of_cic_name n, None), k s, k t)) - | Cic.AAppl (aid,args) -> idref aid (Ast.Appl (List.map k args)) + | Cic.AAppl (aid,(Cic.AConst _ as he::tl as args)) + | Cic.AAppl (aid,(Cic.AMutInd _ as he::tl as args)) + | Cic.AAppl (aid,(Cic.AMutConstruct _ as he::tl as args)) -> + if CoercGraph.is_a_coercion (Deannotate.deannotate_term he) && + !hide_coercions + then + let rec last = + function + [] -> assert false + | [t] -> t + | _::tl -> last tl + in + idref aid (k (last tl)) + else + idref aid (Ast.Appl (List.map k args)) + | Cic.AAppl (aid,args) -> + idref aid (Ast.Appl (List.map k args)) | Cic.AConst (id,uri,substs) -> register_uri id uri; idref id (Ast.Ident (UriManager.name_of_uri uri, aux_substs substs))