1 (* Title: HOL/Library/Reflection.thy
2 Author: Amine Chaieb, TU Muenchen
5 header {* Generic reflection and reification *}
11 ML_file "~~/src/HOL/Tools/reflection.ML"
13 method_setup reify = {*
15 Scan.option (Scan.lift (Args.$$$ "(") |-- Args.term --| Scan.lift (Args.$$$ ")")) >>
16 (fn (user_eqs, to) => fn ctxt => SIMPLE_METHOD' (Reflection.default_reify_tac ctxt user_eqs to))
17 *} "partial automatic reification"
19 method_setup reflection = {*
21 fun keyword k = Scan.lift (Args.$$$ k -- Args.colon) >> K ();
24 val any_keyword = keyword onlyN || keyword rulesN;
25 val thms = Scan.repeat (Scan.unless any_keyword Attrib.multi_thm) >> flat;
26 val terms = thms >> map (term_of o Drule.dest_term);
28 thms -- Scan.optional (keyword rulesN |-- thms) [] --
29 Scan.option (keyword onlyN |-- Args.term) >>
30 (fn ((user_eqs, user_thms), to) => fn ctxt =>
31 SIMPLE_METHOD' (Reflection.default_reflection_tac ctxt user_thms user_eqs to))
33 *} "partial automatic reflection"