src/HOL/Tools/Sledgehammer/sledgehammer_isar_minimize.ML
changeset 55252 0dc4993b4f56
parent 55244 12e1a5d8ee48
child 55255 eceebcea3e00
equal deleted inserted replaced
55251:85f5d7da4ab6 55252:0dc4993b4f56
    24 open Sledgehammer_Isar_Preplay
    24 open Sledgehammer_Isar_Preplay
    25 
    25 
    26 val slack = seconds 0.1
    26 val slack = seconds 0.1
    27 
    27 
    28 fun minimize_isar_step_dependencies (_ : isar_preplay_data) (step as Let _) = step
    28 fun minimize_isar_step_dependencies (_ : isar_preplay_data) (step as Let _) = step
    29   | minimize_isar_step_dependencies
    29   | minimize_isar_step_dependencies {set_preplay_outcomes, preplay_outcome, preplay_quietly, ...}
    30       {reset_preplay_outcomes, set_preplay_outcome, preplay_outcome, preplay_quietly, ...}
       
    31       (step as Prove (qs, xs, l, t, subproofs, ((lfs, gfs), meths as meth :: _))) =
    30       (step as Prove (qs, xs, l, t, subproofs, ((lfs, gfs), meths as meth :: _))) =
    32     (case Lazy.force (preplay_outcome l meth) of
    31     (case Lazy.force (preplay_outcome l meth) of
    33       Played time =>
    32       Played time =>
    34       let
    33       let
    35         fun mk_step_lfs_gfs lfs gfs = Prove (qs, xs, l, t, subproofs, ((lfs, gfs), meths))
    34         fun mk_step_lfs_gfs lfs gfs = Prove (qs, xs, l, t, subproofs, ((lfs, gfs), meths))
    41               Played time => minimize_facts mk_step time min_facts facts
    40               Played time => minimize_facts mk_step time min_facts facts
    42             | _ => minimize_facts mk_step time (f :: min_facts) facts)
    41             | _ => minimize_facts mk_step time (f :: min_facts) facts)
    43 
    42 
    44         val (time, min_lfs) = minimize_facts (mk_step_gfs_lfs gfs) time [] lfs
    43         val (time, min_lfs) = minimize_facts (mk_step_gfs_lfs gfs) time [] lfs
    45         val (time, min_gfs) = minimize_facts (mk_step_lfs_gfs min_lfs) time [] gfs
    44         val (time, min_gfs) = minimize_facts (mk_step_lfs_gfs min_lfs) time [] gfs
    46 
       
    47         val step' = mk_step_lfs_gfs min_lfs min_gfs
       
    48       in
    45       in
    49         reset_preplay_outcomes step';
    46         set_preplay_outcomes l [(meth, Lazy.value (Played time))];
    50         set_preplay_outcome l meth (Played time);
    47         mk_step_lfs_gfs min_lfs min_gfs
    51         step'
       
    52       end
    48       end
    53     | _ => step (* don't touch steps that time out or fail *))
    49     | _ => step (* don't touch steps that time out or fail *))
    54 
    50 
    55 fun postprocess_isar_proof_remove_unreferenced_steps postproc_step =
    51 fun postprocess_isar_proof_remove_unreferenced_steps postproc_step =
    56   let
    52   let