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


Interface to daVinci

Author(s): Francisco Bueno.

Version: 1.10#6 (2004/8/7, 21:46:39 CEST)

Version of last change: 1.9#76 (2003/4/14, 18:31:46 CEST)

This library allows connecting a Ciao Prolog application with daVinci V2.X.

The communication is based on a two-way channel: after daVinci is started, messages are sent in to it and read in from it on demand by different Prolog predicates. Messages are sent via writing the term as text; messages are received by reading text and returning an atom. Commands sent and answers received 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.

See accompanying file library('davinci/commands') for examples on the use of this library.

daVinci is developed by U. of Bremen, Germany.

Usage and interface (davinci)

Documentation on exports (davinci)

PREDICATE: davinci/0:

Start up a daVinci process.

PREDICATE: topd/0:

A toplevel to send to daVinci commands from standard input.

PREDICATE: davinci_get/1:

Usage: davinci_get(Term)

PREDICATE: davinci_get_all/1:

Usage: davinci_get_all(List)

PREDICATE: davinci_put/1:

Usage: davinci_put(Term)

PREDICATE: davinci_quit/0:

Exit daVinci process. All pending answers are lost!

PREDICATE: davinci_ugraph/1:

Usage: davinci_ugraph(Graph)

PREDICATE: davinci_lgraph/1:

Usage: davinci_lgraph(Graph)

PREDICATE: ugraph2term/2:

No further documentation available for this predicate.

PREDICATE: formatting/2:

No further documentation available for this predicate.

Documentation on internals (davinci)

PROPERTY: davinci_command/1:

Syntactically, a command is a term. Semantically, it has to correspond to a command understood by daVinci. Two terms 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 it twice, i.e., string(string(Term)) is given to daVinci as string(Term') where Term' is the interpretation of Term.

PROPERTY: ugraph/1:

ugraph(Graph)

Graph is a term which denotes an ugraph as in library(ugraphs). Vertices of the form node/2 are interpreted in a special way: node(Term,List) is interpreted as a vertex Term with attributes List. List is a list of terms conforming the syntax of davinci_put/1 and corresponding to daVinci's graph nodes 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.

PROPERTY: lgraph/1:

lgraph(Graph)

Graph is a term which denotes a wgraph as in library('graphs/wgraphs'), except that the weights are labels, i.e., they do not need to be integers. Vertices of the form node/2 are interpreted in a special way. Edge labels are converted into special intermediate vertices. Duplicated labels are solved by adding dummy atoms ". There is no support for multiple edges between the same two vertices.


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