equal
deleted
inserted
replaced
31 | keep_fastest_method_of_isar_step _ step = step |
31 | keep_fastest_method_of_isar_step _ step = step |
32 |
32 |
33 val slack = seconds 0.1 |
33 val slack = seconds 0.1 |
34 |
34 |
35 fun minimize_isar_step_dependencies ctxt preplay_data |
35 fun minimize_isar_step_dependencies ctxt preplay_data |
36 (step as Prove (qs, xs, l, t, subproofs, ((lfs, gfs), meths as meth :: _))) = |
36 (step as Prove (qs, xs, l, t, subproofs, ((lfs0, gfs0), meths as meth :: _))) = |
37 (case Lazy.force (preplay_outcome_of_isar_step_for_method (!preplay_data) l meth) of |
37 (case Lazy.force (preplay_outcome_of_isar_step_for_method (!preplay_data) l meth) of |
38 Played time => |
38 Played time => |
39 let |
39 let |
40 fun mk_step_lfs_gfs lfs gfs = Prove (qs, xs, l, t, subproofs, ((lfs, gfs), meths)) |
40 fun mk_step_lfs_gfs lfs gfs = Prove (qs, xs, l, t, subproofs, ((lfs, gfs), meths)) |
41 |
41 |
44 (case preplay_isar_step ctxt (Time.+ (time, slack)) meth |
44 (case preplay_isar_step ctxt (Time.+ (time, slack)) meth |
45 (mk_step (min_facts @ facts)) of |
45 (mk_step (min_facts @ facts)) of |
46 Played time => minimize_facts mk_step time min_facts facts |
46 Played time => minimize_facts mk_step time min_facts facts |
47 | _ => minimize_facts mk_step time (f :: min_facts) facts) |
47 | _ => minimize_facts mk_step time (f :: min_facts) facts) |
48 |
48 |
49 val (time, min_lfs) = minimize_facts (fn lfs => mk_step_lfs_gfs lfs gfs) time [] lfs |
49 val (time, min_lfs) = minimize_facts (fn lfs => mk_step_lfs_gfs lfs gfs0) time [] lfs0 |
50 val (time, min_gfs) = minimize_facts (mk_step_lfs_gfs min_lfs) time [] gfs |
50 val (time, min_gfs) = minimize_facts (mk_step_lfs_gfs min_lfs) time [] gfs0 |
51 |
51 |
52 val step' = mk_step_lfs_gfs min_lfs min_gfs |
52 val step' = mk_step_lfs_gfs min_lfs min_gfs |
53 in |
53 in |
54 set_preplay_outcomes_of_isar_step ctxt time preplay_data step' |
54 set_preplay_outcomes_of_isar_step ctxt time preplay_data step' |
55 [(meth, Lazy.value (Played time))]; |
55 [(meth, Lazy.value (Played time))]; |