X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Facic_procedural%2FproceduralClassify.ml;h=981acc969678302644d591be5bbe540702accd36;hb=128ea02422e0cc4254ea3f8e4b0c5248c7182479;hp=755176e5c50cc4d4d280fcee4b373089ebbcb485;hpb=d178a0a4809c0c6693b2c00ab7359a1b414cd805;p=helm.git diff --git a/helm/software/components/acic_procedural/proceduralClassify.ml b/helm/software/components/acic_procedural/proceduralClassify.ml index 755176e5c..981acc969 100644 --- a/helm/software/components/acic_procedural/proceduralClassify.ml +++ b/helm/software/components/acic_procedural/proceduralClassify.ml @@ -31,7 +31,7 @@ module PEH = ProofEngineHelpers module H = ProceduralHelpers -type dependence = I.S.t * bool +type dependences = (I.S.t * bool) list type conclusion = (int * int * UM.uri * int) option @@ -82,8 +82,9 @@ try 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 @@ -110,3 +111,21 @@ try let extract (x, y, z) = y, z in List.rev_map extract (List.tl (Array.to_list b)), rc with Invalid_argument _ -> failwith "Classify.classify" + +(* adjusting the inferrable arguments that do not occur in the goal *********) + +let adjust c vs ?goal classes = + let list_xmap2 map l1 l2 = + let rec aux a = function + | hd1 :: tl1, hd2 :: tl2 -> aux (map hd1 hd2 :: a) (tl1,tl2) + | _, l2 -> List.rev_append l2 a + in + List.rev (aux [] (l1, l2)) + in + let map where what (i, b) = + let what = H.cic what in + (i, b || not (H.occurs c ~what ~where)) + in + match goal with + | None -> classes + | Some goal -> list_xmap2 (map goal) vs classes