Making Prolog programs visual

This is a discussion on Making Prolog programs visual within the PROLOG forums in Programming Languages category; 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 ...

Go Back   Application Development Forum > Programming Languages > PROLOG

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 07-07-2008, 05:02 AM
Michael Igler
Guest
 
Default Making Prolog programs visual

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

Reply With Quote
  #2  
Old 07-08-2008, 03:43 AM
Michael Igler
Guest
 
Default Re: Making Prolog programs visual

Michael Igler <michael.igler@web.de> wrote:

> 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
>



I have found a tool under:

http://www.cs.bris.ac.uk/Teaching/Re...0106/graphviz/


Michael


Reply With Quote
  #3  
Old 07-08-2008, 10:58 AM
Marco Gavanelli
Guest
 
Default Re: Making Prolog programs visual

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/Marc...lli/sldnfDraw/

Cheers,
Marco

--
http://www.ing.unife.it/docenti/MarcoGavanelli/
Reply With Quote
  #4  
Old 07-24-2008, 08:32 AM
Cameron Hughes
Guest
 
Default Re: Making Prolog programs visual

Michael Igler wrote:

> 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
>


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

Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 04:13 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.