Author(s): Francisco Bueno.
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.
davinci
):- use_module(library(davinci)).
davinci
)Start up a daVinci process.
A toplevel to send to daVinci commands from standard input.
Usage: davinci_get(Term)
Term
is a term corresponding to daVinci's message.
Usage: davinci_get_all(List)
List
is a list of terms as in davinci_get/1
.
List
is a list.
(basic_props:list/1
)
Usage: davinci_put(Term)
davinci:davinci_command(Term)
(davinci:davinci_command/1
)
Exit daVinci process. All pending answers are lost!
Usage: davinci_ugraph(Graph)
davinci:ugraph(Graph)
(davinci:ugraph/1
)
Usage: davinci_lgraph(Graph)
davinci:lgraph(Graph)
(davinci:lgraph/1
)
No further documentation available for this predicate.
No further documentation available for this predicate.
davinci
)
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
.
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.
lgraph(Graph)
Graph
is a term which denotes a wgraph as in library(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.