]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/acic_procedural/procedural1.ml
- Procedural: now we generate the exact tactic (in place of some apply tactics) and...
[helm.git] / helm / software / components / acic_procedural / procedural1.ml
index 4b91270028139a7a57b4c026c0bfef011d09eb69..ad3152530812c9d5812389c2087cc221a2917eb7 100644 (file)
@@ -241,8 +241,9 @@ let get_intro = function
    | C.Anonymous -> None
    | C.Name s    -> Some s
 
-let mk_preamble st what script =
-   convert st what @ script   
+let mk_preamble st what script = match script with
+   | T.Exact _ :: _ -> script
+   | _              -> convert st what @ script   
 
 let mk_arg st = function
    | C.ARel (_, _, i, name) as what -> convert st ~name:(name, i) what
@@ -270,7 +271,7 @@ let mk_fwd_rewrite st dtext name tl direction v t ity =
            assert (Ut.is_sober st.context (H.cic ity));
            let ity = H.acic_bc st.context ity in
            let br1 = [T.Id ""] in
-           let br2 = List.rev (T.Apply (w, "assumption") :: script None) in
+           let br2 = List.rev (T.Exact (w, "assumption") :: script None) in
            let text = "non-linear rewrite" in
            st, [T.Branch ([br2; br1], ""); T.Cut (name, ity, text)]
         end
@@ -320,24 +321,24 @@ and proc_letin st what name v w t =
       let qt = proc_proof (next (add st entry)) t in
       List.rev_append rqv qt      
    else
-      [T.Apply (what, dtext)]
+      [T.Exact (what, dtext)]
    in
    mk_preamble st what script
 
 and proc_rel st what = 
    let _, dtext = test_depth st in
    let text = "assumption" in
-   let script = [T.Apply (what, dtext ^ text)] in 
+   let script = [T.Exact (what, dtext ^ text)] in 
    mk_preamble st what script
 
 and proc_mutconstruct st what = 
    let _, dtext = test_depth st in
-   let script = [T.Apply (what, dtext)] in 
+   let script = [T.Exact (what, dtext)] in 
    mk_preamble st what script
 
 and proc_const st what = 
    let _, dtext = test_depth st in
-   let script = [T.Apply (what, dtext)] in 
+   let script = [T.Exact (what, dtext)] in 
    mk_preamble st what script
 
 and proc_appl st what hd tl =
@@ -391,7 +392,7 @@ and proc_appl st what hd tl =
            let hd = mk_exp_args hd tl classes synth in
            script @ [T.Apply (hd, dtext ^ text); T.Branch (qs, "")]
    else
-      [T.Apply (what, dtext)]
+      [T.Exact (what, dtext)]
    in
    mk_preamble st what script
 
@@ -411,14 +412,14 @@ and proc_case st what uri tyno u v ts =
       let script = List.rev (mk_arg st v) in
       script @ [T.Cases (v, e, dtext ^ text); T.Branch (qs, "")]   
    else
-      [T.Apply (what, dtext)]
+      [T.Exact (what, dtext)]
    in
    mk_preamble st what script
 
 and proc_other st what =
    let _, dtext = test_depth st in
    let text = Printf.sprintf "%s: %s" "UNEXPANDED" (string_of_head what) in
-   let script = [T.Apply (what, dtext ^ text)] in 
+   let script = [T.Exact (what, dtext ^ text)] in 
    mk_preamble st what script
 
 and proc_proof st t = 
@@ -458,7 +459,7 @@ try
    let aux (inv, _) v =
       if I.overlaps synth inv then None else
       if I.S.is_empty inv then Some (get_note (fun st -> proc_proof st v)) else
-      Some (get_note (fun _ -> [T.Apply (v, dtext ^ "dependent")]))
+      Some (get_note (fun _ -> [T.Exact (v, dtext ^ "dependent")]))
    in  
    let ps = T.list_map2_filter aux classes ts in
    let b = List.length ps > 1 in