X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=components%2Facic_procedural%2FproceduralClassify.ml;h=4c0014d2e320e4e214aa511f66f1694ee9b6ac59;hb=24dd4569daf1d35bffaa813b8164058d8643f14d;hp=4f9f99fcee76117056a100bd8f1a13dfb9fcfd24;hpb=db10f4aee3571b87d24c3f52a61721311c384dd2;p=helm.git diff --git a/components/acic_procedural/proceduralClassify.ml b/components/acic_procedural/proceduralClassify.ml index 4f9f99fce..4c0014d2e 100644 --- a/components/acic_procedural/proceduralClassify.ml +++ b/components/acic_procedural/proceduralClassify.ml @@ -23,6 +23,7 @@ * http://cs.unibo.it/helm/. *) +module UM = UriManager module C = Cic module D = Deannotate module I = CicInspect @@ -32,7 +33,7 @@ module H = ProceduralHelpers type dependence = I.S.t * bool -type conclusion = (int * int) option +type conclusion = (int * int * UM.uri * int) option (* debugging ****************************************************************) @@ -43,8 +44,8 @@ let string_of_entry (inverse, b) = let to_string (classes, rc) = let linearize = String.concat " " (List.map string_of_entry classes) in match rc with - | None -> linearize - | Some (i, j) -> Printf.sprintf "%s %u %u" linearize i j + | None -> linearize + | Some (i, j, _, _) -> Printf.sprintf "%s %u %u" linearize i j let out_table b = let map i (_, inverse) = @@ -67,22 +68,23 @@ let classify_conclusion vs = let inside i = i > 1 && i <= List.length vs in match vs with | v0 :: v1 :: _ -> - let hd0, argsno0 = get_argsno v0 in - let hd1, argsno1 = get_argsno v1 in + let hd0, a0 = get_argsno v0 in + let hd1, a1 = get_argsno v1 in begin match hd0, hd1 with - | C.Rel i, C.MutInd _ when inside i -> Some (i, argsno0) - | _ -> None + | C.Rel i, C.MutInd (u, n, _) when inside i -> Some (i, a0, u, n) + | _ -> None end | _ -> None let classify c t = try - let vs, h = PEH.split_with_whd (c, t) in + let vs, h = PEH.split_with_normalize (c, t) in let rc = classify_conclusion vs in let map (b, h) (c, v) = let _, argsno = PEH.split_with_whd (c, v) in + let isf = argsno > 0 || H.is_sort v in let iu = H.is_unsafe h (List.hd vs) in - (I.get_rels_from_premise h v, I.S.empty, argsno > 0 && iu) :: b, succ h + (I.get_rels_from_premise h v, I.S.empty, isf && iu) :: b, succ h in let l, h = List.fold_left map ([], 0) vs in let b = Array.of_list (List.rev l) in