67 |
67 |
68 val types'' = map (Logic.dest_type o Thm.term_of o Drule.dest_term) res_types; |
68 val types'' = map (Logic.dest_type o Thm.term_of o Drule.dest_term) res_types; |
69 val params'' = map (Thm.term_of o Drule.dest_term) res_params; |
69 val params'' = map (Thm.term_of o Drule.dest_term) res_params; |
70 val elems' = elems |> map (Element.inst_ctxt thy |
70 val elems' = elems |> map (Element.inst_ctxt thy |
71 (Symtab.make (map #1 types ~~ types''), Symtab.make (map #1 params ~~ params''))); |
71 (Symtab.make (map #1 types ~~ types''), Symtab.make (map #1 params ~~ params''))); |
|
72 val prems'' = map2 Element.make_witness (maps Element.prems_of elems') res_prems; |
72 |
73 |
73 val prems'' = map2 Element.make_witness (maps Element.prems_of elems') res_prems; |
|
74 val Element.Notes notes = |
74 val Element.Notes notes = |
75 Element.Notes (maps (Element.facts_of thy) elems') |
75 Element.Notes (maps (Element.facts_of thy) elems') |
76 |> Element.satisfy_ctxt prems'' |
76 |> Element.satisfy_ctxt prems'' |
77 |> Element.map_ctxt_values I I (ProofContext.export ctxt'' ctxt); |
77 |> Element.map_ctxt_values I I (ProofContext.export ctxt'' ctxt); |
78 (* FIXME export typs/terms *) |
78 (* FIXME export typs/terms *) |
79 |
|
80 val _ = print notes; |
|
81 |
|
82 val notes' = notes |
79 val notes' = notes |
83 |> Attrib.map_facts (Attrib.attribute_i thy) |
80 |> Attrib.map_facts (Attrib.attribute_i thy) |
84 |> map (fn ((a, atts), facts) => ((a, atts @ more_atts), facts)); |
81 |> map (fn ((a, atts), facts) => ((a, atts @ more_atts), facts)); |
85 |
|
86 in |
82 in |
87 ctxt |
83 ctxt |
88 |> ProofContext.sticky_prefix prfx |
84 |> ProofContext.sticky_prefix prfx |
89 |> ProofContext.qualified_names |
85 |> ProofContext.qualified_names |
90 |> (snd o ProofContext.note_thmss_i notes') |
86 |> (snd o ProofContext.note_thmss_i notes') |
91 |> ProofContext.restore_naming ctxt |
87 |> ProofContext.restore_naming ctxt |
92 end) #> Proof.put_facts NONE); |
88 end) #> Proof.put_facts NONE); |
93 in |
89 in |
94 state' |
90 state' |
95 |> Proof.local_goal (ProofDisplay.print_results int) (K I) ProofContext.bind_propp_schematic_i |
91 |> Proof.local_goal (K (K ())) (K I) ProofContext.bind_propp_schematic_i |
96 "invoke" NONE after_qed propp |
92 "invoke" NONE after_qed propp |
97 |> Element.refine_witness |
93 |> Element.refine_witness |
98 |> Seq.hd |
94 |> Seq.hd |
99 |> Proof.refine (Method.Basic (K (Method.METHOD (K (HEADGOAL (RANGE (map rtac inst_rules))))))) |
95 |> Proof.refine (Method.Basic (K (Method.METHOD (K (HEADGOAL (RANGE (map rtac inst_rules))))))) |
100 |> Seq.hd |
96 |> Seq.hd |