I have a prolog file in which I have predicates of the type:
nondet_(A,B,C,D,E,F,G,H) :-
(I = 0),
summary_5(A,B,C,D,J,K,L,G,H),
nondet(I,B,C,D,E,F,K,L).
summary_5(A,B,C,D,E,F,G,H,I) :-
(K = F),(M = 0),(N = G),
block_10(M,B,C,D,E,F,G,K,N),
summary_4(A,B,C,D,E,J,N,H,I).
interface_0(A,B,C,D,E) :-
(F = 0),
summary_5(F,A,B,C,G,H,I,D,E),
interface_0(A,B,C,H,I).
How can I make (even using another tool) a dependency graph of predicates?
I need to generate the graph to include dependencies within the programme (which is translated into horn clauses in the prolog language)
You can use Logtalk's
diagramstool to easily generate a dependency graph for the predicates. Assuming the plain Prolog code is saved in acode.plfile and that you're running Logtalk with GNU Prolog:This will generated a Graphviz
.dotfile that you can then convert to e.g. SVG:For your sample code (note that predicates are missing in your listing):
For more details, see https://logtalk.org/manuals/devtools/diagrams.html#creating-diagrams-for-plain-prolog-files