Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Making Prolog programs visual

2 views
Skip to first unread message

Michael Igler

unread,
Jul 7, 2008, 5:02:41 AM7/7/08
to
I am on search for some tools that can visualize prolog programs
like presenting the proof tree or so.

I know Vis for SPASS output and Snarks for Satchmo output.
Alloy from the MIT can also do a visualization, but has its own syntax.

I thought of a diagram where different worlds are linked through
relations. In these worlds different statemants hold.

The code that I want to visualize is the following:

:- dynamic done/1.

% black_edge and so black_conn connecting two processes
black_conn(X,Y) :- black_edge(X,Z), black_conn(Z,Y).
black_conn(X,Y) :- black_edge(X,Y).

% red_conn connecting two processes
red_conn(X,Y) :- red_edge(X,Y).

% Now A shall also be required in order to execute C:
% A -black-> B -red-> C ==implies==> A -red-> C
red_conn(X,Z) :- black_conn(X,Y), red_conn(Y,Z).


% Is a process executable?
executable(X) :- black_conn(X,_).
executable(Y) :- black_conn(_,Y).
executable(X) :- red_conn(X,_).
% A process that is connected through a red edge
% shall only be executable if all preceding processes
% have been executed
executable(Y) :- \+ (red_conn(X,Y),\+ done(X)).


% MODEL FLOW
% A -black-> B -black-> C -black-> D -red-> E
black_edge(a,b).
black_edge(b,c).
black_edge(c,d).
red_edge(d,e).

Any tips and hints are appreciated.


Michael

Michael Igler

unread,
Jul 8, 2008, 3:43:35 AM7/8/08
to
Michael Igler <michae...@web.de> wrote:


I have found a tool under:

http://www.cs.bris.ac.uk/Teaching/Resources/COMS30106/graphviz/


Michael


Marco Gavanelli

unread,
Jul 8, 2008, 10:58:40 AM7/8/08
to
Michael Igler wrote:
> I am on search for some tools that can visualize prolog programs
> like presenting the proof tree or so.

Here you can find a metainterpreter that shows the SLDNF tree in LaTeX:

http://www.ing.unife.it/docenti/MarcoGavanelli/sldnfDraw/

Cheers,
Marco

--
http://www.ing.unife.it/docenti/MarcoGavanelli/

Cameron Hughes

unread,
Jul 24, 2008, 8:32:59 AM7/24/08
to
Michael Igler wrote:

Check out the book 'The Transparent Prolog Machine: Visualizing Logic
Programs"
by Marc Eisenstadt, Mike Bradyshaw and Jocelyn Paine,

I think there is software for it as well.


Cameron

0 new messages