@@ -638,7 +638,7 @@ type cutsolver = {
638638 smt : FApi .backward ;
639639 done_ : FApi .backward ;
640640}
641-
641+
642642(* -------------------------------------------------------------------- *)
643643let tt_apply ?(cutsolver : cutsolver option ) (pt : proofterm ) (tc : tcenv ) =
644644 let (hyps, concl) = FApi. tc_flat tc in
@@ -1509,16 +1509,91 @@ let t_elim_iso_or ?reduce tc =
15091509
15101510 let tc = t_elim_prind_r ?reduce ~accept `Case tc in (oget ! outgoals, tc)
15111511
1512+
1513+ (* -------------------------------------------------------------------- *)
1514+ let t_split_and_i i b f1 f2 tc =
1515+ let i = i - 1 in
1516+ let rec destr acc_sym acc_f i f =
1517+ if i < 0 then
1518+ acc_sym, acc_f, f
1519+ else
1520+ match sform_of_form f with
1521+ | SFand (b , (f1 , f2 )) ->
1522+ destr (b :: acc_sym) (f1 :: acc_f) (i - 1 ) f2
1523+ | _ -> tc_error !! tc ~catchable: true " not enought conjunctions" in
1524+
1525+ let l_sym , l_fsl , fsr = destr [b] [f1] i f2 in
1526+
1527+ let sym = List. hd l_sym in
1528+ let syms = List. tl l_sym in
1529+ let fsl = List. hd l_fsl in
1530+ let fsls = List. tl l_fsl in
1531+
1532+ let fsl =
1533+ List. fold_left2(fun acc sym f ->
1534+ match sym with
1535+ | `Asym -> f_anda f acc
1536+ | `Sym -> f_and f acc
1537+ ) fsl syms fsls in
1538+
1539+ let tc = FApi. tcenv_of_tcenv1 tc in
1540+ let tc, gl = FApi. newgoal tc fsl in
1541+
1542+ let tc, gr =
1543+ match sym with
1544+ | `Asym ->
1545+ let fsr = f_imp fsl fsr in
1546+ let tc, gr = FApi. newgoal tc fsr in
1547+ tc,`App (`HD gr, [`Sub (`HD gl:>prept )])
1548+ | `Sym ->
1549+ let tc, gr = FApi. newgoal tc fsr in
1550+ tc,(`HD gr:>prept ) in
1551+
1552+ let pelim (sym : [`Sym | `Asym] ) (side : [`L | `R] ) =
1553+ match sym, side with
1554+ | `Sym , `L -> LG. p_and_proj_l
1555+ | `Sym , `R -> LG. p_and_proj_r
1556+ | `Asym , `L -> LG. p_anda_proj_l
1557+ | `Asym , `R -> LG. p_anda_proj_rs in
1558+
1559+ let pte = ptenv_of_penv (FApi. tc_hyps tc) ! $ tc in
1560+
1561+ let proj, projs =
1562+ List. fold_left_map (fun h sym ->
1563+ let j : prept = `App (`G (pelim sym `L , [] ), [`H_ ; `H_ ; `Sub h]) in
1564+ let h : prept = `App (`G (pelim sym `R , [] ), [`H_ ; `H_ ; `Sub h]) in
1565+ let j = pt_of_prept_r pte j in
1566+ let h = pt_of_prept_r pte h in
1567+ (`PE h, (sym, `PE j))
1568+ ) (`HD gl :> prept ) (List. rev syms) in
1569+
1570+ let projs = projs @ [sym, proj] in
1571+
1572+ let pintro (sym : [`Sym | `Asym] ) =
1573+ match sym with
1574+ | `Sym -> LG. p_and_intro
1575+ | `Asym -> LG. p_anda_intro_s in
1576+
1577+ let pt =
1578+ List. fold_right
1579+ (fun (sym , ptproj ) pt ->
1580+ `App (`G (pintro sym, [] ), [`H_ ; `H_ ; `Sub ptproj; `Sub pt]))
1581+ projs gr in
1582+
1583+ let pt = pt_of_prept_r pte pt in
1584+
1585+ FApi. t_first (Apply. t_apply_bwd_r pt) tc
1586+
15121587(* -------------------------------------------------------------------- *)
1513- let t_split ?(closeonly = false ) ?reduce (tc : tcenv1 ) =
1588+ let t_split ?(i = 0 ) ?( closeonly = false ) ?reduce (tc : tcenv1 ) =
15141589 let t_split_r (fp : form ) (tc : tcenv1 ) =
15151590 let concl = FApi. tc1_goal tc in
15161591
15171592 match sform_of_form fp with
15181593 | SFtrue ->
15191594 t_true tc
1520- | SFand (b , (f1 , f2 )) when not closeonly ->
1521- t_and_intro_s b (f1, f2) tc
1595+ | SFand (b , (f1 ,f2 )) when not closeonly ->
1596+ t_split_and_i i b f1 f2 tc
15221597 | SFiff (f1 , f2 ) when not closeonly ->
15231598 t_iff_intro_s (f1, f2) tc
15241599 | SFeq (f1 , f2 ) when not closeonly && (is_tuple f1 && is_tuple f2) ->
@@ -2182,13 +2257,14 @@ let t_progress ?options ?ti (tt : FApi.backward) (tc : tcenv1) =
21822257 end
21832258
21842259 | _ when options.pgo_split ->
2185- let thesplit =
2260+ let ( thesplit: tcenv1 -> tcenv ) =
21862261 match options.pgo_delta.pgod_split with
2187- | true -> t_split ~closeonly: false ~reduce: `Full
2262+ | true -> ( fun x -> t_split ~closeonly: false ~reduce: `Full x)
21882263 | false ->
2189- FApi. t_or
2190- (t_split ~reduce: `NoDelta )
2191- (t_split ~closeonly: true ~reduce: `Full ) in
2264+ FApi. t_or
2265+ (t_split ~reduce: `NoDelta )
2266+ (t_split ~closeonly: true ~reduce: `Full )
2267+ in
21922268
21932269 FApi. t_try (FApi. t_seq thesplit aux0) tc
21942270
0 commit comments