Sophie

Sophie

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

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               - Miscellaneous predicates</TITLE>
</HEAD>
<BODY> 
Go to the <A HREF="ciao_1.html">first</A>, <A HREF="ciao_104.html">previous</A>, <A HREF="ciao_106.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="SEC436" HREF="ciao_toc.html#TOC436">Miscellaneous predicates</A></H1>
<P>
<A NAME="IDX5390"></A>


<P>
<STRONG>Author(s):</STRONG> Manuel Carro, Daniel Cabeza.


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


<P>
<STRONG>Version of last change:</STRONG> 1.3#95 (1999/11/8, 18:37:30 MET)


<P>
This module implements some miscellaneous non-logical (but sometimes very useful) predicates.



<UL>
<LI><A HREF="ciao_105.html#SEC437">Usage and interface (odd)</A>
<LI><A HREF="ciao_105.html#SEC438">Documentation on exports (odd)</A>
</UL>



<H2><A NAME="SEC437" HREF="ciao_toc.html#TOC437">Usage and interface (<CODE>odd</CODE>)</A></H2>

<div class="cartouche">

<UL>

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

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

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


<UL>

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

<A NAME="IDX5391"></A>
<CODE>setarg/3</CODE>, 
<A NAME="IDX5392"></A>
<CODE>undo/1</CODE>.

</UL>

</UL>

</div class="cartouche">



<H2><A NAME="SEC438" HREF="ciao_toc.html#TOC438">Documentation on exports (<CODE>odd</CODE>)</A></H2>
<P>
<A NAME="IDX5393"></A>
<A NAME="IDX5394"></A>
<DL>
<DT><span class="define">PREDICATE:</span> <B>setarg/3:</B>
<DD><A NAME="IDX5395"></A>


<P>
<STRONG>Usage:</STRONG> <CODE>setarg(Index, Term, NewArg)</CODE>

<UL>
<LI><EM>Description:</EM> Replace destructively argument <CODE>Index</CODE> in <CODE>Term</CODE> by <CODE>NewArg</CODE>. The assignment is undone on backtracking. This is a major change to the normal behavior of data assignment in Ciao Prolog.

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

<CODE>Index</CODE> is currently instantiated to an integer.
 (<CODE>term_typing:integer/1</CODE>)

<CODE>Term</CODE> is a compound term.
 (<CODE>basic_props:struct/1</CODE>)

<CODE>NewArg</CODE> is any term.
 (<CODE>basic_props:term/1</CODE>)
<LI><EM>The following properties hold upon exit:</EM>

<CODE>Index</CODE> is currently instantiated to an integer.
 (<CODE>term_typing:integer/1</CODE>)

<CODE>Term</CODE> is a compound term.
 (<CODE>basic_props:struct/1</CODE>)

<CODE>NewArg</CODE> is any term.
 (<CODE>basic_props:term/1</CODE>)
</UL>

</DL>

<P>
<A NAME="IDX5396"></A>
<A NAME="IDX5397"></A>
<DL>
<DT><span class="define">PREDICATE:</span> <B>undo/1:</B>
<DD><A NAME="IDX5398"></A>


<P>
<EM>Meta-predicate</EM> with arguments: <CODE>undo(goal)</CODE>.


<P>
<STRONG>Usage:</STRONG> <CODE>undo(Goal)</CODE>

<UL>
<LI><EM>Description:</EM>  <CODE>call(<CODE>Goal</CODE>)</CODE> is executed on backtracking. This is a major change to the normal

<A NAME="IDX5399"></A>
control of Ciao Prolog execution. 
<LI><EM>The following properties should hold at call time:</EM>

<CODE>Goal</CODE> is a term which represents a goal, i.e., an atom or a structure.
 (<CODE>basic_props:callable/1</CODE>)
<LI><EM>The following properties hold upon exit:</EM>

<CODE>Goal</CODE> is a term which represents a goal, i.e., an atom or a structure.
 (<CODE>basic_props:callable/1</CODE>)
</UL>

</DL>

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