Go to the first, previous, next, last section, table of contents.


davinci (library)

Author(s): Francisco Bueno.

Version: 1.5#22 (1999/12/17, 16:59:51 MET)

Version of last change: 1.5#21 (1999/12/17, 16:28:20 MET)

This library allows connecting a Ciao Prolog application with daVinci V2.X (daVinci is developed by U. of Bremen, Germany).

For the time being, communication is based on a one-way channel: messages are sent to a daVinci process started on demand (i.e., for each Prolog goal a new daVinci process is started). Messages are sent via writing the term as text, but are treated as terms from the Prolog side, since for daVinci they are text but have term syntax; the only difficulty lies in strings, for which special Prolog syntax is provided.

Here are two simple examples of use:

davinci_ugraph(['A'-['B','C'],'B'-['D'],'C'-['E'],'D'-[],'E'-['D'],'F'-['B']]).

makes daVinci show a graph corresponding to the Prolog term representation of an unlabeled graph.

davinci_lgraph(['A'-['B'-[from,a,to,b],'C'-ac],'B'-['D'-bd],'C'-['E'-ce],
	        'D'-[],'E'-['D'-ed],'F'-['B'-fb]]).

makes daVinci show a graph corresponding to the Prolog term representation of a labeled graph. This will create the same graph as above, but showing labels in the edges.

Usage and interface (davinci)

Documentation on exports (davinci)

PREDICATE: davinci/0:

Start up a daVinci process.

PREDICATE: davinci_quit/0:

Exit daVinci process.

PREDICATE: davinci_ugraph/1:

Usage: davinci_ugraph(+Graph)

PREDICATE: davinci_lgraph/1:

Usage: davinci_lgraph(+Graph)

PREDICATE: formatting/2:

Usage: formatting(+Term,+Out)

PREDICATE: ugraph2term/2:

Usage: ugraph2term(+Graph,-(Term))

Documentation on internals (davinci)

REGTYPE: commandterm/1:

commandterm(Term)

Syntactically, Term is a just a term. Semantically, it has to correspond to a command understood by daVinci; otherwise daVinci reports back an error. Two functors within the subterms of Term are interpreted in a special way: string/1 and text/1. string(Term) is given to daVinci as "Term"; text(List) is given as "Term1 Term2 ...Term " for each Term in List. If your term has functors string/1 and text/1 that you don't want to be interpreted this way, use them twice, i.e., string(string(Term)) is given to daVinci as string(Term'), where Term' is the interpretation of Term.

Usage: commandterm(Term)

REGTYPE: specialugraph/1:

specialugraph(Graph)

Graph is a term which denotes an ugraph as in library(ugraphs). Vertices of the form node(Term,List) are interpreted as a vertex Term with attributes List. List is a list of terms conforming the syntax of commandterm, corresponding to daVinci's graph node attributes. If your vertex has functor node/2 and you don't want it to be interpreted this way, use it twice, i.e., node(node(T1,T2),[]) is given to daVinci as vertex node(T1,T2). A vertex is used both as label and name of daVinci's graph node; daVinci's graph edges have label V1-V2 where V1 is the source and V2 the sink of the edge. There is no support for multiple edges between the same two vertices.

Usage: specialugraph(Graph)

REGTYPE: speciallgraph/1:

speciallgraph(Graph)

Graph is an lgraph as in library(lgraphs), except that the weights are labels, i.e., they do not need to be integers. Vertices with functor node/2 are interpreted in a special way, as in specialugraph/1. Edge labels are converted into special intermediate vertices for daVinci; duplicated labels are solved by adding dummy atoms of the form ". There is no support for multiple edges between the same two vertices.

Usage: speciallgraph(Graph)

Known bugs and planned improvements (davinci)


Go to the first, previous, next, last section, table of contents.