X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Facic_content%2FtermAcicContent.ml;h=257d2440ba87b66c93e6863f660e715318bb0d35;hb=f8cc3ca9341553197c08cc217f787b663787d758;hp=eaa53259021821dc3dc4b053f6eeffbfa160915d;hpb=523a919017f8ec390d130c81de4897bd7c6d3a2c;p=helm.git diff --git a/helm/software/components/acic_content/termAcicContent.ml b/helm/software/components/acic_content/termAcicContent.ml index eaa532590..257d2440b 100644 --- a/helm/software/components/acic_content/termAcicContent.ml +++ b/helm/software/components/acic_content/termAcicContent.ml @@ -123,7 +123,7 @@ let ast_of_acic0 term_info acic k = k s, k t)) | 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)) -> + | Cic.AAppl (aid,(Cic.AMutConstruct _ as he::tl as args)) as t -> let last_n n l = let rec aux = function @@ -143,14 +143,17 @@ let ast_of_acic0 term_info acic k = idref aid (Ast.Appl (l@tl)) | l -> idref aid (Ast.Appl l) in - let deannot_he = Deannotate.deannotate_term he in - if CoercDb.is_a_coercion' deannot_he && !Acic2content.hide_coercions - then - match CoercDb.is_a_coercion_to_funclass deannot_he with - | None -> idref aid (last_n 1 (List.map k tl)) - | Some i -> idref aid (last_n (i+1) (List.map k tl)) - else - idref aid (Ast.Appl (List.map k args)) + (match LibraryObjects.destroy_nat t with + | Some n -> idref aid (Ast.Num (string_of_int n, -1)) + | None -> + let deannot_he = Deannotate.deannotate_term he in + if CoercDb.is_a_coercion' deannot_he && !Acic2content.hide_coercions + then + (match CoercDb.is_a_coercion_to_funclass deannot_he with + | None -> idref aid (last_n 1 (List.map k tl)) + | Some i -> idref aid (last_n (i+1) (List.map k 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) -> @@ -194,8 +197,8 @@ let ast_of_acic0 term_info acic k = (fun (name, ty) pat -> incr j; let (capture_variables, rhs) = eat_branch lpsno ty pat in - ((name, Some (ctor_puri !j), capture_variables), rhs)) - constructors patterns + Ast.Pattern (name, Some (ctor_puri !j), capture_variables), rhs + ) constructors patterns with Invalid_argument _ -> assert false in idref id (Ast.Case (k te, Some case_indty, Some (k ty), patterns))