6

I'm a vim fan, but only emacs has this Isabelle/HOL environment. jEdit is great, but I cannot use

using [[simp_trace=true]]

like in emacs.

How to enable "Tracing" in jEdit?

chris
  • 4,988
  • 20
  • 36
njuguoyi
  • 399
  • 4
  • 10
  • Are you just referring to tracing the simplifier, or other tracing as well? – davidg Sep 26 '13 at 02:22
  • Are you using the official Isabelle/jEdit that comes with the Isabelle2013 release? – chris Sep 26 '13 at 03:06
  • Btw: For everything besides Isabelle, I'm also using vim and once upon a time I felt that I had to use Isabelle from inside vim (especially since the only alternative was emacs). At that time a student of mine implemented a vim plugin (long deprecated) that allowed to interact with Isabelle. But this was far inferior to Proof General and would never have been the same smooth experience as interacting with Isabelle through the document model underlying Isabelle/jEdit. So I long gave up on that urge ;) – chris Sep 26 '13 at 03:11
  • Chris is right. You should not put Isabelle/jEdit into the category with plain text editors. This is why we position it as "Prover IDE". – Makarius Oct 09 '13 at 19:19

3 Answers3

11

You can indeed use simp_trace in the middle of a proof in Isabelle/jEdit, like so:

lemma "(2 :: nat) + 2 = 4"
  using [[simp_trace]]
  apply simp
  done

Alternatively, you can declare it globally, like so:

declare [[simp_trace]]

lemma "(2 :: nat) + 2 = 4"
  apply simp
  done

Both give you the simplifier's trace in the "Output" window when your cursor is just after the apply simp statement in jEdit.

davidg
  • 5,868
  • 2
  • 33
  • 51
7

If you need a trace depth deeper than 1 (default), you fine-tune it by

declare [[simp_trace_depth_limit=4]] 

This example then gives a trace depth of 4.

chris
  • 4,988
  • 20
  • 36
Holger B
  • 71
  • 1
  • 1
3

As others have pointed out, you can use simp_trace. However, you can also use simp_trace_new combined with the "Simplifier Trace" window. This provides improved output over simp_trace:

lemma "rev (rev xs) = xs"
  using [[simp_trace_new]]
  apply(induction xs)
  apply(auto)
  done

To view the trace, position the cursor over "apply(auto)" then click on "See simplifier trace". The "Simplifier Trace" window(tab) should open. Click on "Show Trace" and a new window should appear showing a trace for each subgoal.

The Isabelle/Isar reference provides more details:

simp_trace_new controls Simplifier tracing within Isabelle/PIDE applications, notably Isabelle/jEdit.
This provides a hierarchical representation of the rewriting steps performed by the Simplifier.
Users can configure the behaviour by specifying breakpoints, verbosity and enabling or disabling the interactive mode.
In normal verbosity (the default), only rule applications matching a breakpoint will be shown to the user. In full verbosity, all rule applications will be logged. Interactive mode interrupts the normal flow of the Simplifier and defers the decision how to continue to the user via some GUI dialog.

Alternatively you can specify "using [[simp_trace_new mode=full]]" link here To see all steps taken by the simplifier.

NOTE: in the previous example, showing the trace of "apply(induction xs)" yields no output.