src/Pure/Isar/proof.ML
changeset 12167 74f92a43bac3
parent 12146 8e02a45f77e2
child 12223 d5e76c2e335c
equal deleted inserted replaced
12166:5fc22b8c03e9 12167:74f92a43bac3
   340     fun subgoals 0 = ""
   340     fun subgoals 0 = ""
   341       | subgoals 1 = ", 1 subgoal"
   341       | subgoals 1 = ", 1 subgoal"
   342       | subgoals n = ", " ^ string_of_int n ^ " subgoals";
   342       | subgoals n = ", " ^ string_of_int n ^ " subgoals";
   343 
   343 
   344     fun prt_names names =
   344     fun prt_names names =
   345       (case filter_out (equal "") names of [] => "" | nms => space_implode " and " nms);
   345       (case filter_out (equal "") names of [] => "" | nms => " " ^ space_implode " and " nms);
   346 
   346 
   347     fun prt_goal (_, (i, (((kind, names, _), (goal_facts, thm)), _))) =
   347     fun prt_goal (_, (i, (((kind, names, _), (goal_facts, thm)), _))) =
   348       pretty_facts "using " ctxt
   348       pretty_facts "using " ctxt
   349         (if mode <> Backward orelse null goal_facts then None else Some goal_facts) @
   349         (if mode <> Backward orelse null goal_facts then None else Some goal_facts) @
   350       [Pretty.str ("goal (" ^ kind_name (sign_of state) kind ^ prt_names names ^
   350       [Pretty.str ("goal (" ^ kind_name (sign_of state) kind ^ prt_names names ^
   630     else warning ("Goal statement contains unbound schematic variable(s): " ^
   630     else warning ("Goal statement contains unbound schematic variable(s): " ^
   631       commas (map (ProofContext.string_of_term (context_of state')) vars));
   631       commas (map (ProofContext.string_of_term (context_of state')) vars));
   632     state'
   632     state'
   633     |> map_context (autofix props)
   633     |> map_context (autofix props)
   634     |> put_goal (Some (((kind, names, propss), ([], goal)), after_qed o map_context gen_binds))
   634     |> put_goal (Some (((kind, names, propss), ([], goal)), after_qed o map_context gen_binds))
   635     |> map_context (ProofContext.add_cases (RuleCases.make true goal [rule_contextN]))
   635     |> map_context (ProofContext.add_cases
       
   636      (if length props = 1 then RuleCases.make true goal [rule_contextN]
       
   637       else [(rule_contextN, RuleCases.empty)]))
   636     |> auto_bind_goal props
   638     |> auto_bind_goal props
   637     |> (if is_chain state then use_facts else reset_facts)
   639     |> (if is_chain state then use_facts else reset_facts)
   638     |> new_block
   640     |> new_block
   639     |> enter_backward
   641     |> enter_backward
   640   end;
   642   end;