X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Facic_procedural%2Fprocedural2.ml;h=777ccd5f5101b797f2cb92a48e53cb0c83bc2c7d;hb=6daa2cc113783aaba53d82c47fe7107988d76e11;hp=e3a2d62e757c47f4b89b5376d995c69fe8e8fa54;hpb=b378b7f4f2a3a897c4b69f44d4d1d54cc4d0aa56;p=helm.git diff --git a/helm/software/components/acic_procedural/procedural2.ml b/helm/software/components/acic_procedural/procedural2.ml index e3a2d62e7..777ccd5f5 100644 --- a/helm/software/components/acic_procedural/procedural2.ml +++ b/helm/software/components/acic_procedural/procedural2.ml @@ -167,6 +167,25 @@ let get_sub_names head l = let get_type msg st t = H.get_type msg st.context (H.cic t) +let get_uri_of_head = function + | C.AConst (_, u, _) + | C.AAppl (_, C.AConst (_, u, _) :: _) -> Some (u, 0, 0) + | C.AMutInd (_, u, i, _) + | C.AAppl (_, C.AMutInd (_, u, i, _) :: _) -> Some (u, succ i, 0) + | C.AMutConstruct (_, u, i, j, _) + | C.AAppl (_, C.AMutConstruct (_, u, i, j, _) :: _) -> Some (u, succ i, j) + | _ -> None + +let get_uri_of_apply = function + | T.Exact (t, _) + | T.Apply (t, _) -> get_uri_of_head t + | _ -> None + +let is_reflexivity st step = + match get_uri_of_apply step with + | None -> false + | Some (uri, i, j) -> st.defaults && Obj.is_eq_URI uri && i = 1 && j = 1 + (* proof construction *******************************************************) let anonymous_premise = C.Name "UNNAMED" @@ -175,11 +194,9 @@ let mk_exp_args hd tl classes synth qs = let exp = ref 0 in let meta id = C.AImplicit (id, None) in let map v (cl, b) = - if I.overlaps synth cl then - let w = if H.is_atomic (H.cic v) then v else meta "" in - if b then v, v else meta "", w - else - meta "", meta "" + if I.overlaps synth cl + then if b then v, v else meta "", v + else meta "", meta "" in let rec rev a = function | [] -> a @@ -235,6 +252,8 @@ let get_intro = function | C.Name s -> Some s let mk_preamble st what script = match script with + | step :: script when is_reflexivity st step -> + convert st what @ T.Reflexivity (T.note_of_step step) :: script | T.Exact _ :: _ -> script | _ -> convert st what @ script @@ -365,7 +384,10 @@ and proc_appl st what hd tl = if n < 0 then a else mk_synth (I.S.add n a) (pred n) in let synth = mk_synth I.S.empty decurry in - let text = "" (* Printf.sprintf "%u %s" parsno (Cl.to_string h) *) in + let text = if !debug + then Printf.sprintf "%u %s" parsno (Cl.to_string synth (classes, rc)) + else "" + in let script = List.rev (mk_arg st hd) in let tactic b t n = if b then T.Apply (t, n) else T.Exact (t, n) in match rc with