350 |> redirect_graph axioms tainted bot |
350 |> redirect_graph axioms tainted bot |
351 (* |
351 (* |
352 |> tap (tracing o prefix "Direct proof: " o string_of_direct_proof) |
352 |> tap (tracing o prefix "Direct proof: " o string_of_direct_proof) |
353 *) |
353 *) |
354 |> isar_proof true params assms lems |
354 |> isar_proof true params assms lems |
355 |> postprocess_remove_unreferenced_steps I |
355 |> postprocess_isar_proof_remove_unreferenced_steps I |
356 |> relabel_proof_canonically |
356 |> relabel_isar_proof_canonically |
357 |> `(proof_preplay_data debug ctxt metis_type_enc metis_lam_trans do_preplay |
357 |> `(preplay_data_of_isar_proof debug ctxt metis_type_enc metis_lam_trans do_preplay |
358 preplay_timeout) |
358 preplay_timeout) |
359 |
359 |
360 val (play_outcome, isar_proof) = |
360 val (play_outcome, isar_proof) = |
361 isar_proof |
361 isar_proof |
362 |> compress_proof (if isar_proofs = SOME true then compress_isar else 1000.0) preplay_data |
362 |> compress_isar_proof (if isar_proofs = SOME true then compress_isar else 1000.0) |
|
363 preplay_data |
363 |> try0_isar ? try0_isar_proof preplay_timeout preplay_data |
364 |> try0_isar ? try0_isar_proof preplay_timeout preplay_data |
364 |> postprocess_remove_unreferenced_steps (try0_isar ? minimal_deps_of_step preplay_data) |
365 |> postprocess_isar_proof_remove_unreferenced_steps |
|
366 (try0_isar ? minimize_isar_step_dependencies preplay_data) |
365 |> `overall_preplay_outcome |
367 |> `overall_preplay_outcome |
366 ||> (chain_direct_proof #> kill_useless_labels_in_proof #> relabel_proof) |
368 ||> (chain_direct_proof #> kill_useless_labels_in_proof #> relabel_proof) |
367 |
369 |
368 val isar_text = |
370 val isar_text = |
369 string_of_proof ctxt metis_type_enc metis_lam_trans subgoal subgoal_count isar_proof |
371 string_of_isar_proof ctxt metis_type_enc metis_lam_trans subgoal subgoal_count isar_proof |
370 in |
372 in |
371 (case isar_text of |
373 (case isar_text of |
372 "" => |
374 "" => |
373 if isar_proofs = SOME true then |
375 if isar_proofs = SOME true then "\nNo structured proof available (proof too simple)." |
374 "\nNo structured proof available (proof too simple)." |
376 else "" |
375 else |
|
376 "" |
|
377 | _ => |
377 | _ => |
378 let |
378 let |
379 val msg = |
379 val msg = |
380 (if verbose then |
380 (if verbose then |
381 let val num_steps = add_isar_steps (steps_of_proof isar_proof) 0 in |
381 let val num_steps = add_isar_steps (steps_of_proof isar_proof) 0 in |
382 [string_of_int num_steps ^ " step" ^ plural_s num_steps] |
382 [string_of_int num_steps ^ " step" ^ plural_s num_steps] |
383 end |
383 end |
384 else |
384 else |
385 []) @ |
385 []) @ |
386 (if do_preplay then [string_of_play_outcome play_outcome] else []) |
386 (if do_preplay then [string_of_play_outcome play_outcome] else []) |
387 in |
387 in |
388 "\n\nStructured proof" ^ (commas msg |> not (null msg) ? enclose " (" ")") ^ ":\n" ^ |
388 "\n\nStructured proof" ^ (commas msg |> not (null msg) ? enclose " (" ")") ^ ":\n" ^ |