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
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
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
| 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