equal
deleted
inserted
replaced
16 |
16 |
17 val simp_trace_test = |
17 val simp_trace_test = |
18 Attrib.setup_config_bool @{binding simp_trace_test} (K false) |
18 Attrib.setup_config_bool @{binding simp_trace_test} (K false) |
19 |
19 |
20 val _ = Theory.setup |
20 val _ = Theory.setup |
21 (Simplifier.map_theory_simpset (Simplifier.set_trace_ops |
21 (Simplifier.set_trace_ops |
22 {trace_invoke = fn {depth, term} => fn ctxt => |
22 {trace_invoke = fn {depth, term} => fn ctxt => |
23 (if Config.get ctxt simp_trace_test then |
23 (if Config.get ctxt simp_trace_test then |
24 tracing ("Simplifier invocation " ^ string_of_int depth ^ ": " ^ |
24 tracing ("Simplifier invocation " ^ string_of_int depth ^ ": " ^ |
25 Syntax.string_of_term ctxt term) |
25 Syntax.string_of_term ctxt term) |
26 else (); ctxt), |
26 else (); ctxt), |
27 trace_apply = fn args => fn ctxt => fn cont => |
27 trace_apply = fn args => fn ctxt => fn cont => |
28 (if Config.get ctxt simp_trace_test then |
28 (if Config.get ctxt simp_trace_test then |
29 tracing ("Simplifier " ^ @{make_string} args) |
29 tracing ("Simplifier " ^ @{make_string} args) |
30 else (); cont ctxt)})) |
30 else (); cont ctxt)}) |
31 |
31 |
32 |
32 |
33 (* PIDE protocol *) |
33 (* PIDE protocol *) |
34 |
34 |
35 val _ = Session.protocol_handler "isabelle.Simplifier_Trace$Handler" |
35 val _ = Session.protocol_handler "isabelle.Simplifier_Trace$Handler" |