src/Pure/Isar/attrib.ML
author wenzelm
Fri Jul 06 16:20:54 2012 +0200 (2012-07-06)
changeset 48205 09c2a3d9aa22
parent 47816 cd0dfb06b0c8
child 48992 0518bf89c777
permissions -rw-r--r--
discontinued obsolete attribute "COMP";
     1 (*  Title:      Pure/Isar/attrib.ML
     2     Author:     Markus Wenzel, TU Muenchen
     3 
     4 Symbolic representation of attributes -- with name and syntax.
     5 *)
     6 
     7 signature ATTRIB =
     8 sig
     9   type src = Args.src
    10   type binding = binding * src list
    11   val empty_binding: binding
    12   val is_empty_binding: binding -> bool
    13   val print_attributes: theory -> unit
    14   val intern: theory -> xstring -> string
    15   val intern_src: theory -> src -> src
    16   val pretty_attribs: Proof.context -> src list -> Pretty.T list
    17   val defined: theory -> string -> bool
    18   val attribute: Proof.context -> src -> attribute
    19   val attribute_global: theory -> src -> attribute
    20   val attribute_cmd: Proof.context -> src -> attribute
    21   val attribute_cmd_global: theory -> src -> attribute
    22   val map_specs: ('a list -> 'att list) ->
    23     (('c * 'a list) * 'b) list -> (('c * 'att list) * 'b) list
    24   val map_facts: ('a list -> 'att list) ->
    25     (('c * 'a list) * ('d * 'a list) list) list ->
    26     (('c * 'att list) * ('d * 'att list) list) list
    27   val map_facts_refs: ('a list -> 'att list) -> ('b -> 'fact) ->
    28     (('c * 'a list) * ('b * 'a list) list) list ->
    29     (('c * 'att list) * ('fact * 'att list) list) list
    30   val global_notes: string -> (binding * (thm list * src list) list) list ->
    31     theory -> (string * thm list) list * theory
    32   val local_notes: string -> (binding * (thm list * src list) list) list ->
    33     Proof.context -> (string * thm list) list * Proof.context
    34   val generic_notes: string -> (binding * (thm list * src list) list) list ->
    35     Context.generic -> (string * thm list) list * Context.generic
    36   val eval_thms: Proof.context -> (Facts.ref * src list) list -> thm list
    37   val setup: Binding.binding -> attribute context_parser -> string -> theory -> theory
    38   val attribute_setup: bstring * Position.T -> Symbol_Pos.text * Position.T -> string ->
    39     theory -> theory
    40   val add_del: attribute -> attribute -> attribute context_parser
    41   val thm_sel: Facts.interval list parser
    42   val thm: thm context_parser
    43   val thms: thm list context_parser
    44   val multi_thm: thm list context_parser
    45   val partial_evaluation: Proof.context ->
    46     (binding * (thm list * Args.src list) list) list ->
    47     (binding * (thm list * Args.src list) list) list
    48   val internal: (morphism -> attribute) -> src
    49   val print_configs: Proof.context -> unit
    50   val config_bool: Binding.binding ->
    51     (Context.generic -> bool) -> bool Config.T * (theory -> theory)
    52   val config_int: Binding.binding ->
    53     (Context.generic -> int) -> int Config.T * (theory -> theory)
    54   val config_real: Binding.binding ->
    55     (Context.generic -> real) -> real Config.T * (theory -> theory)
    56   val config_string: Binding.binding ->
    57     (Context.generic -> string) -> string Config.T * (theory -> theory)
    58   val setup_config_bool: Binding.binding -> (Context.generic -> bool) -> bool Config.T
    59   val setup_config_int: Binding.binding -> (Context.generic -> int) -> int Config.T
    60   val setup_config_string: Binding.binding -> (Context.generic -> string) -> string Config.T
    61   val setup_config_real: Binding.binding -> (Context.generic -> real) -> real Config.T
    62 end;
    63 
    64 structure Attrib: ATTRIB =
    65 struct
    66 
    67 (* source and bindings *)
    68 
    69 type src = Args.src;
    70 
    71 type binding = binding * src list;
    72 
    73 val empty_binding: binding = (Binding.empty, []);
    74 fun is_empty_binding ((b, srcs): binding) = Binding.is_empty b andalso null srcs;
    75 
    76 
    77 
    78 (** named attributes **)
    79 
    80 (* theory data *)
    81 
    82 structure Attributes = Theory_Data
    83 (
    84   type T = ((src -> attribute) * string) Name_Space.table;
    85   val empty : T = Name_Space.empty_table "attribute";
    86   val extend = I;
    87   fun merge data : T = Name_Space.merge_tables data;
    88 );
    89 
    90 fun print_attributes thy =
    91   let
    92     val ctxt = Proof_Context.init_global thy;
    93     val attribs = Attributes.get thy;
    94     fun prt_attr (name, (_, "")) = Pretty.str name
    95       | prt_attr (name, (_, comment)) =
    96           Pretty.block [Pretty.str (name ^ ":"), Pretty.brk 2, Pretty.str comment];
    97   in
    98     [Pretty.big_list "attributes:" (map prt_attr (Name_Space.extern_table ctxt attribs))]
    99     |> Pretty.chunks |> Pretty.writeln
   100   end;
   101 
   102 fun add_attribute name att comment thy = thy
   103   |> Attributes.map (Name_Space.define (Context.Theory thy) true (name, (att, comment)) #> snd);
   104 
   105 
   106 (* name space *)
   107 
   108 val intern = Name_Space.intern o #1 o Attributes.get;
   109 val intern_src = Args.map_name o intern;
   110 
   111 fun extern ctxt = Name_Space.extern ctxt (#1 (Attributes.get (Proof_Context.theory_of ctxt)));
   112 
   113 
   114 (* pretty printing *)
   115 
   116 fun pretty_attribs _ [] = []
   117   | pretty_attribs ctxt srcs =
   118       [Pretty.enum "," "[" "]" (map (Args.pretty_src ctxt o Args.map_name (extern ctxt)) srcs)];
   119 
   120 
   121 (* get attributes *)
   122 
   123 val defined = Symtab.defined o #2 o Attributes.get;
   124 
   125 fun attribute_generic context =
   126   let
   127     val thy = Context.theory_of context;
   128     val (space, tab) = Attributes.get thy;
   129     fun attr src =
   130       let val ((name, _), pos) = Args.dest_src src in
   131         (case Symtab.lookup tab name of
   132           NONE => error ("Unknown attribute: " ^ quote name ^ Position.str_of pos)
   133         | SOME (att, _) =>
   134             (Context_Position.report_generic context pos (Name_Space.markup space name); att src))
   135       end;
   136   in attr end;
   137 
   138 val attribute = attribute_generic o Context.Proof;
   139 val attribute_global = attribute_generic o Context.Theory;
   140 
   141 fun attribute_cmd ctxt = attribute ctxt o intern_src (Proof_Context.theory_of ctxt);
   142 fun attribute_cmd_global thy = attribute_global thy o intern_src thy;
   143 
   144 
   145 (* attributed declarations *)
   146 
   147 fun map_specs f = map (apfst (apsnd f));
   148 
   149 fun map_facts f = map (apfst (apsnd f) o apsnd (map (apsnd f)));
   150 fun map_facts_refs f g = map_facts f #> map (apsnd (map (apfst g)));
   151 
   152 
   153 (* fact expressions *)
   154 
   155 fun global_notes kind facts thy = thy |>
   156   Global_Theory.note_thmss kind (map_facts (map (attribute_global thy)) facts);
   157 
   158 fun local_notes kind facts ctxt = ctxt |>
   159   Proof_Context.note_thmss kind (map_facts (map (attribute ctxt)) facts);
   160 
   161 fun generic_notes kind facts context = context |>
   162   Context.mapping_result (global_notes kind facts) (local_notes kind facts);
   163 
   164 fun eval_thms ctxt srcs = ctxt
   165   |> Proof_Context.note_thmss ""
   166     (map_facts_refs (map (attribute_cmd ctxt)) (Proof_Context.get_fact ctxt)
   167       [((Binding.empty, []), srcs)])
   168   |> fst |> maps snd;
   169 
   170 
   171 (* attribute setup *)
   172 
   173 fun syntax scan = Args.syntax "attribute" scan;
   174 
   175 fun setup name scan =
   176   add_attribute name
   177     (fn src => fn (ctxt, th) => let val (a, ctxt') = syntax scan src ctxt in a (ctxt', th) end);
   178 
   179 fun attribute_setup name (txt, pos) cmt =
   180   Context.theory_map (ML_Context.expression pos
   181     "val (name, scan, comment): binding * attribute context_parser * string"
   182     "Context.map_theory (Attrib.setup name scan comment)"
   183     (ML_Lex.read Position.none ("(" ^ ML_Syntax.make_binding name ^ ", ") @
   184       ML_Lex.read pos txt @
   185       ML_Lex.read Position.none (", " ^ ML_Syntax.print_string cmt ^ ")")));
   186 
   187 
   188 (* add/del syntax *)
   189 
   190 fun add_del add del = Scan.lift (Args.add >> K add || Args.del >> K del || Scan.succeed add);
   191 
   192 
   193 
   194 (** parsing attributed theorems **)
   195 
   196 val thm_sel = Parse.$$$ "(" |-- Parse.list1
   197  (Parse.nat --| Parse.minus -- Parse.nat >> Facts.FromTo ||
   198   Parse.nat --| Parse.minus >> Facts.From ||
   199   Parse.nat >> Facts.Single) --| Parse.$$$ ")";
   200 
   201 local
   202 
   203 val fact_name = Args.internal_fact >> K "<fact>" || Args.name;
   204 
   205 fun gen_thm pick = Scan.depend (fn context =>
   206   let
   207     val thy = Context.theory_of context;
   208     val get = Context.cases (Global_Theory.get_fact context) Proof_Context.get_fact context;
   209     val get_fact = get o Facts.Fact;
   210     fun get_named pos name = get (Facts.Named ((name, pos), NONE));
   211   in
   212     Parse.$$$ "[" |-- Args.attribs (intern thy) --| Parse.$$$ "]" >> (fn srcs =>
   213       let
   214         val atts = map (attribute_generic context) srcs;
   215         val (th', context') = fold (uncurry o Thm.apply_attribute) atts (Drule.dummy_thm, context);
   216       in (context', pick "" [th']) end)
   217     ||
   218     (Scan.ahead Args.alt_name -- Args.named_fact get_fact
   219       >> (fn (s, fact) => ("", Facts.Fact s, fact)) ||
   220      Scan.ahead (Parse.position fact_name) :|-- (fn (name, pos) =>
   221       Args.named_fact (get_named pos) -- Scan.option thm_sel
   222         >> (fn (fact, sel) => (name, Facts.Named ((name, pos), sel), fact))))
   223     -- Args.opt_attribs (intern thy) >> (fn ((name, thmref, fact), srcs) =>
   224       let
   225         val ths = Facts.select thmref fact;
   226         val atts = map (attribute_generic context) srcs;
   227         val (ths', context') =
   228           fold_map (curry (fold (uncurry o Thm.apply_attribute) atts)) ths context;
   229       in (context', pick name ths') end)
   230   end);
   231 
   232 in
   233 
   234 val thm = gen_thm Facts.the_single;
   235 val multi_thm = gen_thm (K I);
   236 val thms = Scan.repeat multi_thm >> flat;
   237 
   238 end;
   239 
   240 
   241 
   242 (** partial evaluation -- observing rule/declaration/mixed attributes **)
   243 
   244 local
   245 
   246 val strict_eq_thm = op = o pairself Thm.rep_thm;
   247 
   248 fun apply_att src (context, th) =
   249   let
   250     val src1 = Args.assignable src;
   251     val result = attribute_generic context src1 (context, th);
   252     val src2 = Args.closure src1;
   253   in (src2, result) end;
   254 
   255 fun err msg src =
   256   let val ((name, _), pos) = Args.dest_src src
   257   in error (msg ^ " " ^ quote name ^ Position.str_of pos) end;
   258 
   259 fun eval src ((th, dyn), (decls, context)) =
   260   (case (apply_att src (context, th), dyn) of
   261     ((_, (NONE, SOME th')), NONE) => ((th', NONE), (decls, context))
   262   | ((_, (NONE, SOME _)), SOME _) => err "Mixed dynamic attribute followed by static rule" src
   263   | ((src', (SOME context', NONE)), NONE) =>
   264       let
   265         val decls' =
   266           (case decls of
   267             [] => [(th, [src'])]
   268           | (th2, srcs2) :: rest =>
   269               if strict_eq_thm (th, th2)
   270               then ((th2, src' :: srcs2) :: rest)
   271               else (th, [src']) :: (th2, srcs2) :: rest);
   272       in ((th, NONE), (decls', context')) end
   273   | ((src', (opt_context', opt_th')), _) =>
   274       let
   275         val context' = the_default context opt_context';
   276         val th' = the_default th opt_th';
   277         val dyn' =
   278           (case dyn of
   279             NONE => SOME (th, [src'])
   280           | SOME (dyn_th, srcs) => SOME (dyn_th, src' :: srcs));
   281       in ((th', dyn'), (decls, context')) end);
   282 
   283 in
   284 
   285 fun partial_evaluation ctxt facts =
   286   (facts, Context.Proof (Context_Position.set_visible false ctxt)) |->
   287     fold_map (fn ((b, more_atts), fact) => fn context =>
   288       let
   289         val (fact', (decls, context')) =
   290           (fact, ([], context)) |-> fold_map (fn (ths, atts) => fn res1 =>
   291             (ths, res1) |-> fold_map (fn th => fn res2 =>
   292               let
   293                 val ((th', dyn'), res3) = fold eval (atts @ more_atts) ((th, NONE), res2);
   294                 val th_atts' =
   295                   (case dyn' of
   296                     NONE => (th', [])
   297                   | SOME (dyn_th', atts') => (dyn_th', rev atts'));
   298               in (th_atts', res3) end))
   299           |>> flat;
   300         val decls' = rev (map (apsnd rev) decls);
   301         val facts' =
   302           if eq_list (eq_fst strict_eq_thm) (decls', fact') then
   303             [((b, []), map2 (fn (th, atts1) => fn (_, atts2) => (th, atts1 @ atts2)) decls' fact')]
   304           else if null decls' then [((b, []), fact')]
   305           else [(empty_binding, decls'), ((b, []), fact')];
   306       in (facts', context') end)
   307   |> fst |> flat |> map (apsnd (map (apfst single)))
   308   |> filter_out (fn (b, fact) => is_empty_binding b andalso forall (null o #2) fact);
   309 
   310 end;
   311 
   312 
   313 
   314 (** basic attributes **)
   315 
   316 (* internal *)
   317 
   318 fun internal att = Args.src (("Pure.attribute", [Token.mk_attribute att]), Position.none);
   319 
   320 
   321 (* rule composition *)
   322 
   323 val THEN_att =
   324   Scan.lift (Scan.optional (Args.bracks Parse.nat) 1) -- thm
   325     >> (fn (i, B) => Thm.rule_attribute (fn _ => fn A => A RSN (i, B)));
   326 
   327 val OF_att =
   328   thms >> (fn Bs => Thm.rule_attribute (fn _ => fn A => Bs MRS A));
   329 
   330 
   331 (* rename_abs *)
   332 
   333 val rename_abs =
   334   Scan.repeat (Args.maybe Args.name)
   335   >> (fn args => Thm.rule_attribute (K (Drule.rename_bvars' args)));
   336 
   337 
   338 (* unfold / fold definitions *)
   339 
   340 fun unfolded_syntax rule =
   341   thms >> (fn ths => Thm.rule_attribute (fn context => rule (Context.proof_of context) ths));
   342 
   343 val unfolded = unfolded_syntax Local_Defs.unfold;
   344 val folded = unfolded_syntax Local_Defs.fold;
   345 
   346 
   347 (* rule format *)
   348 
   349 val rule_format = Args.mode "no_asm"
   350   >> (fn true => Object_Logic.rule_format_no_asm | false => Object_Logic.rule_format);
   351 
   352 val elim_format = Thm.rule_attribute (K Tactic.make_elim);
   353 
   354 
   355 (* case names *)
   356 
   357 val case_names =
   358   Scan.repeat1 (Args.name --
   359     Scan.optional (Parse.$$$ "[" |-- Scan.repeat1 (Args.maybe Args.name) --| Parse.$$$ "]") []) >>
   360   (fn cs =>
   361     Rule_Cases.cases_hyp_names (map fst cs)
   362       (map (map (the_default Rule_Cases.case_hypsN) o snd) cs));
   363 
   364 
   365 (* misc rules *)
   366 
   367 val no_vars = Thm.rule_attribute (fn context => fn th =>
   368   let
   369     val ctxt = Variable.set_body false (Context.proof_of context);
   370     val ((_, [th']), _) = Variable.import true [th] ctxt;
   371   in th' end);
   372 
   373 val eta_long =
   374   Thm.rule_attribute (K (Conv.fconv_rule Drule.eta_long_conversion));
   375 
   376 val rotated = Scan.optional Parse.int 1 >> (fn n => Thm.rule_attribute (K (rotate_prems n)));
   377 
   378 
   379 (* theory setup *)
   380 
   381 val _ = Context.>> (Context.map_theory
   382  (setup (Binding.name "attribute") (Scan.lift Args.internal_attribute >> Morphism.form)
   383     "internal attribute" #>
   384   setup (Binding.name "tagged") (Scan.lift (Args.name -- Args.name) >> Thm.tag) "tagged theorem" #>
   385   setup (Binding.name "untagged") (Scan.lift Args.name >> Thm.untag) "untagged theorem" #>
   386   setup (Binding.name "kind") (Scan.lift Args.name >> Thm.kind) "theorem kind" #>
   387   setup (Binding.name "THEN") THEN_att "resolution with rule" #>
   388   setup (Binding.name "OF") OF_att "rule applied to facts" #>
   389   setup (Binding.name "rename_abs") (Scan.lift rename_abs)
   390     "rename bound variables in abstractions" #>
   391   setup (Binding.name "unfolded") unfolded "unfolded definitions" #>
   392   setup (Binding.name "folded") folded "folded definitions" #>
   393   setup (Binding.name "consumes") (Scan.lift (Scan.optional Parse.nat 1) >> Rule_Cases.consumes)
   394     "number of consumed facts" #>
   395   setup (Binding.name "constraints") (Scan.lift Parse.nat >> Rule_Cases.constraints)
   396     "number of equality constraints" #>
   397   setup (Binding.name "case_names") (Scan.lift case_names) "named rule cases" #>
   398   setup (Binding.name "case_conclusion")
   399     (Scan.lift (Args.name -- Scan.repeat Args.name) >> Rule_Cases.case_conclusion)
   400     "named conclusion of rule cases" #>
   401   setup (Binding.name "params")
   402     (Scan.lift (Parse.and_list1 (Scan.repeat Args.name)) >> Rule_Cases.params)
   403     "named rule parameters" #>
   404   setup (Binding.name "standard") (Scan.succeed (Thm.rule_attribute (K Drule.export_without_context)))
   405     "result put into standard form (legacy)" #>
   406   setup (Binding.name "rule_format") rule_format "result put into canonical rule format" #>
   407   setup (Binding.name "elim_format") (Scan.succeed elim_format)
   408     "destruct rule turned into elimination rule format" #>
   409   setup (Binding.name "no_vars") (Scan.succeed no_vars) "frozen schematic vars" #>
   410   setup (Binding.name "eta_long") (Scan.succeed eta_long)
   411     "put theorem into eta long beta normal form" #>
   412   setup (Binding.name "atomize") (Scan.succeed Object_Logic.declare_atomize)
   413     "declaration of atomize rule" #>
   414   setup (Binding.name "rulify") (Scan.succeed Object_Logic.declare_rulify)
   415     "declaration of rulify rule" #>
   416   setup (Binding.name "rotated") (Scan.lift rotated) "rotated theorem premises" #>
   417   setup (Binding.name "defn") (add_del Local_Defs.defn_add Local_Defs.defn_del)
   418     "declaration of definitional transformations" #>
   419   setup (Binding.name "abs_def")
   420     (Scan.succeed (Thm.rule_attribute (fn context =>
   421       Local_Defs.meta_rewrite_rule (Context.proof_of context) #> Drule.abs_def)))
   422     "abstract over free variables of definitionial theorem"));
   423 
   424 
   425 
   426 (** configuration options **)
   427 
   428 (* naming *)
   429 
   430 structure Configs = Theory_Data
   431 (
   432   type T = Config.raw Symtab.table;
   433   val empty = Symtab.empty;
   434   val extend = I;
   435   fun merge data = Symtab.merge (K true) data;
   436 );
   437 
   438 fun print_configs ctxt =
   439   let
   440     val thy = Proof_Context.theory_of ctxt;
   441     fun prt (name, config) =
   442       let val value = Config.get ctxt config in
   443         Pretty.block [Pretty.str (name ^ ": " ^ Config.print_type value ^ " ="), Pretty.brk 1,
   444           Pretty.str (Config.print_value value)]
   445       end;
   446     val configs = Name_Space.extern_table ctxt (#1 (Attributes.get thy), Configs.get thy);
   447   in Pretty.writeln (Pretty.big_list "configuration options" (map prt configs)) end;
   448 
   449 
   450 (* concrete syntax *)
   451 
   452 local
   453 
   454 val equals = Parse.$$$ "=";
   455 
   456 fun scan_value (Config.Bool _) =
   457       equals -- Args.$$$ "false" >> K (Config.Bool false) ||
   458       equals -- Args.$$$ "true" >> K (Config.Bool true) ||
   459       Scan.succeed (Config.Bool true)
   460   | scan_value (Config.Int _) = equals |-- Parse.int >> Config.Int
   461   | scan_value (Config.Real _) = equals |-- Parse.real >> Config.Real
   462   | scan_value (Config.String _) = equals |-- Args.name >> Config.String;
   463 
   464 fun scan_config thy config =
   465   let val config_type = Config.get_global thy config
   466   in scan_value config_type >> (K o Thm.declaration_attribute o K o Config.put_generic config) end;
   467 
   468 fun register binding config thy =
   469   let val name = Sign.full_name thy binding in
   470     thy
   471     |> setup binding (Scan.lift (scan_config thy config) >> Morphism.form) "configuration option"
   472     |> Configs.map (Symtab.update (name, config))
   473   end;
   474 
   475 fun declare make coerce binding default =
   476   let
   477     val name = Binding.name_of binding;
   478     val config_value = Config.declare_generic {global = false} name (make o default);
   479     val config = coerce config_value;
   480   in (config, register binding config_value) end;
   481 
   482 in
   483 
   484 val config_bool = declare Config.Bool Config.bool;
   485 val config_int = declare Config.Int Config.int;
   486 val config_real = declare Config.Real Config.real;
   487 val config_string = declare Config.String Config.string;
   488 
   489 fun register_config config = register (Binding.name (Config.name_of config)) config;
   490 
   491 end;
   492 
   493 
   494 (* implicit setup *)
   495 
   496 local
   497 
   498 fun setup_config declare_config binding default =
   499   let
   500     val (config, setup) = declare_config binding default;
   501     val _ = Context.>> (Context.map_theory setup);
   502   in config end;
   503 
   504 in
   505 
   506 val setup_config_bool = setup_config config_bool;
   507 val setup_config_int = setup_config config_int;
   508 val setup_config_string = setup_config config_string;
   509 val setup_config_real = setup_config config_real;
   510 
   511 end;
   512 
   513 
   514 (* theory setup *)
   515 
   516 val _ = Context.>> (Context.map_theory
   517  (register_config Ast.trace_raw #>
   518   register_config Ast.stats_raw #>
   519   register_config Printer.show_brackets_raw #>
   520   register_config Printer.show_sorts_raw #>
   521   register_config Printer.show_types_raw #>
   522   register_config Printer.show_structs_raw #>
   523   register_config Printer.show_question_marks_raw #>
   524   register_config Syntax.ambiguity_warning_raw #>
   525   register_config Syntax.ambiguity_limit_raw #>
   526   register_config Syntax_Trans.eta_contract_raw #>
   527   register_config Name_Space.names_long_raw #>
   528   register_config Name_Space.names_short_raw #>
   529   register_config Name_Space.names_unique_raw #>
   530   register_config ML_Context.trace_raw #>
   531   register_config Proof_Context.show_abbrevs_raw #>
   532   register_config Goal_Display.goals_limit_raw #>
   533   register_config Goal_Display.show_main_goal_raw #>
   534   register_config Goal_Display.show_consts_raw #>
   535   register_config Display.show_hyps_raw #>
   536   register_config Display.show_tags_raw #>
   537   register_config Unify.trace_bound_raw #>
   538   register_config Unify.search_bound_raw #>
   539   register_config Unify.trace_simp_raw #>
   540   register_config Unify.trace_types_raw #>
   541   register_config Raw_Simplifier.simp_depth_limit_raw #>
   542   register_config Raw_Simplifier.simp_trace_depth_limit_raw #>
   543   register_config Raw_Simplifier.simp_debug_raw #>
   544   register_config Raw_Simplifier.simp_trace_raw));
   545 
   546 end;