Re: using gxref on a single module

Paulo Moura <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <[email protected]>
On 04/02/2014, at 19:38, Abdallah, Samer <[email protected]> wrote:

> Hello all,
> ...
> Finally, it would seem to be useful to get a dependency graph between
> predicates in a module - is there any tool which can do this?
> In the meantime, I am drawing the graph with pen and paper...

Using the latest Logtalk 3 git version, you should be able to compile your Prolog module as a Logtalk object (by simply renaming the source file from *.pl to *.lgt) and then use the Logtalk's "diagrams" tool to generate your graph (a .dot file that you can easily convert to e.g. .pdf or .svg). If you want to try it, follow these steps (after installing Logtalk and Graphviz and assuming a POSIX shell):

$ cp source.pl source.lgt
$ swilgt
...

?- {diagrams(loader)}.
...
% (0 warnings)
true.

?- {source}, xref_diagram::entity(error).
...
true.

?- halt.

$ dot -Tpdf module_object_xref_diagram.dot > module_object_xref_diagram.pdf && open module_object_xref_diagram.pdf

If you're curious about this tool, check:

http://forums.logtalk.org/viewtopic.php?f=21&t=222

Two examples for your concrete case using SWI-Prolog error and graphml_ugraph modules:

http://logtalk.org/files/diagrams/error_object_xref_diagram.pdf
http://logtalk.org/files/diagrams/graphml_ugraph_object_xref_diagram.pdf

This particular kind of graph is work in progress so feedback is most welcome.

Cheers,

Paulo

-----------------------------------------------------------------
Paulo Moura
Logtalk developer

Email: <mailto:[email protected]>
Web:   <http://logtalk.org/>
-----------------------------------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.