]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/acic_procedural/procedural1.ml
- Procedural: generation of "exact" is now complete
[helm.git] / helm / software / components / acic_procedural / procedural1.ml
index ad3152530812c9d5812389c2087cc221a2917eb7..a0c0331f38351a44ea6cc1154c24961c3a597c94 100644 (file)
@@ -198,13 +198,14 @@ let mk_exp_args hd tl classes synth =
    let map v (cl, b) =
       if I.overlaps synth cl && b then v else meta ""
    in
-   let rec aux = function
-      | [] -> []
-      | hd :: tl -> if hd = meta "" then aux tl else List.rev (hd :: tl)
+   let rec aux b = function
+      | [] -> b, []
+      | hd :: tl -> 
+         if hd = meta "" then aux true tl else b, List.rev (hd :: tl)
    in
    let args = T.list_rev_map2 map tl classes in
-   let args = aux args in
-   if args = [] then hd else C.AAppl ("", hd :: args)
+   let b, args = aux false args in
+   if args = [] then b, hd else b, C.AAppl ("", hd :: args)
 
 let mk_convert st ?name sty ety note =
    let e = Cn.hole "" in
@@ -365,6 +366,7 @@ and proc_appl st what hd tl =
       let synth = mk_synth I.S.empty decurry in
       let text = "" (* Printf.sprintf "%u %s" parsno (Cl.to_string h) *) 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
          | Some (i, j, uri, tyno) ->
            let classes2, tl2, _, where = split2_last classes tl in
@@ -374,8 +376,8 @@ and proc_appl st what hd tl =
            let qs = proc_bkd_proofs (next st) synth2 names classes2 tl2 in
             if List.length qs <> List.length names then
               let qs = proc_bkd_proofs (next st) synth [] classes tl in
-              let hd = mk_exp_args hd tl classes synth in
-              script @ [T.Apply (hd, dtext ^ text); T.Branch (qs, "")]
+              let b, hd = mk_exp_args hd tl classes synth in
+              script @ [tactic b hd (dtext ^ text); T.Branch (qs, "")]
            else if is_rewrite_right hd then 
               script2 @ mk_rewrite st dtext where qs tl2 false what
            else if is_rewrite_left hd then 
@@ -389,8 +391,8 @@ and proc_appl st what hd tl =
         | None        ->
            let names = get_sub_names hd tl in
            let qs = proc_bkd_proofs (next st) synth names classes tl in
-           let hd = mk_exp_args hd tl classes synth in
-           script @ [T.Apply (hd, dtext ^ text); T.Branch (qs, "")]
+           let b, hd = mk_exp_args hd tl classes synth in
+           script @ [tactic b hd (dtext ^ text); T.Branch (qs, "")]
    else
       [T.Exact (what, dtext)]
    in