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