Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > by-pkgid > 2fc07611b08d4a735fd34d5eb60d8e16 > files > 2068

ciao-1.10p8-3mdv2010.0.i586.rpm

<HTML>
<HEAD>
<!-- Created by texi2html 1.56k + clip patches and <A href="http://www.clip.dia.fi.upm.es/Software">lpdoc</A> from ciao.texi on 28 January 2007 -->

<LINK rel="stylesheet" href="ciao.css" type="text/css">
<TITLE>The Ciao Prolog System               - Interface to daVinci</TITLE>
</HEAD>
<BODY> 
Go to the <A HREF="ciao_1.html">first</A>, <A HREF="ciao_123.html">previous</A>, <A HREF="ciao_125.html">next</A>, <A HREF="ciao_241.html">last</A> section, <A HREF="ciao_toc.html">table of contents</A>.
<P><HR><P>


<H1><A NAME="SEC534" HREF="ciao_toc.html#TOC534">Interface to daVinci</A></H1>
<P>
<A NAME="IDX5948"></A>


<P>
<STRONG>Author(s):</STRONG> Francisco Bueno.


<P>
<STRONG>Version:</STRONG> 1.10#7 (2006/4/26, 19:22:13 CEST)


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


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


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


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


<P>
daVinci is developed by U. of Bremen, Germany.



<UL>
<LI><A HREF="ciao_124.html#SEC535">Usage and interface (davinci)</A>
<LI><A HREF="ciao_124.html#SEC536">Documentation on exports (davinci)</A>
<LI><A HREF="ciao_124.html#SEC537">Documentation on internals (davinci)</A>
</UL>



<H2><A NAME="SEC535" HREF="ciao_toc.html#TOC535">Usage and interface (<CODE>davinci</CODE>)</A></H2>

<div class="cartouche">

<UL>

<LI><STRONG>Library usage:</STRONG>

<CODE>:- use_module(library(davinci)).</CODE>

<LI><STRONG>Exports:</STRONG>


<UL>

<LI><EM>Predicates:</EM>

<A NAME="IDX5949"></A>
<CODE>davinci/0</CODE>, 
<A NAME="IDX5950"></A>
<CODE>topd/0</CODE>, 
<A NAME="IDX5951"></A>
<CODE>davinci_get/1</CODE>, 
<A NAME="IDX5952"></A>
<CODE>davinci_get_all/1</CODE>, 
<A NAME="IDX5953"></A>
<CODE>davinci_put/1</CODE>, 
<A NAME="IDX5954"></A>
<CODE>davinci_quit/0</CODE>, 
<A NAME="IDX5955"></A>
<CODE>davinci_ugraph/1</CODE>, 
<A NAME="IDX5956"></A>
<CODE>davinci_lgraph/1</CODE>, 
<A NAME="IDX5957"></A>
<CODE>ugraph2term/2</CODE>, 
<A NAME="IDX5958"></A>
<CODE>formatting/2</CODE>.

</UL>

<LI><STRONG>Other modules used:</STRONG>


<UL>

<LI><EM>System library modules:</EM>

<A NAME="IDX5959"></A>
<CODE>aggregates</CODE>, 
<A NAME="IDX5960"></A>
<CODE>prompt</CODE>, 
<A NAME="IDX5961"></A>
<CODE>errhandle</CODE>, 
<A NAME="IDX5962"></A>
<CODE>format</CODE>, 
<A NAME="IDX5963"></A>
<CODE>read</CODE>, 
<A NAME="IDX5964"></A>
<CODE>graphs/ugraphs</CODE>, 
<A NAME="IDX5965"></A>
<CODE>write</CODE>, 
<A NAME="IDX5966"></A>
<CODE>system</CODE>, 
<A NAME="IDX5967"></A>
<CODE>sets</CODE>, 
<A NAME="IDX5968"></A>
<CODE>sort</CODE>.

</UL>

</UL>

</div class="cartouche">



<H2><A NAME="SEC536" HREF="ciao_toc.html#TOC536">Documentation on exports (<CODE>davinci</CODE>)</A></H2>
<P>
<A NAME="IDX5969"></A>
<A NAME="IDX5970"></A>
<DL>
<DT><span class="define">PREDICATE:</span> <B>davinci/0:</B>
<DD><A NAME="IDX5971"></A>


<P>
Start up a daVinci process.


</DL>

<P>
<A NAME="IDX5972"></A>
<A NAME="IDX5973"></A>
<DL>
<DT><span class="define">PREDICATE:</span> <B>topd/0:</B>
<DD><A NAME="IDX5974"></A>


<P>
A toplevel to send to daVinci commands from standard input.


</DL>

<P>
<A NAME="IDX5975"></A>
<A NAME="IDX5976"></A>
<DL>
<DT><span class="define">PREDICATE:</span> <B>davinci_get/1:</B>
<DD><A NAME="IDX5977"></A>


<P>
<STRONG>Usage:</STRONG> <CODE>davinci_get(Term)</CODE>

<UL>
<LI><EM>Description:</EM> Get a message from daVinci. <CODE>Term</CODE> is a term corresponding to daVinci's message.

</UL>

</DL>

<P>
<A NAME="IDX5978"></A>
<A NAME="IDX5979"></A>
<DL>
<DT><span class="define">PREDICATE:</span> <B>davinci_get_all/1:</B>
<DD><A NAME="IDX5980"></A>


