etrace - Graphical Prolog Tracer in Emacs



First, an important observation: "Tracing" is not synonymous with "debugging"! In Prolog, there are powerful declarative debugging methods that help you much more than tracing.

Still, to augment the textual Prolog tracer's output with positional information, download the Prolog library etrace.pl to your program directory, and add to your Prolog program:
      :- use_module(etrace).
    
To use that information in Emacs, copy etrace.el to your load path and add to your .emacs:
      (require 'etrace)
    
Restart Emacs, open a Prolog program that contains a :- use_module(etrace) declaration, do M-x etrace RET and enter a query to start tracing a goal in that file.

You can also use the positional information emitted from an existing shell buffer or Prolog process created by the Prolog editing mode: Switch to the process buffer and do M-x etrace-attach RET.


A screenshot: etrace.png.

An example Prolog file is turing.pl. Try:

M-x etrace RET turing([1], Ts) RET


More about Prolog: The Power of Prolog


Main page