src/Pure/goal.ML
changeset 49845 9b19c0e81166
parent 49830 28d207ba9340
child 49847 ed5080c03165
equal deleted inserted replaced
49844:19ea3242ec37 49845:9b19c0e81166
    19 sig
    19 sig
    20   include BASIC_GOAL
    20   include BASIC_GOAL
    21   val init: cterm -> thm
    21   val init: cterm -> thm
    22   val protect: thm -> thm
    22   val protect: thm -> thm
    23   val conclude: thm -> thm
    23   val conclude: thm -> thm
    24   val check_finished: Proof.context -> thm -> unit
    24   val check_finished: Proof.context -> thm -> thm
    25   val finish: Proof.context -> thm -> thm
    25   val finish: Proof.context -> thm -> thm
    26   val norm_result: thm -> thm
    26   val norm_result: thm -> thm
    27   val fork_name: string -> (unit -> 'a) -> 'a future
    27   val fork_name: string -> (unit -> 'a) -> 'a future
    28   val fork: (unit -> 'a) -> 'a future
    28   val fork: (unit -> 'a) -> 'a future
    29   val peek_futures: serial -> unit future list
    29   val peek_futures: serial -> unit future list
    83   --- (finish)
    83   --- (finish)
    84    C
    84    C
    85 *)
    85 *)
    86 fun check_finished ctxt th =
    86 fun check_finished ctxt th =
    87   (case Thm.nprems_of th of
    87   (case Thm.nprems_of th of
    88     0 => ()
    88     0 => th
    89   | n => raise THM ("Proof failed.\n" ^
    89   | n => raise THM ("Proof failed.\n" ^
    90       Pretty.string_of (Pretty.chunks
    90       Pretty.string_of (Pretty.chunks
    91         (Goal_Display.pretty_goals
    91         (Goal_Display.pretty_goals
    92           (ctxt
    92           (ctxt
    93             |> Config.put Goal_Display.goals_limit n
    93             |> Config.put Goal_Display.goals_limit n
    94             |> Config.put Goal_Display.show_main_goal true) th)) ^
    94             |> Config.put Goal_Display.show_main_goal true) th)) ^
    95       "\n" ^ string_of_int n ^ " unsolved goal(s)!", 0, [th]));
    95       "\n" ^ string_of_int n ^ " unsolved goal(s)!", 0, [th]));
    96 
    96 
    97 fun finish ctxt th = (check_finished ctxt th; conclude th);
    97 fun finish ctxt = check_finished ctxt #> conclude;
    98 
    98 
    99 
    99 
   100 
   100 
   101 (** results **)
   101 (** results **)
   102 
   102