<P>
<STRONG>Usage:</STRONG> <CODE>davinci_get_all(List)</CODE>

<UL>
<LI><EM>Description:</EM> Get all pending messages. <CODE>List</CODE> is a list of terms as in <CODE>davinci_get/1</CODE>.

<LI><EM>The following properties should hold upon exit:</EM>

<CODE>List</CODE> is a list.
 (<CODE>basic_props:list/1</CODE>)
</UL>

</DL>

<P>
<A NAME="IDX5981"></A>
<A NAME="IDX5982"></A>
<DL>
<DT><span class="define">PREDICATE:</span> <B>davinci_put/1:</B>
<DD><A NAME="IDX5983"></A>


<P>
<STRONG>Usage:</STRONG> <CODE>davinci_put(Term)</CODE>

<UL>
<LI><EM>Description:</EM> Send a command to daVinci.

<LI><EM>The following properties should hold at call time:</EM>

<CODE>davinci:davinci_command(Term)</CODE>
 (<CODE>davinci:davinci_command/1</CODE>)
</UL>

</DL>

<P>
<A NAME="IDX5984"></A>
<A NAME="IDX5985"></A>
<DL>
<DT><span class="define">PREDICATE:</span> <B>davinci_quit/0:</B>
<DD><A NAME="IDX5986"></A>


<P>
Exit daVinci process. All pending answers are lost!


</DL>

<P>
<A NAME="IDX5987"></A>
<A NAME="IDX5988"></A>
<DL>
<DT><span class="define">PREDICATE:</span> <B>davinci_ugraph/1:</B>
<DD><A NAME="IDX5989"></A>


<P>
<STRONG>Usage:</STRONG> <CODE>davinci_ugraph(Graph)</CODE>

<UL>
<LI><EM>Description:</EM> Send a graph to daVinci.

<LI><EM>The following properties should hold at call time:</EM>

<CODE>davinci:ugraph(Graph)</CODE>
 (<CODE>davinci:ugraph/1</CODE>)
</UL>

</DL>

<P>
<A NAME="IDX5990"></A>
<A NAME="IDX5991"></A>
<DL>
<DT><span class="define">PREDICATE:</span> <B>davinci_lgraph/1:</B>
<DD><A NAME="IDX5992"></A>


<P>
<STRONG>Usage:</STRONG> <CODE>davinci_lgraph(Graph)</CODE>

<UL>
<LI><EM>Description:</EM> Send a labeled graph to daVinci.

<LI><EM>The following properties should hold at call time:</EM>

<CODE>davinci:lgraph(Graph)</CODE>
 (<CODE>davinci:lgraph/1</CODE>)
</UL>

</DL>

<P>
<A NAME="IDX5993"></A>
<A NAME="IDX5994"></A>
<DL>
<DT><span class="define">PREDICATE:</span> <B>ugraph2term/2:</B>
<DD><A NAME="IDX5995"></A>


<P>
No further documentation available for this predicate.


</DL>

<P>
<A NAME="IDX5996"></A>
<A NAME="IDX5997"></A>
<DL>
<DT><span class="define">PREDICATE:</span> <B>formatting/2:</B>
<DD><A NAME="IDX5998"></A>


<P>
No further documentation available for this predicate.


</DL>



<H2><A NAME="SEC537" HREF="ciao_toc.html#TOC537">Documentation on internals (<CODE>davinci</CODE>)</A></H2>
<P>
<A NAME="IDX5999"></A>
<A NAME="IDX6000"></A>
<DL>
<DT><span class="define">PROPERTY:</span> <B>davinci_command/1:</B>
<DD><A NAME="IDX6001"></A>


<P>
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: <CODE>string/1</CODE> and <CODE>text/1</CODE>: <CODE>string(Term)</CODE> is given to daVinci as <CODE>"Term"</CODE>; <CODE>text(List)</CODE> is given as <CODE>"Term1 Term2 ...Term "</CODE> for each <CODE>Term</CODE> in <CODE>List</CODE>. If your term has functors <CODE>string/1</CODE> and <CODE>text/1</CODE> that you don't want to be interpreted this way, use it twice, i.e., <CODE>string(string(Term))</CODE> is given to daVinci as <CODE>string(Term')</CODE> where <CODE>Term'</CODE> is the interpretation of <CODE>Term</CODE>.


</DL>

<P>
<A NAME="IDX6002"></A>
<A NAME="IDX6003"></A>
<DL>
<DT><span class="define">PROPERTY:</span> <B>ugraph/1:</B>
<DD><A NAME="IDX6004"></A>


<P>
<CODE>ugraph(Graph)</CODE>


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


</DL>

<P>
<A NAME="IDX6005"></A>
<A NAME="IDX6006"></A>
<DL>
<DT><span class="define">PROPERTY:</span> <B>lgraph/1:</B>
<DD><A NAME="IDX6007"></A>


<P>
<CODE>lgraph(Graph)</CODE>


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


</DL>

<P><HR><P>
Go to the <A HREF="ciao_1.html">first</A>, <A HREF="ciao_123.html">previous</A>, <A HREF="ciao_125.html">next</A>, <A HREF="ciao_241.html">last</A> section, <A HREF="ciao_toc.html">table of contents</A>.
</BODY>
</HTML>