Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > by-pkgid > d1f06a5336fd6bf4a381b72b8d2b5ce1 > files > 153

gprolog-1.2.16-3mdk.ppc.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>

<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="hevea 1.06-7 of 2001-11-14">
<TITLE>
 Types and modes
</TITLE>
</HEAD>
<BODY TEXT=black BGCOLOR=white>
<A HREF="manual017.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="manual016.html"><IMG SRC ="contents_motif.gif" ALT="Contents"></A>
<A HREF="manual019.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
<HR>
<TABLE CELLPADDING=0 CELLSPACING=0 WIDTH="100%">
<TR><TD BGCOLOR="#66dbff"><DIV ALIGN=center><TABLE>
<TR><TD><FONT SIZE=4><B><A NAME="htoc31">5.2</A></B></FONT></TD>
<TD WIDTH="100%" ALIGN=center><FONT SIZE=4><B>Types and modes</B></FONT></TD>
</TR></TABLE></DIV></TD>
</TR></TABLE>
<A NAME="Types-and-modes"></A>
The templates part defines, for each argument of the concerned built-in
predicate, its mode and type. The mode specifies whether or not the argument
must be instantiated when the built-in predicate is called. The mode is
encoded with a symbol just before the type. Possible modes are:
<UL><LI><TT>+</TT>: the argument must be instantiated.<BR>
<BR>
<LI><TT>-</TT>: the argument must be a variable (will be instantiated if
the built-in predicate succeeds).<BR>
<BR>
<LI><TT>?</TT>: the argument can be instantiated or a variable.</UL>
The type of an argument is defined by the following table:<BR>
<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=1>
<TR><TD VALIGN=top ALIGN=left NOWRAP>Type</TD>
<TD VALIGN=top ALIGN=left>Description</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT><I>TYPE</I>_list</TT></TD>
<TD VALIGN=top ALIGN=left>a list whose the type of each element is
<I><TT>TYPE</TT></I></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT><I>TYPE1</I>_or_<I>TYPE2</I></TT></TD>
<TD VALIGN=top ALIGN=left>a term whose type is either
<I><TT>TYPE1</TT></I> or <I><TT>TYPE2</TT></I></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT>atom</TT></TD>
<TD VALIGN=top ALIGN=left>an atom</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT>atom_property</TT></TD>
<TD VALIGN=top ALIGN=left>an atom property (section&nbsp;<A HREF="manual042.html#atom-property/2">7.19.12</A>)</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT>boolean</TT></TD>
<TD VALIGN=top ALIGN=left>the atom <TT>true</TT> or <TT>false</TT></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT>byte</TT></TD>
<TD VALIGN=top ALIGN=left>an integer &gt;= 0 and &lt;= 255</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT>callable_term</TT></TD>
<TD VALIGN=top ALIGN=left>an atom or a compound term</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT>character</TT></TD>
<TD VALIGN=top ALIGN=left>a single character atom</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT>character_code</TT></TD>
<TD VALIGN=top ALIGN=left>an integer &gt;= 1 and &lt;= 255</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT>clause</TT></TD>
<TD VALIGN=top ALIGN=left>a clause (fact or rule)</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT>close_option</TT></TD>
<TD VALIGN=top ALIGN=left>a close option (section&nbsp;<A HREF="manual033.html#close/2">7.10.7</A>)</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT>compound_term</TT></TD>
<TD VALIGN=top ALIGN=left>a compound term</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT>evaluable</TT></TD>
<TD VALIGN=top ALIGN=left>an arithmetic expression (section&nbsp;<A HREF="manual029.html#Evaluation-of-an-arithmetic-expression">7.6.1</A>)</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT>fd_bool_evaluable</TT></TD>
<TD VALIGN=top ALIGN=left>a boolean FD expression (section&nbsp;<A HREF="manual061.html#Boolean-FD-expressions">8.7.1</A>)</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT>fd_labeling_option</TT></TD>
<TD VALIGN=top ALIGN=left>an FD labeling option (section&nbsp;<A HREF="manual063.html#fd-labeling/2">8.9.1</A>)</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT>fd_evaluable</TT></TD>
<TD VALIGN=top ALIGN=left>an arithmetic FD expression (section&nbsp;<A HREF="manual060.html#FD-arithmetic-expressions">8.6.1</A>)</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT>fd_variable</TT></TD>
<TD VALIGN=top ALIGN=left>an FD variable</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT>flag</TT></TD>
<TD VALIGN=top ALIGN=left>a Prolog flag (section&nbsp;<A HREF="manual045.html#set-prolog-flag/2">7.22.1</A>)</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT>float</TT></TD>
<TD VALIGN=top ALIGN=left>a floating point number</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT>head</TT></TD>
<TD VALIGN=top ALIGN=left>a head of a clause (atom or compound term)</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT>integer</TT></TD>
<TD VALIGN=top ALIGN=left>an integer</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT>in_byte</TT></TD>
<TD VALIGN=top ALIGN=left>an integer &gt;= 0 and &lt;= 255 or <TT>-1</TT> (for
the end-of-file)</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT>in_character</TT></TD>
<TD VALIGN=top ALIGN=left>a single character atom or the atom
<TT>end_of_file</TT> (for the end-of-file)</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT>in_character_code</TT></TD>
<TD VALIGN=top ALIGN=left>an integer &gt;= 1 and &lt;= 255 or
<TT>-1</TT> (for the end-of-file)</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT>io_mode</TT></TD>
<TD VALIGN=top ALIGN=left>an atom in: <TT>read</TT>, <TT>write</TT> or
<TT>append</TT></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT>list</TT></TD>
<TD VALIGN=top ALIGN=left>the empty list <TT>[]</TT> or a non-empty list
<TT>[_|_]</TT></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT>nonvar</TT></TD>
<TD VALIGN=top ALIGN=left>any term that is not a variable</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT>number</TT></TD>
<TD VALIGN=top ALIGN=left>an integer or a floating point number</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT>operator_specifier</TT></TD>
<TD VALIGN=top ALIGN=left>an operator specifier (section&nbsp;<A HREF="manual037.html#op/3:(Term-input/output)">7.14.10</A>)</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT>os_file_property</TT></TD>
<TD VALIGN=top ALIGN=left>an operating system file property (section&nbsp;<A HREF="manual050.html#file-property/2">7.27.11</A>)</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT>predicate_indicator</TT></TD>
<TD VALIGN=top ALIGN=left>a term <TT>Name/Arity</TT> where
<TT>Name</TT> is an atom and <TT>Arity</TT> an integer &gt;= 0. A callable
term can be given if the <TT>strict_iso</TT> Prolog flag is switched
off (section&nbsp;<A HREF="manual045.html#set-prolog-flag/2">7.22.1</A>)</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT>predicate_property</TT></TD>
<TD VALIGN=top ALIGN=left>a predicate property
(section&nbsp;<A HREF="manual031.html#predicate-property/2">7.8.2</A>)</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT>read_option</TT></TD>
<TD VALIGN=top ALIGN=left>a read option (section&nbsp;<A HREF="manual037.html#read-term/3">7.14.1</A>)</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT>socket_address</TT></TD>
<TD VALIGN=top ALIGN=left>a term of the form <TT>'AF_UNIX'(A)</TT> or
<TT>'AF_INET'(A,N)</TT> where <TT>A</TT> is an atom and <TT>N</TT> an
integer</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT>socket_domain</TT></TD>
<TD VALIGN=top ALIGN=left>an atom in: <TT>'AF_UNIX'</TT> or
<TT>'AF_INET'</TT></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT>source_sink</TT></TD>
<TD VALIGN=top ALIGN=left>an atom identifying a source or a sink</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT>stream</TT></TD>
<TD VALIGN=top ALIGN=left>a stream-term: a term of the form <TT>'$stream'(N)</TT>
where <TT>N</TT> is an integer &gt;= 0</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT>stream_option</TT></TD>
<TD VALIGN=top ALIGN=left>a stream option (section&nbsp;<A HREF="manual033.html#open/4">7.10.6</A>)</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT>stream_or_alias</TT></TD>
<TD VALIGN=top ALIGN=left>a stream-term or an alias (atom)</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT>stream_position</TT></TD>
<TD VALIGN=top ALIGN=left>a stream position: a term
<TT>'$stream_position'(I1, I2, I3, I4)</TT> where
<TT>I1</TT>, <TT>I2</TT>, <TT>I3</TT> and <TT>I4</TT> are integers</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT>stream_property</TT></TD>
<TD VALIGN=top ALIGN=left>a stream property (section&nbsp;<A HREF="manual033.html#stream-property/2">7.10.10</A>)</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT>stream_seek_method</TT></TD>
<TD VALIGN=top ALIGN=left>an atom in: <TT>bof</TT>, <TT>current</TT>
or <TT>eof</TT></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT>term</TT></TD>
<TD VALIGN=top ALIGN=left>any term</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT>var_binding_option</TT></TD>
<TD VALIGN=top ALIGN=left>a variable binding option
(section&nbsp;<A HREF="manual028.html#bind-variables/2">7.5.3</A>)</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP><TT>write_option</TT></TD>
<TD VALIGN=top ALIGN=left>a write option (section&nbsp;<A HREF="manual037.html#write-term/3">7.14.6</A>)</TD>
</TR></TABLE><BR>

<HR SIZE=2>
Copyright (C) 1999-2002 Daniel Diaz
<BR>
<BR>
Verbatim copying and distribution of this entire article is permitted in any
medium, provided this notice is preserved. <BR>
<BR>
<A HREF="index.html#copyright">More about the copyright</A>
<HR>
<A HREF="manual017.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="manual016.html"><IMG SRC ="contents_motif.gif" ALT="Contents"></A>
<A HREF="manual019.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
</BODY>
</HTML>