1064 |
1064 |
1065 val add_assumes = |
1065 val add_assumes = |
1066 Assumption.add_assms |
1066 Assumption.add_assms |
1067 (if strict_asm then Assumption.assume_export else Assumption.presume_export); |
1067 (if strict_asm then Assumption.assume_export else Assumption.presume_export); |
1068 |
1068 |
|
1069 (*params*) |
|
1070 val ((params, assumes_propss, shows_propss, result_binds), params_ctxt) = ctxt |
|
1071 |> prep_clause prep_var prep_propp raw_fixes (map snd raw_assumes) (map snd raw_shows); |
|
1072 |
|
1073 (*prems*) |
1069 val (assumes_bindings, shows_bindings) = |
1074 val (assumes_bindings, shows_bindings) = |
1070 apply2 (map (apsnd (map (prep_att ctxt)) o fst)) (raw_assumes, raw_shows); |
1075 apply2 (map (apsnd (map (prep_att ctxt)) o fst)) (raw_assumes, raw_shows); |
1071 |
|
1072 val ((params, assumes_propss, shows_propss, result_binds), params_ctxt) = ctxt |
|
1073 |> prep_clause prep_var prep_propp raw_fixes (map snd raw_assumes) (map snd raw_shows); |
|
1074 |
|
1075 val (that_fact, goal_ctxt) = params_ctxt |
1076 val (that_fact, goal_ctxt) = params_ctxt |
1076 |> fold_burrow add_assumes ((map o map) (Thm.cterm_of params_ctxt) assumes_propss) |
1077 |> fold_burrow add_assumes ((map o map) (Thm.cterm_of params_ctxt) assumes_propss) |
1077 |> (fn (premss, ctxt') => |
1078 |> (fn (premss, ctxt') => |
1078 let |
1079 let |
1079 val prems = Assumption.local_prems_of ctxt' ctxt; |
1080 val prems = Assumption.local_prems_of ctxt' ctxt; |
1084 [((Binding.name Auto_Bind.thatN, []), [(prems, [])])]) |
1085 [((Binding.name Auto_Bind.thatN, []), [(prems, [])])]) |
1085 |> (snd o Proof_Context.note_thmss "" |
1086 |> (snd o Proof_Context.note_thmss "" |
1086 (assumes_bindings ~~ map (map (fn th => ([th], []))) premss)) |
1087 (assumes_bindings ~~ map (map (fn th => ([th], []))) premss)) |
1087 in (prems, ctxt'') end); |
1088 in (prems, ctxt'') end); |
1088 |
1089 |
1089 fun after_qed' (result_ctxt, results) state' = state' |
1090 (*result*) |
1090 |> local_results (shows_bindings ~~ burrow (Proof_Context.export result_ctxt ctxt) results) |
1091 fun after_qed' (result_ctxt, results) state' = |
1091 |-> (fn res => tap (fn st => print_results (context_of st) ((kind, ""), res) : unit)) |
1092 let |
1092 |> after_qed (result_ctxt, results); |
1093 val ctxt' = context_of state'; |
|
1094 val export0 = |
|
1095 Assumption.export false result_ctxt ctxt' #> |
|
1096 fold_rev (fn (x, v) => Thm.forall_intr_name (x, Thm.cterm_of params_ctxt v)) params #> |
|
1097 Raw_Simplifier.norm_hhf_protect ctxt'; |
|
1098 val export = map export0 #> Variable.export result_ctxt ctxt'; |
|
1099 in |
|
1100 state' |
|
1101 |> local_results (shows_bindings ~~ burrow export results) |
|
1102 |-> (fn res => tap (fn st => print_results (context_of st) ((kind, ""), res) : unit)) |
|
1103 |> after_qed (result_ctxt, results) |
|
1104 end; |
1093 in |
1105 in |
1094 state |
1106 state |
1095 |> generic_goal kind before_qed (after_qed', K I) goal_ctxt shows_propss result_binds |
1107 |> generic_goal kind before_qed (after_qed', K I) goal_ctxt shows_propss result_binds |
1096 |> pair that_fact |
1108 |> pair that_fact |
1097 end; |
1109 end; |