let unused_premise = "UNUSED"
+let mk_exp_args hd tl classes =
+ let meta id = C.AImplicit (id, None) in
+ let map v (cl, b) =
+ if I.S.mem 0 cl && b then v else meta ""
+ in
+ let rec aux = function
+ | [] -> []
+ | hd :: tl -> if hd = meta "" then aux tl else List.rev (hd :: tl)
+ in
+ let args = List.rev_map2 map tl classes in
+ let args = aux args in
+ if args = [] then hd else C.AAppl ("", hd :: args)
+
let convert st ?name v =
match get_inner_types st v with
| None -> []
T.Intros (Some count, List.rev st.intros, "") :: script
let mk_arg st = function
- | C.ARel (_, _, _, name) as what -> convert st ~name what
+ | C.ARel (_, _, _, name) as what -> [] (* convert st ~name what *)
| _ -> []
let mk_fwd_rewrite st dtext name tl direction =
[T.Elim (where, using, e, dtext ^ text); T.Branch (qs, "")]
| None ->
let qs = proc_bkd_proofs (next st) synth classes tl in
+ let hd = mk_exp_args hd tl classes in
script @ [T.Apply (hd, dtext ^ text); T.Branch (qs, "")]
else
[T.Apply (what, dtext)]
let join (s, i) =
C.Name (if i < 0 then s else s ^ string_of_int i)
-let mk_fresh_name context name =
+let mk_fresh_name context (name, k) =
let rec aux i = function
| [] -> name, i
| Some (C.Name s, _) :: entries ->
if m = name && j >= i then aux (succ j) entries else aux i entries
| _ :: entries -> aux i entries
in
- join (aux (-1) context)
+ join (aux k context)
let mk_fresh_name context = function
| C.Anonymous -> C.Anonymous
- | C.Name s -> mk_fresh_name context s
+ | C.Name s -> mk_fresh_name context (split s)
(* helper functions *********************************************************)
| Some _, rv :: rvs when csno = vsno && H.is_not_atomic rv ->
let x = C.Appl (t :: List.rev rvs @ [define rv]) in
HLog.warn "Optimizer: anticipate 3"; opt1_proof g true c x
- | Some _, _ ->
+ | _ (* Some _, _ *) ->
g (C.Appl (t :: vs))
- | None, _ ->
+(* | None, _ ->
aux false [] (vs, classes)
- in
+*) in
let rec aux h prev = function
| C.LetIn (name, vv, tt) :: vs ->
let t = S.lift 1 t in