@ciao-lang/ts-ciao-interface
Version:
Simple Ciao interface for node.
232 lines • 56.4 kB
HTML
<!DOCTYPE HTML><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><meta name="theme-color" content="#273f79"/><link rel="stylesheet" href="lpdoc.css" type="text/css"/><script type="text/javascript" src="lpdoc.js"></script><title>Runtime system control and flags — The Ciao System v1.22</title></head><body><div class="lpdoc-page fixleftbar"><a href="#" id="sidebar-toggle-button" class="lpdoc-navbutton"><span id="sidebar-button-arrow">☰</span></a><div id="sidebar" class="lpdoc-sidebar"><div style="height: 40px; margin-left: auto; margin-right: auto"><img src="ciao-logo_autofig.png" width=auto height=100%></div><div class="lpdoc-nav"><span class="lpdoc-on-right"><a class="lpdoc-navbutton" href="StdLibs.html">↑</a><a class="lpdoc-navbutton" href="messages_basic.html">←</a><a class="lpdoc-navbutton" href="system_info.html">→</a><a class="lpdoc-navbutton" href="ciaosearch.html">🔍</a></span><span><a href="ciaofulltoc.html">TOC</a></span></div><hr></hr><ul class="lpdoc-itemize-sectpath"><li><a href="ciao.html">The Ciao System</a> »<br/> </li><li><a href="StdLibs.html">PART VII - Standard libraries</a> »<br/> </li><li><a href=""><strong>Runtime system control and flags</strong></a></li></ul><hr></hr><em>ON THIS PAGE</em><ul><li><a href="#Usage and interface">Usage and interface</a></li><li><a href="#Documentation on exports">Documentation on exports</a></li><li><a href="#Documentation on multifiles">Documentation on multifiles</a></li><li><a href="#Documentation on imports">Documentation on imports</a></li></ul></div><div class="lpdoc-main"><div id=""><h1>Runtime system control and flags</h1><a class="lpdoc-idx-anchor" href="ciaosearch.html#runtime_control"></a>
<strong>Author(s):</strong> <a class="lpdoc-idx-anchor" id="Manuel Carro" href="ciaosearch.html#Manuel Carro">Manuel Carro</a>, <a class="lpdoc-idx-anchor" id="Daniel Cabeza" href="ciaosearch.html#Daniel Cabeza">Daniel Cabeza</a>, <a class="lpdoc-idx-anchor" id="Jose F. Morales" href="ciaosearch.html#Jose F. Morales">Jose F. Morales</a>, <a class="lpdoc-idx-anchor" id="Manuel Hermenegildo" href="ciaosearch.html#Manuel Hermenegildo">Manuel Hermenegildo (improved documentation)</a>, <a class="lpdoc-idx-anchor" id="Mats Carlsson" href="ciaosearch.html#Mats Carlsson">Mats Carlsson (original author)</a>.<p>
This module implements some predicates which provide access to and control of many parameters of the Ciao runtime, including internal statistics, loaded modules, special properties of the predicates, garbage collection, etc.<p>Some of these facilities are accessed or controlled via specific predicates (see later) while in other cases such access and control is preformed through the mechanism of <a class="lpdoc-idx-anchor" id="0" href="ciaosearch.html#flags">flags</a>. <a class="lpdoc-idx-anchor" id="1" href="ciaosearch.html#Prolog flag"></a> Such flags contain values for some global parameters of the system and also control the behavior of some system or library predicates. Each flag has a name and an associated predefined value, and except some system flags which are fixed, in general their associated value is changeable.<p>Flags can be given values at compile time, via <em>declarations</em>, and then the changes affect only the module being processed. Predicates are also available to consult and change flag values at run time, in which case their effect is global from that moment on in the execution (see <a class="lpdoc-idx-anchor" id="2" href="#prolog_flag/3"><tt>prolog_flag/3</tt></a> and related predicates below). Note that corresponding flag-processing declarations and predicates have the same predicate name; only the run-time version is documented.<p><p>Some flags are pre-defined in the system. In addition, new flags can be also be defined. The mechanism to do this is described in <a class="lpdoc-idx-anchor" id="3" href="tokenize.html#define_flag/3"><tt>define_flag/3</tt></a>. Through this mechanism, many Ciao modules and language extensions define additional flags. Flags that are predefined in the system (engine) are documented here and the rest are generally documented in the modules/libraries that define them.<p>The <a class="lpdoc-idx-anchor" id="4" href="ciaosearch.html#predefined flags">predefined flags</a> in the system are the following:<p><dl> <p><dt><tt>version</tt><dd> The Ciao version, as a term <tt>ciao</tt>(<span class="lpdoc-var">Version</span>,<span class="lpdoc-var">Patch</span>,<span class="lpdoc-var">CommitInfo</span>). <span class="lpdoc-var">Version</span> and <span class="lpdoc-var">Patch</span> are atoms. <span class="lpdoc-var">CommitInfo</span> is a structure describing the commit information (branch, id, date, description). Unchangeable.<p><dt><tt>dialect</tt><dd> Value set to <tt>ciao</tt>. Used for compatibility with other systems when in Prolog mode. Unchangeable.<p><dt><tt>argv</tt><dd> Its value is a list of atoms representing the program arguments supplied when the current executable was invoked. This is the value to which the argument of the <a class="lpdoc-idx-anchor" id="5" href="ciaosearch.html#main/1"><tt>main/1</tt></a> predicate is instantiated at executable startup (which is the usual way to access the list of arguments). Unchangeable.<p><dt><tt>bounded</tt><dd> It is <tt>false</tt>, to denote that the range of integers can be considered infinite (but see <a class="lpdoc-idx-anchor" id="6" href="basic_props.html#int/1"><tt>int/1</tt></a>). Unchangeable. <span class="lpdoc-iso">ISO</span> <dt><tt>fileerrors</tt><dd> If <tt>on</tt>, predicates handling files produce errors (throw exceptions) when a file is non-existent or an operation is not allowed. If <tt>off</tt>, a failure will occur instead for those conditions. Initially <tt>on</tt>.<p><dt><tt>gc</tt><dd> Controls whether garbage collection is performed. May be <tt>on</tt> (default) or <tt>off</tt>.<p><dt><tt>gc_margin</tt><dd> <span class="lpdoc-var">Margin</span> is an integer so that, if less than <span class="lpdoc-var">Margin</span> kilobytes are reclaimed in a garbage collection, then the size of the garbage-collected area should be increased. Also, no garbage collection is attempted unless the garbage-collected area has at least <span class="lpdoc-var">Margin</span> kilobytes. Initially set to <tt>500</tt>.<p><dt><tt>gc_trace</tt><dd> Governs garbage collection trace messages. An element of <tt>[on,off,terse,verbose]</tt>. Initially <tt>off</tt>.<p><dt><tt>integer_rounding_function</tt><dd> It is <tt>toward_zero</tt>, so that <tt>-1 =:= -3//2</tt> succeeds. Unchangeable. <span class="lpdoc-iso">ISO</span> <dt><tt>max_arity</tt><dd> It is 255, so that no compound term (or predicate) can have more than this number of arguments. Unchangeable. <span class="lpdoc-iso">ISO</span> <dt><tt>quiet</tt><dd> Controls which messages issued using the <a class="lpdoc-idx-anchor" id="7" href="messages_basic.html"><tt>messages_basic</tt></a> library are actually written. As the system uses that library to emit its messages, this flag controls the <em>verbosity</em> of the system. Possible states of the flag are:<p><dl> <p><dt><tt>on</tt><dd> No messages are reported.<p><dt><tt>error</tt><dd> Only error messages are reported.<p><dt><tt>warning</tt><dd> Only error and warning messages are reported.<p><dt><tt>off</tt><dd> All messages are reported, except debug messages. This is the default state.<p><dt><tt>debug</tt><dd> All messages, including debug messages, are reported. This is only intended for the system implementors.<p></dl> <p><dt><tt>unknown</tt><dd> Controls the action to be taken when an <a class="lpdoc-idx-anchor" id="8" href="ciaosearch.html#undefined predicate">undefined predicate</a> is called. The possible states of the flag are:<p><dl> <p><dt><tt>error</tt><dd> An error is thrown with the <a class="lpdoc-idx-anchor" id="9" href="ciaosearch.html#error term">error term</a> <tt>existence_error(procedure, F/A)</tt>.<p><dt><tt>fail</tt><dd> The call simply fails.<p><dt><tt>warning</tt><dd> A warning is written and the call fails.<p></dl> <p>The state is initially <tt>error</tt>. <span class="lpdoc-iso">ISO</span> </dl> <br/><div id="Usage and interface"><h2>Usage and interface</h2><div class="lpdoc-cartouche"><ul><li><strong>Library usage:</strong><br/><tt>:- use_module(engine(runtime_control)).</tt><li><strong>Exports:</strong><br/><ul class="lpdoc-itemize-minus"><li><em>Predicates:</em><br/><a class="lpdoc-idx-anchor" id="10" href="#statistics/0"><tt>statistics/0</tt></a>, <a class="lpdoc-idx-anchor" id="11" href="#statistics/2"><tt>statistics/2</tt></a>, <a class="lpdoc-idx-anchor" id="12" href="#time/1"><tt>time/1</tt></a>, <a class="lpdoc-idx-anchor" id="13" href="#current_atom/1"><tt>current_atom/1</tt></a>, <a class="lpdoc-idx-anchor" id="14" href="#new_atom/1"><tt>new_atom/1</tt></a>, <a class="lpdoc-idx-anchor" id="15" href="#current_module/1"><tt>current_module/1</tt></a>, <a class="lpdoc-idx-anchor" id="16" href="#module_split/3"><tt>module_split/3</tt></a>, <a class="lpdoc-idx-anchor" id="17" href="#predicate_property/2"><tt>predicate_property/2</tt></a>, <a class="lpdoc-idx-anchor" id="18" href="#predicate_property/3"><tt>predicate_property/3</tt></a>, <a class="lpdoc-idx-anchor" id="19" href="#garbage_collect/0"><tt>garbage_collect/0</tt></a>, <a class="lpdoc-idx-anchor" id="20" href="#set_prolog_flag/2"><tt>set_prolog_flag/2</tt></a>, <a class="lpdoc-idx-anchor" id="21" href="#current_prolog_flag/2"><tt>current_prolog_flag/2</tt></a>, <a class="lpdoc-idx-anchor" id="22" href="#prolog_flag/3"><tt>prolog_flag/3</tt></a>, <a class="lpdoc-idx-anchor" id="23" href="#push_prolog_flag/2"><tt>push_prolog_flag/2</tt></a>, <a class="lpdoc-idx-anchor" id="24" href="#pop_prolog_flag/1"><tt>pop_prolog_flag/1</tt></a>, <a class="lpdoc-idx-anchor" id="25" href="#prompt/2"><tt>prompt/2</tt></a>, <a class="lpdoc-idx-anchor" id="26" href="#fileerrors/0"><tt>fileerrors/0</tt></a>, <a class="lpdoc-idx-anchor" id="27" href="#nofileerrors/0"><tt>nofileerrors/0</tt></a>, <a class="lpdoc-idx-anchor" id="28" href="#gc/0"><tt>gc/0</tt></a>, <a class="lpdoc-idx-anchor" id="29" href="#nogc/0"><tt>nogc/0</tt></a>.
<li><em>Regular Types:</em><br/><a class="lpdoc-idx-anchor" id="30" href="#time_option/1"><tt>time_option/1</tt></a>, <a class="lpdoc-idx-anchor" id="31" href="#tick_option/1"><tt>tick_option/1</tt></a>, <a class="lpdoc-idx-anchor" id="32" href="#clockfreq_option/1"><tt>clockfreq_option/1</tt></a>, <a class="lpdoc-idx-anchor" id="33" href="#memory_option/1"><tt>memory_option/1</tt></a>, <a class="lpdoc-idx-anchor" id="34" href="#gc_option/1"><tt>gc_option/1</tt></a>, <a class="lpdoc-idx-anchor" id="35" href="#symbol_option/1"><tt>symbol_option/1</tt></a>, <a class="lpdoc-idx-anchor" id="36" href="#time_result/1"><tt>time_result/1</tt></a>, <a class="lpdoc-idx-anchor" id="37" href="#tick_result/1"><tt>tick_result/1</tt></a>, <a class="lpdoc-idx-anchor" id="38" href="#clockfreq_result/1"><tt>clockfreq_result/1</tt></a>, <a class="lpdoc-idx-anchor" id="39" href="#memory_result/1"><tt>memory_result/1</tt></a>, <a class="lpdoc-idx-anchor" id="40" href="#gc_result/1"><tt>gc_result/1</tt></a>, <a class="lpdoc-idx-anchor" id="41" href="#symbol_result/1"><tt>symbol_result/1</tt></a>.
<li><em>Multifiles:</em><br/><a class="lpdoc-idx-anchor" id="42" href="tokenize.html#define_flag/3"><tt>define_flag/3</tt></a>.
</ul></ul></div></div><div id="Documentation on exports"><h2>Documentation on exports</h2><div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="statistics/0" href="ciaosearch.html#statistics/0">statistics/0</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><p>Prints statistics about the system.</p><ul class="lpdoc-itemize-minus"></ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="statistics/2" href="ciaosearch.html#statistics/2">statistics/2</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage 1:</span><span class="lpdoc-usage-decl"><tt>statistics(Tick_option,Tick_result)</tt>
</span><p>Gather information about clock ticks (either run, user, system or wall tick) since the last consultation or since the start of the program. A tick is the smallest amount of time that the clock can measure.</p><ul class="lpdoc-itemize-minus"><li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="43" href="#tick_option/1"><tt>runtime_control:tick_option/1</tt></a>)</span><span><span class="lpdoc-var">Tick_option</span> is an option to get information about execution ticks. <pre class="lpdoc-codeblock">tick_option(runtick).
tick_option(usertick).
tick_option(systemtick).
tick_option(walltick).
</pre>
</span>
<li><em>The following properties should hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="44" href="#tick_option/1"><tt>runtime_control:tick_option/1</tt></a>)</span><span><span class="lpdoc-var">Tick_option</span> is an option to get information about execution ticks. <pre class="lpdoc-codeblock">tick_option(runtick).
tick_option(usertick).
tick_option(systemtick).
tick_option(walltick).
</pre>
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="45" href="#tick_result/1"><tt>runtime_control:tick_result/1</tt></a>)</span><span><span class="lpdoc-var">Tick_result</span> is a two-element list of numbers. The first number is the number of ticks since the start of the execution; the second number is the number of ticks since the previous consultation to tick.
</span>
</ul><p><span class="lpdoc-usage-header">Usage 2:</span><span class="lpdoc-usage-decl"><tt>statistics(Clockfreq_option,Clockfreq_result)</tt>
</span><p>Gather information about frequency of the clocks used to measure the ticks (either run-user, system or wall clock). Results are returned in Hertz. This value also can be defined as the amount of ticks that a clock can measure in one second.</p><ul class="lpdoc-itemize-minus"><li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="46" href="#clockfreq_option/1"><tt>runtime_control:clockfreq_option/1</tt></a>)</span><span><span class="lpdoc-var">Clockfreq_option</span> is and option to get information about the frequency of clocks used to get the ticks. <pre class="lpdoc-codeblock">clockfreq_option(runclockfreq).
clockfreq_option(userclockfreq).
clockfreq_option(systemclockfreq).
clockfreq_option(wallclockfreq).
</pre>
</span>
<li><em>The following properties should hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="47" href="#clockfreq_option/1"><tt>runtime_control:clockfreq_option/1</tt></a>)</span><span><span class="lpdoc-var">Clockfreq_option</span> is and option to get information about the frequency of clocks used to get the ticks. <pre class="lpdoc-codeblock">clockfreq_option(runclockfreq).
clockfreq_option(userclockfreq).
clockfreq_option(systemclockfreq).
clockfreq_option(wallclockfreq).
</pre>
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="48" href="#clockfreq_result/1"><tt>runtime_control:clockfreq_result/1</tt></a>)</span><span><span class="lpdoc-var">Clockfreq_result</span> is a number which gives the frequency in Hertz used by the clock get the ticks.
</span>
</ul><p><span class="lpdoc-usage-header">Usage 3:</span><span class="lpdoc-usage-decl"><tt>statistics(Time_option,Time_result)</tt>
</span><p>Gather information about time (either process time or wall time) since the last consultation or since start of program. Results are returned in milliseconds. Note that internally, time is calculated as:<p><pre class="lpdoc-codeblock"> Time_result = (Tick_result / Clockfreq_result) * 1000
</pre> <p></p><ul class="lpdoc-itemize-minus"><li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="49" href="#time_option/1"><tt>runtime_control:time_option/1</tt></a>)</span><span><span class="lpdoc-var">Time_option</span> is an option to get information about execution time. <pre class="lpdoc-codeblock">time_option(runtime).
time_option(usertime).
time_option(systemtime).
time_option(walltime).
</pre>
</span>
<li><em>The following properties should hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="50" href="#time_option/1"><tt>runtime_control:time_option/1</tt></a>)</span><span><span class="lpdoc-var">Time_option</span> is an option to get information about execution time. <pre class="lpdoc-codeblock">time_option(runtime).
time_option(usertime).
time_option(systemtime).
time_option(walltime).
</pre>
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="51" href="#time_result/1"><tt>runtime_control:time_result/1</tt></a>)</span><span><span class="lpdoc-var">Time_result</span> is a two-element list of numbers. The first number is the time since the start of the execution; the second number is the time since the previous time consultation to time.
</span>
</ul><p><span class="lpdoc-usage-header">Usage 4:</span><span class="lpdoc-usage-decl"><tt>statistics(Memory_option,Memory_result)</tt>
</span><p>Gather information about memory consumption.</p><ul class="lpdoc-itemize-minus"><li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="52" href="#memory_option/1"><tt>runtime_control:memory_option/1</tt></a>)</span><span><span class="lpdoc-var">Memory_option</span> is an option to get information about memory usage. <pre class="lpdoc-codeblock">memory_option(memory).
memory_option(symbols).
memory_option(program).
memory_option(global_stack).
memory_option(local_stack).
memory_option(trail).
memory_option(choice).
</pre>
</span>
<li><em>The following properties should hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="53" href="#memory_option/1"><tt>runtime_control:memory_option/1</tt></a>)</span><span><span class="lpdoc-var">Memory_option</span> is an option to get information about memory usage. <pre class="lpdoc-codeblock">memory_option(memory).
memory_option(symbols).
memory_option(program).
memory_option(global_stack).
memory_option(local_stack).
memory_option(trail).
memory_option(choice).
</pre>
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="54" href="#memory_result/1"><tt>runtime_control:memory_result/1</tt></a>)</span><span><span class="lpdoc-var">Memory_result</span> is a two-element list of integers. The first element is the space taken up by the option selected, measured in bytes; the second integer is zero for program space (which grows as necessary), and the amount of free space otherwise.
</span>
</ul><p><span class="lpdoc-usage-header">Usage 5:</span><span class="lpdoc-usage-decl"><tt>statistics(GC_option,GC_result)</tt>
</span><p>Gather information about garbage collection.</p><ul class="lpdoc-itemize-minus"><li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="55" href="#gc_option/1"><tt>runtime_control:gc_option/1</tt></a>)</span><span><span class="lpdoc-var">GC_option</span> is an option to get information about garbage collection. <pre class="lpdoc-codeblock">gc_option(garbage_collection).
gc_option(stack_shifts).
</pre>
</span>
<li><em>The following properties should hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="56" href="#gc_option/1"><tt>runtime_control:gc_option/1</tt></a>)</span><span><span class="lpdoc-var">GC_option</span> is an option to get information about garbage collection. <pre class="lpdoc-codeblock">gc_option(garbage_collection).
gc_option(stack_shifts).
</pre>
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="59" href="#gc_result/1"><tt>runtime_control:gc_result/1</tt></a>)</span><span><span class="lpdoc-var">GC_result</span> is a tree-element list of integers, related to <a class="lpdoc-idx-anchor" id="57" href="ciaosearch.html#garbage collection">garbage collection</a> and <a class="lpdoc-idx-anchor" id="58" href="ciaosearch.html#memory management">memory management</a>. When <tt>stack_shifts</tt> is selected, the first one is the number of shifts (reallocations) of the local stack; the second is the number of shifts of the trail; and the third is the time spent in these shifts. When <tt>garbage_collection</tt> is selected, the numbers are, respectively, the number of garbage collections performed, the number of bytes freed, and the time spent in garbage collection.
</span>
</ul><p><span class="lpdoc-usage-header">Usage 6:</span><span class="lpdoc-usage-decl"><tt>statistics(Symbol_option,Symbol_result)</tt>
</span><p>Gather information about number of symbols and predicates.</p><ul class="lpdoc-itemize-minus"><li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="60" href="#symbol_option/1"><tt>runtime_control:symbol_option/1</tt></a>)</span><span><span class="lpdoc-var">Symbol_option</span> is an option to get information about the number of symbols in the program. <pre class="lpdoc-codeblock">symbol_option(symbols).
</pre>
</span>
<li><em>The following properties should hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="61" href="#symbol_option/1"><tt>runtime_control:symbol_option/1</tt></a>)</span><span><span class="lpdoc-var">Symbol_option</span> is an option to get information about the number of symbols in the program. <pre class="lpdoc-codeblock">symbol_option(symbols).
</pre>
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="62" href="#symbol_result/1"><tt>runtime_control:symbol_result/1</tt></a>)</span><span><span class="lpdoc-var">Symbol_result</span> is a two-element list of integers. The first one is the number of atom, functor, and predicate names in the symbol table. The second is the number of predicates known to be defined (although maybe without clauses).
</span>
</ul><p><span class="lpdoc-usage-header">Usage 7:</span><span class="lpdoc-usage-decl"><tt>statistics(Option,Arg2)</tt>
</span><p>If <span class="lpdoc-var">Option</span> is unbound, it is bound by backtracking to the values of all the other cases.</p><ul class="lpdoc-itemize-minus"><li><em>Call and exit should be compatible with:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="63" href="basic_props.html#term/1"><tt>basic_props:term/1</tt></a>)</span><span><span class="lpdoc-var">Arg2</span> is any term.
</span>
<li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="64" href="term_typing.html#var/1"><tt>term_typing:var/1</tt></a>)</span><span><span class="lpdoc-var">Option</span> is a free variable.
</span>
<li><em>The following properties should hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="65" href="basic_props.html#term/1"><tt>basic_props:term/1</tt></a>)</span><span><span class="lpdoc-var">Arg2</span> is any term.
</span>
</ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">REGTYPE</span><a class="lpdoc-idx-anchor" id="time_option/1" href="ciaosearch.html#time_option/1">time_option/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>time_option(M)</tt>
</span><p><span class="lpdoc-var">M</span> is an option to get information about execution time. <pre class="lpdoc-codeblock">time_option(runtime).
time_option(usertime).
time_option(systemtime).
time_option(walltime).
</pre></p><ul class="lpdoc-itemize-minus"></ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">REGTYPE</span><a class="lpdoc-idx-anchor" id="tick_option/1" href="ciaosearch.html#tick_option/1">tick_option/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>tick_option(M)</tt>
</span><p><span class="lpdoc-var">M</span> is an option to get information about execution ticks. <pre class="lpdoc-codeblock">tick_option(runtick).
tick_option(usertick).
tick_option(systemtick).
tick_option(walltick).
</pre></p><ul class="lpdoc-itemize-minus"></ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">REGTYPE</span><a class="lpdoc-idx-anchor" id="clockfreq_option/1" href="ciaosearch.html#clockfreq_option/1">clockfreq_option/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>clockfreq_option(M)</tt>
</span><p><span class="lpdoc-var">M</span> is and option to get information about the frequency of clocks used to get the ticks. <pre class="lpdoc-codeblock">clockfreq_option(runclockfreq).
clockfreq_option(userclockfreq).
clockfreq_option(systemclockfreq).
clockfreq_option(wallclockfreq).
</pre></p><ul class="lpdoc-itemize-minus"></ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">REGTYPE</span><a class="lpdoc-idx-anchor" id="memory_option/1" href="ciaosearch.html#memory_option/1">memory_option/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>memory_option(M)</tt>
</span><p><span class="lpdoc-var">M</span> is an option to get information about memory usage. <pre class="lpdoc-codeblock">memory_option(memory).
memory_option(symbols).
memory_option(program).
memory_option(global_stack).
memory_option(local_stack).
memory_option(trail).
memory_option(choice).
</pre></p><ul class="lpdoc-itemize-minus"></ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">REGTYPE</span><a class="lpdoc-idx-anchor" id="gc_option/1" href="ciaosearch.html#gc_option/1">gc_option/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>gc_option(M)</tt>
</span><p><span class="lpdoc-var">M</span> is an option to get information about garbage collection. <pre class="lpdoc-codeblock">gc_option(garbage_collection).
gc_option(stack_shifts).
</pre></p><ul class="lpdoc-itemize-minus"></ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">REGTYPE</span><a class="lpdoc-idx-anchor" id="symbol_option/1" href="ciaosearch.html#symbol_option/1">symbol_option/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>symbol_option(M)</tt>
</span><p><span class="lpdoc-var">M</span> is an option to get information about the number of symbols in the program. <pre class="lpdoc-codeblock">symbol_option(symbols).
</pre></p><ul class="lpdoc-itemize-minus"></ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">REGTYPE</span><a class="lpdoc-idx-anchor" id="time_result/1" href="ciaosearch.html#time_result/1">time_result/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>time_result(Result)</tt>
</span><p><span class="lpdoc-var">Result</span> is a two-element list of numbers. The first number is the time since the start of the execution; the second number is the time since the previous time consultation to time.</p><ul class="lpdoc-itemize-minus"></ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">REGTYPE</span><a class="lpdoc-idx-anchor" id="tick_result/1" href="ciaosearch.html#tick_result/1">tick_result/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>tick_result(Result)</tt>
</span><p><span class="lpdoc-var">Result</span> is a two-element list of numbers. The first number is the number of ticks since the start of the execution; the second number is the number of ticks since the previous consultation to tick.</p><ul class="lpdoc-itemize-minus"></ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">REGTYPE</span><a class="lpdoc-idx-anchor" id="clockfreq_result/1" href="ciaosearch.html#clockfreq_result/1">clockfreq_result/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>clockfreq_result(Result)</tt>
</span><p><span class="lpdoc-var">Result</span> is a number which gives the frequency in Hertz used by the clock get the ticks.</p><ul class="lpdoc-itemize-minus"></ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">REGTYPE</span><a class="lpdoc-idx-anchor" id="memory_result/1" href="ciaosearch.html#memory_result/1">memory_result/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>memory_result(Result)</tt>
</span><p><span class="lpdoc-var">Result</span> is a two-element list of integers. The first element is the space taken up by the option selected, measured in bytes; the second integer is zero for program space (which grows as necessary), and the amount of free space otherwise.</p><ul class="lpdoc-itemize-minus"></ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">REGTYPE</span><a class="lpdoc-idx-anchor" id="gc_result/1" href="ciaosearch.html#gc_result/1">gc_result/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>gc_result(Result)</tt>
</span><p><span class="lpdoc-var">Result</span> is a tree-element list of integers, related to <a class="lpdoc-idx-anchor" id="66" href="ciaosearch.html#garbage collection">garbage collection</a> and <a class="lpdoc-idx-anchor" id="67" href="ciaosearch.html#memory management">memory management</a>. When <tt>stack_shifts</tt> is selected, the first one is the number of shifts (reallocations) of the local stack; the second is the number of shifts of the trail; and the third is the time spent in these shifts. When <tt>garbage_collection</tt> is selected, the numbers are, respectively, the number of garbage collections performed, the number of bytes freed, and the time spent in garbage collection.</p><ul class="lpdoc-itemize-minus"></ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">REGTYPE</span><a class="lpdoc-idx-anchor" id="symbol_result/1" href="ciaosearch.html#symbol_result/1">symbol_result/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>symbol_result(Result)</tt>
</span><p><span class="lpdoc-var">Result</span> is a two-element list of integers. The first one is the number of atom, functor, and predicate names in the symbol table. The second is the number of predicates known to be defined (although maybe without clauses).</p><ul class="lpdoc-itemize-minus"></ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="time/1" href="ciaosearch.html#time/1">time/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>time(G)</tt>
</span><p>Execute <span class="lpdoc-var">G</span> and print runtime statistics to the user, for each solution.</p><ul class="lpdoc-itemize-minus"></ul>
<em>Meta-predicate</em> with arguments: <tt>time(goal)</tt>.<br/></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="current_atom/1" href="ciaosearch.html#current_atom/1">current_atom/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>current_atom(Atom)</tt>
</span><p>Enumerates on backtracking all the existing atoms in the system.</p><ul class="lpdoc-itemize-minus"><li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="68" href="term_typing.html#var/1"><tt>term_typing:var/1</tt></a>)</span><span><span class="lpdoc-var">Atom</span> is a free variable.
</span>
<li><em>The following properties hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="69" href="basic_props.html#atm/1"><tt>basic_props:atm/1</tt></a>)</span><span><span class="lpdoc-var">Atom</span> is an atom.
</span>
</ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="new_atom/1" href="ciaosearch.html#new_atom/1">new_atom/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>new_atom(Atom)</tt>
</span><p>Returns, on success, in <span class="lpdoc-var">Atom</span> a new atom, not existing before in the system. The entry argument must be a variable. The idea behind this atom generation is to provide a fast source of identifiers for new objects, concurrent predicates, etc. on the fly.</p><ul class="lpdoc-itemize-minus"><li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="70" href="term_typing.html#var/1"><tt>term_typing:var/1</tt></a>)</span><span><span class="lpdoc-var">Atom</span> is a free variable.
</span>
<li><em>The following properties hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="71" href="basic_props.html#atm/1"><tt>basic_props:atm/1</tt></a>)</span><span><span class="lpdoc-var">Atom</span> is an atom.
</span>
</ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="current_module/1" href="ciaosearch.html#current_module/1">current_module/1</a></div><div class="lpdoc-deftext">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 useful when called from the Ciao <a class="lpdoc-idx-anchor" id="72" href="toplevel_doc.html"><tt>toplevel</tt></a>.<p>When called using a module name as argument it will check whether the given module is loaded or not. This is useful when called from user programs. <p><span class="lpdoc-usage-header">Usage 1:</span><span class="lpdoc-usage-decl"><tt>current_module(Module)</tt>
</span><p>Retrieves (on backtracking) in <span class="lpdoc-var">Module</span> all the loaded modules (either statically or dynamically).</p><ul class="lpdoc-itemize-minus"><li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="73" href="term_typing.html#var/1"><tt>term_typing:var/1</tt></a>)</span><span><span class="lpdoc-var">Module</span> is a free variable.
</span>
<li><em>The following properties should hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="74" href="basic_props.html#internal_module_id/1"><tt>basic_props:internal_module_id/1</tt></a>)</span><span><span class="lpdoc-var">Module</span> is an internal module identifier
</span>
<li><em>The following properties should hold globally:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="75" href="basic_props.html#native/1"><tt>basic_props:native/1</tt></a>)</span><span>This predicate is understood natively by CiaoPP.
</span>
</ul><p><span class="lpdoc-usage-header">Usage 2:</span><span class="lpdoc-usage-decl"><tt>current_module(Module)</tt>
</span><p>Checks whether module <span class="lpdoc-var">Module</span> is loaded or not (either statically or dynamically).</p><ul class="lpdoc-itemize-minus"><li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="76" href="term_typing.html#var/1"><tt>term_typing:var/1</tt></a>)</span><span><span class="lpdoc-var">Module</span> is a free variable.
</span>
<li><em>The following properties should hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="77" href="basic_props.html#internal_module_id/1"><tt>basic_props:internal_module_id/1</tt></a>)</span><span><span class="lpdoc-var">Module</span> is an internal module identifier
</span>
<li><em>The following properties should hold globally:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="78" href="basic_props.html#native/1"><tt>basic_props:native/1</tt></a>)</span><span>This predicate is understood natively by CiaoPP.
</span>
</ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="module_split/3" href="ciaosearch.html#module_split/3">module_split/3</a></div><div class="lpdoc-deftext">No further documentation available for this predicate.</div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="predicate_property/2" href="ciaosearch.html#predicate_property/2">predicate_property/2</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>predicate_property(Head,Property)</tt>
</span><p>The predicate <span class="lpdoc-var">Head</span>, visible from the current module, (a goal) has the property <span class="lpdoc-var">Property</span>.</p><ul class="lpdoc-itemize-minus"><li><em>The following properties should hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="79" href="basic_props.html#cgoal/1"><tt>basic_props:cgoal/1</tt></a>)</span><span><span class="lpdoc-var">Head</span> is a term which represents a goal, i.e., an atom or a structure.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="80" href="basic_props.html#atm/1"><tt>basic_props:atm/1</tt></a>)</span><span><span class="lpdoc-var">Property</span> is an atom.
</span>
</ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="predicate_property/3" href="ciaosearch.html#predicate_property/3">predicate_property/3</a></div><div class="lpdoc-deftext">No further documentation available for this predicate.</div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="garbage_collect/0" href="ciaosearch.html#garbage_collect/0">garbage_collect/0</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><p>Forces garbage collection when called.</p><ul class="lpdoc-itemize-minus"></ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="set_prolog_flag/2" href="ciaosearch.html#set_prolog_flag/2">set_prolog_flag/2</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>set_prolog_flag(FlagName,Value)</tt>
</span><p>Set existing flag <span class="lpdoc-var">FlagName</span> to <span class="lpdoc-var">Value</span>. Can also be a declaration (which is then compile-time and module-local).<p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><span class="lpdoc-on-right"><span class="lpdoc-iso">ISO</span></span><span></span>
</span><p></p><ul class="lpdoc-itemize-minus"><li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="81" href="basic_props.html#atm/1"><tt>basic_props:atm/1</tt></a>)</span><span><span class="lpdoc-var">FlagName</span> is an atom.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="82" href="basic_props.html#term/1"><tt>basic_props:term/1</tt></a>)</span><span><span class="lpdoc-var">Value</span> is any term.
</span>
<li><em>The following properties should hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="83" href="basic_props.html#atm/1"><tt>basic_props:atm/1</tt></a>)</span><span><span class="lpdoc-var">FlagName</span> is an atom.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="84" href="basic_props.html#term/1"><tt>basic_props:term/1</tt></a>)</span><span><span class="lpdoc-var">Value</span> is any term.
</span>
</ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="current_prolog_flag/2" href="ciaosearch.html#current_prolog_flag/2">current_prolog_flag/2</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>current_prolog_flag(FlagName,Value)</tt>
</span><p><span class="lpdoc-var">FlagName</span> is an existing flag and <span class="lpdoc-var">Value</span> is the value currently associated with it.<p><span class="lpdoc-usage-header">Usage:</span><p></p><ul class="lpdoc-itemize-minus"><li><em>The following properties should hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="85" href="basic_props.html#atm/1"><tt>basic_props:atm/1</tt></a>)</span><span><span class="lpdoc-var">FlagName</span> is an atom.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="86" href="basic_props.html#term/1"><tt>basic_props:term/1</tt></a>)</span><span><span class="lpdoc-var">Value</span> is any term.
</span>
</ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="prolog_flag/3" href="ciaosearch.html#prolog_flag/3">prolog_flag/3</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>prolog_flag(FlagName,OldValue,NewValue)</tt>
</span><p><span class="lpdoc-var">FlagName</span> is an existing flag. Unify <span class="lpdoc-var">OldValue</span> with the value associated with it, and set it to new value <span class="lpdoc-var">NewValue</span>. Can also be a declaration (which is then compile-time and module-local).<p><span class="lpdoc-usage-header">Usage 1:</span><span class="lpdoc-usage-decl"><tt>prolog_flag(FlagName,OldValue,NewValue)</tt>
</span><p></p><ul class="lpdoc-itemize-minus"><li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="87" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">NewValue</span> is currently a term which is not a free variable.
</span>
<li><em>The following properties should hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="88" href="basic_props.html#atm/1"><tt>basic_props:atm/1</tt></a>)</span><span><span class="lpdoc-var">FlagName</span> is an atom.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="89" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">OldValue</span> is currently a term which is not a free variable.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="90" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">NewValue</span> is currently a term which is not a free variable.
</span>
</ul><p><span class="lpdoc-usage-header">Usage 2:</span><span class="lpdoc-usage-decl"><tt>prolog_flag(FlagName,OldValue,NewValue)</tt>
</span><p>Same as <tt>current_prolog_flag(<span class="lpdoc-var">FlagName</span>, <span class="lpdoc-var">OldValue</span>)</tt>. <span class="lpdoc-var">OldValue</span> and <span class="lpdoc-var">NewValue</span> must be strictly identical variables.</p><ul class="lpdoc-itemize-minus"><li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="91" href="term_typing.html#var/1"><tt>term_typing:var/1</tt></a>)</span><span><span class="lpdoc-var">OldValue</span> is a free variable.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="92" href="term_typing.html#var/1"><tt>term_typing:var/1</tt></a>)</span><span><span class="lpdoc-var">NewValue</span> is a free variable.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="93" href="basic_props.html#atm/1"><tt>basic_props:atm/1</tt></a>)</span><span><span class="lpdoc-var">FlagName</span> is an atom.
</span>
<li><em>The following properties should hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="94" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">OldValue</span> is currently a term which is not a free variable.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="95" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">NewValue</span> is currently a term which is not a free variable.
</span>
</ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="push_prolog_flag/2" href="ciaosearch.html#push_prolog_flag/2">push_prolog_flag/2</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>push_prolog_flag(Flag,NewValue)</tt>
</span><p>Same as <a class="lpdoc-idx-anchor" id="96" href="#set_prolog_flag/2"><tt>set_prolog_flag/2</tt></a>, but storing the current value of <span class="lpdoc-var">Flag</span> to restore it with <a class="lpdoc-idx-anchor" id="97" href="#pop_prolog_flag/1"><tt>pop_prolog_flag/1</tt></a>. Can also be a declaration (which is then compile-time and module-local).<p><span class="lpdoc-usage-header">Usage:</span><p></p><ul class="lpdoc-itemize-minus"><li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="98" href="basic_props.html#atm/1"><tt>basic_props:atm/1</tt></a>)</span><span><span class="lpdoc-var">Flag</span> is an atom.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="99" href="basic_props.html#term/1"><tt>basic_props:term/1</tt></a>)</span><span><span class="lpdoc-var">NewValue</span> is any term.
</span>
<li><em>The following properties should hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="100" href="basic_props.html#atm/1"><tt>basic_props:atm/1</tt></a>)</span><span><span class="lpdoc-var">Flag</span> is an atom.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="101" href="basic_props.html#term/1"><tt>basic_props:term/1</tt></a>)</span><span><span class="lpdoc-var">NewValue</span> is any term.
</span>
</ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="pop_prolog_flag/1" href="ciaosearch.html#pop_prolog_flag/1">pop_prolog_flag/1</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>pop_prolog_flag(Flag)</tt>
</span><p>Restore the value of <span class="lpdoc-var">Flag</span> previous to the last non-canceled <a class="lpdoc-idx-anchor" id="102" href="#push_prolog_flag/2"><tt>push_prolog_flag/2</tt></a> on it. Can also be a declaration (which is then compile-time and module-local).<p><span class="lpdoc-usage-header">Usage:</span><p></p><ul class="lpdoc-itemize-minus"><li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="103" href="basic_props.html#atm/1"><tt>basic_props:atm/1</tt></a>)</span><span><span class="lpdoc-var">Flag</span> is an atom.
</span>
<li><em>The following properties should hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="104" href="basic_props.html#atm/1"><tt>basic_props:atm/1</tt></a>)</span><span><span class="lpdoc-var">Flag</span> is an atom.
</span>
</ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="prompt/2" href="ciaosearch.html#prompt/2">prompt/2</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>prompt(Old,New)</tt>
</span><p>Allows reading or changing the prompt used for reading in terms.<p><span class="lpdoc-usage-header">Usage 1:</span><span class="lpdoc-usage-decl"><tt>prompt(Old,New)</tt>
</span><p>Unify <span class="lpdoc-var">Old</span> with the current prompt for reading, change it to <span class="lpdoc-var">New</span>. To read the current prompt just call <tt>prompt(X,X)</tt>.</p><ul class="lpdoc-itemize-minus"><li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="105" href="basic_props.html#atm/1"><tt>basic_props:atm/1</tt></a>)</span><span><span class="lpdoc-var">New</span> is an atom.
</span>
<li><em>The following properties should hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="106" href="basic_props.html#atm/1"><tt>basic_props:atm/1</tt></a>)</span><span><span class="lpdoc-var">Old</span> is an atom.
</span>
</ul><p><span class="lpdoc-usage-header">Usage 2:</span><span class="lpdoc-usage-decl"><tt>prompt(Old,New)</tt>
</span><p>Unify <span class="lpdoc-var">Old</span> with the current prompt for reading without changing it. On calls, <span class="lpdoc-var">Old</span> and <span class="lpdoc-var">New</span> must be strictly identical variables.</p><ul class="lpdoc-itemize-minus"><li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="107" href="term_typing.html#var/1"><tt>term_typing:var/1</tt></a>)</span><span><span class="lpdoc-var">Old</spa