Sophie

Sophie

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

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               - Gathering some basic internal info</TITLE>
</HEAD>
<BODY> 
Go to the <A HREF="ciao_1.html">first</A>, <A HREF="ciao_31.html">previous</A>, <A HREF="ciao_33.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="SEC183" HREF="ciao_toc.html#TOC183">Gathering some basic internal info</A></H1>
<P>
<A NAME="IDX2152"></A>


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


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


<P>
<STRONG>Version of last change:</STRONG> 1.3#13 (1999/7/2, 18:49:49 MEST)


<P>
This module provides predicates which return basic internal info.



<UL>
<LI><A HREF="ciao_32.html#SEC184">Usage and interface (system_info)</A>
<LI><A HREF="ciao_32.html#SEC185">Documentation on exports (system_info)</A>
<LI><A HREF="ciao_32.html#SEC186">Documentation on internals (system_info)</A>
</UL>



<H2><A NAME="SEC184" HREF="ciao_toc.html#TOC184">Usage and interface (<CODE>system_info</CODE>)</A></H2>

<div class="cartouche">

<UL>

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

These predicates are builtin in Ciao, so nothing special has to be done to use them.

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


<UL>

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

<A NAME="IDX2153"></A>
<CODE>get_arch/1</CODE>, 
<A NAME="IDX2154"></A>
<CODE>get_os/1</CODE>, 
<A NAME="IDX2155"></A>
<CODE>this_module/1</CODE>, 
<A NAME="IDX2156"></A>
<CODE>current_module/1</CODE>, 
<A NAME="IDX2157"></A>
<CODE>ciaolibdir/1</CODE>.

</UL>

</UL>

</div class="cartouche">



<H2><A NAME="SEC185" HREF="ciao_toc.html#TOC185">Documentation on exports (<CODE>system_info</CODE>)</A></H2>
<P>
<A NAME="IDX2158"></A>
<A NAME="IDX2159"></A>
<DL>
<DT><span class="define">PREDICATE:</span> <B>get_arch/1:</B>
<DD><A NAME="IDX2160"></A>


<P>
This predicate will describe the computer architecture wich is currently executing the predicate. 


<P>
Computer architectures are identified by a simple atom. This atom is implementation-defined, and may suffer any change from one Ciao Prolog version to another. 


<P>
For example,Ciao Prolog running on an Intel-based machine will retrieve: 

<PRE>
?- get_arch(I).

I = i86 ? ;

no
?- 
</PRE>

<P>
<STRONG>Usage:</STRONG> <CODE>get_arch(?ArchDescriptor)</CODE>

<UL>
<LI><EM>Description:</EM> Unifies <CODE>ArchDescriptor</CODE> with a simple atom which describes the computer architecture currently executing the predicate.

<LI><EM>Calls should, and exit will be compatible with:</EM>

<CODE>?ArchDescriptor</CODE> is an atom.
 (<CODE>basic_props:atm/1</CODE>)
</UL>

</DL>

<P>
<A NAME="IDX2161"></A>
<A NAME="IDX2162"></A>
<DL>
<DT><span class="define">PREDICATE:</span> <B>get_os/1:</B>
<DD><A NAME="IDX2163"></A>


<P>
This predicate will describe the Operating System which is running on the machine currently executing the Prolog program. 


<P>
Operating Systems are identified by a simple atom. This atom is implementation-defined, and may suffer any change from one Ciao Prolog version to another. 


<P>
For example,Ciao Prolog running on Linux will retrieve: 

<PRE>
?- get_os(I).

I = 'LINUX' ? ;

no
?- 
</PRE>

<P>
<STRONG>Usage:</STRONG> <CODE>get_os(?OsDescriptor)</CODE>

<UL>
<LI><EM>Description:</EM> Unifies <CODE>OsDescriptor</CODE> with a simple atom which describes the running Operating System when predicate was called.

<LI><EM>Calls should, and exit will be compatible with:</EM>

<CODE>?OsDescriptor</CODE> is an atom.
 (<CODE>basic_props:atm/1</CODE>)
</UL>

</DL>

<P>
<A NAME="IDX2164"></A>
<A NAME="IDX2165"></A>
<DL>
<DT><span class="define">PREDICATE:</span> <B>this_module/1:</B>
<DD><A NAME="IDX2166"></A>


<P>
<EM>Meta-predicate</EM> with arguments: <CODE>this_module(addmodule)</CODE>.


<P>
<STRONG>Usage:</STRONG> <CODE>this_module(Module)</CODE>

<UL>
<LI><EM>Description:</EM> <CODE>Module</CODE> is the internal module identifier for current module.

<LI><EM>Call and exit should be <EM>compatible</EM> with:</EM>

<CODE>Module</CODE> is an internal module identifier
 (<CODE>system_info:internal_module_id/1</CODE>)
</UL>

</DL>

<P>
<A NAME="IDX2167"></A>
<A NAME="IDX2168"></A>
<DL>
<DT><span class="define">PREDICATE:</span> <B>current_module/1:</B>
<DD><A NAME="IDX2169"></A>


<P>
This predicate will successively unify its argument with all module names currently loaded. Module names will be simple atoms. 


<P>
When called using a free variable as argument, it will retrieve on backtracking all modules currently loaded. This is usefull when called from the Ciao 
<A NAME="IDX2170"></A>
<CODE>toplevel</CODE>. 


<P>
When called using a module name as argument it will check whether the given module is loaded or not. This is usefull when called from user programs. 


<P>
<STRONG>Usage:</STRONG> <CODE>current_module(Module)</CODE>

<UL>
<LI><EM>Description:</EM> Retrieves (on backtracking) all currently loaded modules into your application.

<LI><EM>Call and exit should be <EM>compatible</EM> with:</EM>

<CODE>Module</CODE> is an internal module identifier
 (<CODE>system_info:internal_module_id/1</CODE>)
<LI><EM>The following properties should hold globally:</EM>

This predicate is understood natively by CiaoPP.
 (<CODE>basic_props:native/1</CODE>)
</UL>

</DL>

<P>
<A NAME="IDX2171"></A>
<A NAME="IDX2172"></A>
<DL>
<DT><span class="define">PREDICATE:</span> <B>ciaolibdir/1:</B>
<DD><A NAME="IDX2173"></A>


<P>
<STRONG>Usage:</STRONG> <CODE>ciaolibdir(CiaoPath)</CODE>

<UL>
<LI><EM>Description:</EM> <CODE>CiaoPath</CODE> is the path to the root of the Ciao libraries. Inside this directory, there are the directories 'lib', 'library' and 'contrib', which contain library modules.

<LI><EM>Call and exit should be <EM>compatible</EM> with:</EM>

<CODE>CiaoPath</CODE> is an atom.
 (<CODE>basic_props:atm/1</CODE>)
</UL>

</DL>



<H2><A NAME="SEC186" HREF="ciao_toc.html#TOC186">Documentation on internals (<CODE>system_info</CODE>)</A></H2>
<P>
<A NAME="IDX2174"></A>
<A NAME="IDX2175"></A>
<DL>
<DT><span class="define">PROPERTY:</span> <B>internal_module_id/1:</B>
<DD><A NAME="IDX2176"></A>


<P>
For a user file it is a term user/1 with an argument different for each user file, for other modules is just the name of the module (as an atom).


<P>
<STRONG>Usage:</STRONG> <CODE>internal_module_id(M)</CODE>

<UL>
<LI><EM>Description:</EM> <CODE>M</CODE> is an internal module identifier

</UL>

</DL>

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