src/Pure/Isar/proof.ML
changeset 45390 e29521ef9059
parent 45327 4a027cc86f1a
child 45597 ce23193a42a4
equal deleted inserted replaced
45389:bc0d50f8ae19 45390:e29521ef9059
   591 local
   591 local
   592 
   592 
   593 fun gen_assume asm prep_att exp args state =
   593 fun gen_assume asm prep_att exp args state =
   594   state
   594   state
   595   |> assert_forward
   595   |> assert_forward
   596   |> map_context_result (asm exp (Attrib.map_specs (prep_att (theory_of state)) args))
   596   |> map_context_result (asm exp (Attrib.map_specs (map (prep_att (theory_of state))) args))
   597   |> these_factss [] |> #2;
   597   |> these_factss [] |> #2;
   598 
   598 
   599 in
   599 in
   600 
   600 
   601 val assm = gen_assume Proof_Context.add_assms_i (K I);
   601 val assm = gen_assume Proof_Context.add_assms_i (K I);
   663 
   663 
   664 fun gen_thmss more_facts opt_chain opt_result prep_atts prep_fact args state =
   664 fun gen_thmss more_facts opt_chain opt_result prep_atts prep_fact args state =
   665   state
   665   state
   666   |> assert_forward
   666   |> assert_forward
   667   |> map_context_result (Proof_Context.note_thmss ""
   667   |> map_context_result (Proof_Context.note_thmss ""
   668     (Attrib.map_facts_refs (prep_atts (theory_of state)) (prep_fact (context_of state)) args))
   668     (Attrib.map_facts_refs
       
   669       (map (prep_atts (theory_of state)))
       
   670       (prep_fact (context_of state)) args))
   669   |> these_factss (more_facts state)
   671   |> these_factss (more_facts state)
   670   ||> opt_chain
   672   ||> opt_chain
   671   |> opt_result;
   673   |> opt_result;
   672 
   674 
   673 in
   675 in
   688 
   690 
   689 (* using/unfolding *)
   691 (* using/unfolding *)
   690 
   692 
   691 local
   693 local
   692 
   694 
   693 fun gen_using f g prep_atts prep_fact args state =
   695 fun gen_using f g prep_att prep_fact args state =
   694   state
   696   state
   695   |> assert_backward
   697   |> assert_backward
   696   |> map_context_result
   698   |> map_context_result
   697     (Proof_Context.note_thmss ""
   699     (Proof_Context.note_thmss ""
   698       (Attrib.map_facts_refs (prep_atts (theory_of state)) (prep_fact (context_of state))
   700       (Attrib.map_facts_refs (map (prep_att (theory_of state))) (prep_fact (context_of state))
   699         (no_binding args)))
   701         (no_binding args)))
   700   |> (fn (named_facts, state') =>
   702   |> (fn (named_facts, state') =>
   701     state' |> map_goal I (fn (statement, _, using, goal, before_qed, after_qed) =>
   703     state' |> map_goal I (fn (statement, _, using, goal, before_qed, after_qed) =>
   702       let
   704       let
   703         val ctxt = context_of state';
   705         val ctxt = context_of state';
   914 
   916 
   915 fun local_goal print_results prep_att prepp kind before_qed after_qed stmt state =
   917 fun local_goal print_results prep_att prepp kind before_qed after_qed stmt state =
   916   let
   918   let
   917     val thy = theory_of state;
   919     val thy = theory_of state;
   918     val ((names, attss), propp) =
   920     val ((names, attss), propp) =
   919       Attrib.map_specs (prep_att thy) stmt |> split_list |>> split_list;
   921       Attrib.map_specs (map (prep_att thy)) stmt |> split_list |>> split_list;
   920 
   922 
   921     fun after_qed' results =
   923     fun after_qed' results =
   922       local_results ((names ~~ attss) ~~ results)
   924       local_results ((names ~~ attss) ~~ results)
   923       #-> (fn res => tap (fn st => print_results (context_of st) ((kind, ""), res) : unit))
   925       #-> (fn res => tap (fn st => print_results (context_of st) ((kind, ""), res) : unit))
   924       #> after_qed results;
   926       #> after_qed results;