| {A.annsynthesized = st; A.annexpected = Some et} -> Some (st, et)
| {A.annsynthesized = st; A.annexpected = None} -> Some (st, st)
with Not_found -> None
| {A.annsynthesized = st; A.annexpected = Some et} -> Some (st, et)
| {A.annsynthesized = st; A.annexpected = None} -> Some (st, st)
with Not_found -> None
- if I.overlaps synth cl && b then v else meta ""
+ 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 ""
- let b, args = aux false args in
- if args = [] then b, hd else b, C.AAppl ("", hd :: args)
+ let args = aux args in
+ let part = !exp < List.length tl in
+ if args = [] then part, hd, qs else part, C.AAppl ("", hd :: args), qs
| C.ARel (_, _, i, name) as what -> convert st ~name:(name, i) what
| _ -> []
| C.ARel (_, _, i, name) as what -> convert st ~name:(name, i) what
| _ -> []
let compare premise = function
| None -> true
| Some s -> s = premise
in
assert (List.length tl = 6);
let what, where, predicate = List.nth tl 5, List.nth tl 3, List.nth tl 2 in
let compare premise = function
| None -> true
| Some s -> s = premise
in
assert (List.length tl = 6);
let what, where, predicate = List.nth tl 5, List.nth tl 3, List.nth tl 2 in
if (Cn.does_not_occur e) then st, [] else
match where with
| C.ARel (_, _, i, premise) as w ->
if (Cn.does_not_occur e) then st, [] else
match where with
| C.ARel (_, _, i, premise) as w ->
let script = [T.Branch (qs, "")] in
if (Cn.does_not_occur e) then script else
T.Rewrite (direction, where, None, e, dtext) :: script
let script = [T.Branch (qs, "")] in
if (Cn.does_not_occur e) then script else
T.Rewrite (direction, where, None, e, dtext) :: script
let proceed, dtext = test_depth st in
let script = if proceed then
let st, hyp, rqv = match get_inner_types st what, get_inner_types st v with
let proceed, dtext = test_depth st in
let script = if proceed then
let st, hyp, rqv = match get_inner_types st what, get_inner_types st v with
- | Some (C.ALetIn _, _), _ ->
+ | Some (C.ALetIn (_, _, iv, iw, _), _), _ when
+ H.alpha_equivalence ~flatten:true st.context (H.cic v) (H.cic iv) &&
+ H.alpha_equivalence ~flatten:true st.context (H.cic w) (H.cic iw)
+ ->
st, C.Def (H.cic v, H.cic w), [T.Intros (Some 1, [intro], dtext)]
st, C.Def (H.cic v, H.cic w), [T.Intros (Some 1, [intro], dtext)]
let st, rqv = match v with
| C.AAppl (_, hd :: tl) when is_fwd_rewrite_right st hd tl ->
let st, rqv = match v with
| C.AAppl (_, hd :: tl) when is_fwd_rewrite_right st hd tl ->
- st, [T.Branch (qs, ""); T.Cut (intro, ity, dtext)]
+ st, [T.Branch (qs, ""); T.Cut (intro, ety, dtext)]
let parsno, argsno = List.length classes, List.length tl in
let decurry = parsno - argsno in
let diff = goal_arity - decurry in
let parsno, argsno = List.length classes, List.length tl in
let decurry = parsno - argsno in
let diff = goal_arity - decurry in
- if diff < 0 then failwith (Printf.sprintf "NOT TOTAL: %i %s |--- %s" diff (Pp.ppcontext st.context) (Pp.ppterm (H.cic hd)));
+ if diff < 0 then
+ let text = Printf.sprintf "partial application: %i" diff in
+ prerr_endline ("Procedural 2: " ^ text);
+ [T.Exact (what, dtext ^ text)]
+ else
let classes = Cl.adjust st.context tl ?goal classes in
let rec mk_synth a n =
if n < 0 then a else mk_synth (I.S.add n a) (pred n)
let classes = Cl.adjust st.context tl ?goal classes in
let rec mk_synth a n =
if n < 0 then a else mk_synth (I.S.add n a) (pred n)
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
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) ->
+ | Some (i, j, uri, tyno) when decurry = 0 ->
let classes2, tl2, _, where = split2_last classes tl in
let script2 = List.rev (mk_arg st where) @ script in
let synth2 = I.S.add 1 synth in
let names = H.get_ind_names uri tyno in
let qs = proc_bkd_proofs (next st) synth2 names classes2 tl2 in
let classes2, tl2, _, where = split2_last classes tl in
let script2 = List.rev (mk_arg st where) @ script in
let synth2 = I.S.add 1 synth in
let names = H.get_ind_names uri tyno in
let qs = proc_bkd_proofs (next st) synth2 names classes2 tl2 in
script @ [tactic b hd (dtext ^ text); T.Branch (qs, "")]
else if is_rewrite_right st hd then
script @ [tactic b hd (dtext ^ text); T.Branch (qs, "")]
else if is_rewrite_right st hd then
let using = Some hd in
script2 @
[T.Elim (where, using, e, dtext ^ text); T.Branch (qs, "")]
let using = Some hd in
script2 @
[T.Elim (where, using, e, dtext ^ text); T.Branch (qs, "")]
let ps, _ = H.get_ind_parameters st.context (H.cic v) in
let _, rps = HEL.split_nth lpsno ps in
let rpsno = List.length rps in
let ps, _ = H.get_ind_parameters st.context (H.cic v) in
let _, rps = HEL.split_nth lpsno ps in
let rpsno = List.length rps in
let text = "" in
let script = List.rev (mk_arg st v) in
script @ [T.Cases (v, e, dtext ^ text); T.Branch (qs, "")]
let text = "" in
let script = List.rev (mk_arg st v) in
script @ [T.Cases (v, e, dtext ^ text); T.Branch (qs, "")]