UNPKG

@ciao-lang/ts-ciao-interface

Version:

Simple Ciao interface for node.

122 lines 29.3 kB
<!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>Fast/concurrent update of facts (runtime) &mdash; 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">&#9776;</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="datafacts_doc.html">&#x2191;</a><a class="lpdoc-navbutton" href="datafacts_doc.html">&#x2190;</a><a class="lpdoc-navbutton" href="dynamic_doc.html">&#x2192;</a><a class="lpdoc-navbutton" href="ciaosearch.html">&#x1F50D;</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> &raquo;<br/> </li><li><a href="ExtendLang.html">PART IV - Language extensions</a> &raquo;<br/> </li><li><a href="datafacts_doc.html">Fast/concurrent update of facts</a> &raquo;<br/> </li><li><a href=""><strong>Fast/concurrent update of facts (runtime)</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 internals">Documentation on internals</a></li><li><a href="#Documentation on imports">Documentation on imports</a></li></ul></div><div class="lpdoc-main"><div id=""><h1>Fast/concurrent update of facts (runtime)</h1><a class="lpdoc-idx-anchor" href="ciaosearch.html#datafacts_rt"></a> <strong>Author(s):</strong> <a class="lpdoc-idx-anchor" id="The Ciao Development Team" href="ciaosearch.html#The Ciao Development Team">The Ciao Development Team</a>, <a class="lpdoc-idx-anchor" id="Daniel Cabeza" href="ciaosearch.html#Daniel Cabeza">Daniel Cabeza</a>, <a class="lpdoc-idx-anchor" id="Manuel Carro" href="ciaosearch.html#Manuel Carro">Manuel Carro</a>.<p> This module implements the assert/retract family of predicates to manipulate data predicates (facts).<br/><div id="Usage and interface"><h2>Usage and interface</h2><div class="lpdoc-cartouche"><ul><li><strong>Library usage:</strong><br/>Do not use this module directly (use the <a class="lpdoc-idx-anchor" id="0" href="datafacts_doc.html"><tt>datafacts</tt></a> package instead).<li><strong>Exports:</strong><br/><ul class="lpdoc-itemize-minus"><li><em>Predicates:</em><br/><a class="lpdoc-idx-anchor" id="1" href="#asserta_fact/1"><tt>asserta_fact/1</tt></a>, <a class="lpdoc-idx-anchor" id="2" href="#asserta_fact/2"><tt>asserta_fact/2</tt></a>, <a class="lpdoc-idx-anchor" id="3" href="#assertz_fact/1"><tt>assertz_fact/1</tt></a>, <a class="lpdoc-idx-anchor" id="4" href="#assertz_fact/2"><tt>assertz_fact/2</tt></a>, <a class="lpdoc-idx-anchor" id="5" href="#current_fact/1"><tt>current_fact/1</tt></a>, <a class="lpdoc-idx-anchor" id="6" href="#current_fact/2"><tt>current_fact/2</tt></a>, <a class="lpdoc-idx-anchor" id="7" href="#retract_fact/1"><tt>retract_fact/1</tt></a>, <a class="lpdoc-idx-anchor" id="8" href="#retractall_fact/1"><tt>retractall_fact/1</tt></a>, <a class="lpdoc-idx-anchor" id="9" href="#current_fact_nb/1"><tt>current_fact_nb/1</tt></a>, <a class="lpdoc-idx-anchor" id="10" href="#retract_fact_nb/1"><tt>retract_fact_nb/1</tt></a>, <a class="lpdoc-idx-anchor" id="11" href="#close_predicate/1"><tt>close_predicate/1</tt></a>, <a class="lpdoc-idx-anchor" id="12" href="#open_predicate/1"><tt>open_predicate/1</tt></a>, <a class="lpdoc-idx-anchor" id="13" href="#set_fact/1"><tt>set_fact/1</tt></a>, <a class="lpdoc-idx-anchor" id="14" href="#erase/1"><tt>erase/1</tt></a>. <li><em>Regular Types:</em><br/><a class="lpdoc-idx-anchor" id="15" href="#reference/1"><tt>reference/1</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="asserta_fact/1" href="ciaosearch.html#asserta_fact/1">asserta_fact/1</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>asserta_fact(Fact)</tt> </span><p><span class="lpdoc-var">Fact</span> is added to the corresponding <a class="lpdoc-idx-anchor" id="16" href="ciaosearch.html#data predicate">data predicate</a>. The fact becomes the first clause of the predicate concerned.<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="17" href="basic_props.html#cgoal/1"><tt>basic_props:cgoal/1</tt></a>)</span><span><span class="lpdoc-var">Fact</span> is a term which represents a goal, i.e., an atom or a structure. </span> </ul> <em>Meta-predicate</em> with arguments: <tt>asserta_fact(fact)</tt>.<br/></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="asserta_fact/2" href="ciaosearch.html#asserta_fact/2">asserta_fact/2</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>asserta_fact(Fact,Ref)</tt> </span><p>Same as <a class="lpdoc-idx-anchor" id="18" href="#asserta_fact/1"><tt>asserta_fact/1</tt></a>, instantiating <span class="lpdoc-var">Ref</span> to a unique identifier of the asserted fact.<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="19" href="basic_props.html#cgoal/1"><tt>basic_props:cgoal/1</tt></a>)</span><span><span class="lpdoc-var">Fact</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="20" href="term_typing.html#var/1"><tt>term_typing:var/1</tt></a>)</span><span><span class="lpdoc-var">Ref</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="21" href="#reference/1"><tt>datafacts_rt:reference/1</tt></a>)</span><span><span class="lpdoc-var">Ref</span> is a reference of a dynamic or data clause. </span> </ul> <em>Meta-predicate</em> with arguments: <tt>asserta_fact(fact,?)</tt>.<br/></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="assertz_fact/1" href="ciaosearch.html#assertz_fact/1">assertz_fact/1</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>assertz_fact(Fact)</tt> </span><p><span class="lpdoc-var">Fact</span> is added to the corresponding <a class="lpdoc-idx-anchor" id="22" href="ciaosearch.html#data predicate">data predicate</a>. The fact becomes the last clause of the predicate concerned.<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="23" href="basic_props.html#cgoal/1"><tt>basic_props:cgoal/1</tt></a>)</span><span><span class="lpdoc-var">Fact</span> is a term which represents a goal, i.e., an atom or a structure. </span> <li><em>The following properties should hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="24" href="basic_props.html#cgoal/1"><tt>basic_props:cgoal/1</tt></a>)</span><span><span class="lpdoc-var">Fact</span> is a term which represents a goal, i.e., an atom or a structure. </span> </ul> <em>Meta-predicate</em> with arguments: <tt>assertz_fact(fact)</tt>.<br/></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="assertz_fact/2" href="ciaosearch.html#assertz_fact/2">assertz_fact/2</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>assertz_fact(Fact,Ref)</tt> </span><p>Same as <a class="lpdoc-idx-anchor" id="25" href="#assertz_fact/1"><tt>assertz_fact/1</tt></a>, instantiating <span class="lpdoc-var">Ref</span> to a unique identifier of the asserted fact.<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="26" href="basic_props.html#cgoal/1"><tt>basic_props:cgoal/1</tt></a>)</span><span><span class="lpdoc-var">Fact</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="27" href="term_typing.html#var/1"><tt>term_typing:var/1</tt></a>)</span><span><span class="lpdoc-var">Ref</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="28" href="#reference/1"><tt>datafacts_rt:reference/1</tt></a>)</span><span><span class="lpdoc-var">Ref</span> is a reference of a dynamic or data clause. </span> </ul> <em>Meta-predicate</em> with arguments: <tt>assertz_fact(fact,?)</tt>.<br/></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="current_fact/1" href="ciaosearch.html#current_fact/1">current_fact/1</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>current_fact(Fact)</tt> </span><p>Gives on backtracking all the facts defined as data or concurrent which unify with <span class="lpdoc-var">Fact</span>. It is faster than calling the predicate explicitly, which do invoke the meta-interpreter. If the <span class="lpdoc-var">Fact</span> has been defined as concurrent and has not been <a class="lpdoc-idx-anchor" id="29" href="ciaosearch.html#closed">closed</a>, <a class="lpdoc-idx-anchor" id="30" href="#current_fact/1"><tt>current_fact/1</tt></a> will wait (instead of failing) for more clauses to appear after the last clause of <span class="lpdoc-var">Fact</span> is returned.<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="31" href="basic_props.html#cgoal/1"><tt>basic_props:cgoal/1</tt></a>)</span><span><span class="lpdoc-var">Fact</span> is a term which represents a goal, i.e., an atom or a structure. </span> <li><em>The following properties should hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="32" href="basic_props.html#cgoal/1"><tt>basic_props:cgoal/1</tt></a>)</span><span><span class="lpdoc-var">Fact</span> is a term which represents a goal, i.e., an atom or a structure. </span> </ul> <em>Meta-predicate</em> with arguments: <tt>current_fact(fact)</tt>.<br/></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="current_fact/2" href="ciaosearch.html#current_fact/2">current_fact/2</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>current_fact(Fact,Ref)</tt> </span><p><span class="lpdoc-var">Fact</span> is a fact of a <a class="lpdoc-idx-anchor" id="33" href="ciaosearch.html#data predicate">data predicate</a> and <span class="lpdoc-var">Ref</span> is its reference identifying it uniquely.<p><span class="lpdoc-usage-header">Usage 1:</span><p>Gives on backtracking all the facts defined as data which unify with <span class="lpdoc-var">Fact</span>, instantiating <span class="lpdoc-var">Ref</span> to a unique identifier for each fact.</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="34" href="basic_props.html#cgoal/1"><tt>basic_props:cgoal/1</tt></a>)</span><span><span class="lpdoc-var">Fact</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="35" href="term_typing.html#var/1"><tt>term_typing:var/1</tt></a>)</span><span><span class="lpdoc-var">Ref</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="36" href="#reference/1"><tt>datafacts_rt:reference/1</tt></a>)</span><span><span class="lpdoc-var">Ref</span> is a reference of a dynamic or data clause. </span> </ul><p><span class="lpdoc-usage-header">Usage 2:</span><p>Given <span class="lpdoc-var">Ref</span>, unifies <span class="lpdoc-var">Fact</span> with the fact identified by it.</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="37" href="basic_props.html#cgoal/1"><tt>basic_props:cgoal/1</tt></a>)</span><span><span class="lpdoc-var">Fact</span> is a term which represents a goal, i.e., an atom or a structure. </span> <li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="38" href="#reference/1"><tt>datafacts_rt:reference/1</tt></a>)</span><span><span class="lpdoc-var">Ref</span> is a reference of a dynamic or data clause. </span> <li><em>The following properties should hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="39" href="basic_props.html#cgoal/1"><tt>basic_props:cgoal/1</tt></a>)</span><span><span class="lpdoc-var">Fact</span> is a term which represents a goal, i.e., an atom or a structure. </span> </ul> <em>Meta-predicate</em> with arguments: <tt>current_fact(fact,?)</tt>.<br/></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="retract_fact/1" href="ciaosearch.html#retract_fact/1">retract_fact/1</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>retract_fact(Fact)</tt> </span><p>Unifies <span class="lpdoc-var">Fact</span> with the first matching fact of a <a class="lpdoc-idx-anchor" id="40" href="ciaosearch.html#data predicate">data predicate</a>, and then erases it. On backtracking successively unifies with and erases new matching facts. If <span class="lpdoc-var">Fact</span> is declared as <a class="lpdoc-idx-anchor" id="41" href="ciaosearch.html#concurrent">concurrent</a> and is non-<a class="lpdoc-idx-anchor" id="42" href="ciaosearch.html#closed">closed</a>, <a class="lpdoc-idx-anchor" id="43" href="#retract_fact/1"><tt>retract_fact/1</tt></a> will wait for more clauses or for the closing of the predicate after the last matching clause has been removed.<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="44" href="basic_props.html#cgoal/1"><tt>basic_props:cgoal/1</tt></a>)</span><span><span class="lpdoc-var">Fact</span> is a term which represents a goal, i.e., an atom or a structure. </span> <li><em>The following properties should hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="45" href="basic_props.html#cgoal/1"><tt>basic_props:cgoal/1</tt></a>)</span><span><span class="lpdoc-var">Fact</span> is a term which represents a goal, i.e., an atom or a structure. </span> </ul> <em>Meta-predicate</em> with arguments: <tt>retract_fact(fact)</tt>.<br/></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="retractall_fact/1" href="ciaosearch.html#retractall_fact/1">retractall_fact/1</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>retractall_fact(Fact)</tt> </span><p>Erase all the facts of a <a class="lpdoc-idx-anchor" id="46" href="ciaosearch.html#data predicate">data predicate</a> unifying with <span class="lpdoc-var">Fact</span>. Even if all facts are removed, the predicate continues to exist.<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="47" href="basic_props.html#cgoal/1"><tt>basic_props:cgoal/1</tt></a>)</span><span><span class="lpdoc-var">Fact</span> is a term which represents a goal, i.e., an atom or a structure. </span> <li><em>The following properties should hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="48" href="basic_props.html#cgoal/1"><tt>basic_props:cgoal/1</tt></a>)</span><span><span class="lpdoc-var">Fact</span> is a term which represents a goal, i.e., an atom or a structure. </span> </ul> <em>Meta-predicate</em> with arguments: <tt>retractall_fact(fact)</tt>.<br/></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="current_fact_nb/1" href="ciaosearch.html#current_fact_nb/1">current_fact_nb/1</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>current_fact_nb(Fact)</tt> </span><p>Behaves as <a class="lpdoc-idx-anchor" id="49" href="#current_fact/1"><tt>current_fact/1</tt></a> but a fact is never waited on even if it is <a class="lpdoc-idx-anchor" id="50" href="ciaosearch.html#concurrent">concurrent</a> and non-closed.<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="51" href="basic_props.html#cgoal/1"><tt>basic_props:cgoal/1</tt></a>)</span><span><span class="lpdoc-var">Fact</span> is a term which represents a goal, i.e., an atom or a structure. </span> <li><em>The following properties should hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="52" href="basic_props.html#cgoal/1"><tt>basic_props:cgoal/1</tt></a>)</span><span><span class="lpdoc-var">Fact</span> is a term which represents a goal, i.e., an atom or a structure. </span> </ul> <em>Meta-predicate</em> with arguments: <tt>current_fact_nb(fact)</tt>.<br/></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="retract_fact_nb/1" href="ciaosearch.html#retract_fact_nb/1">retract_fact_nb/1</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>retract_fact_nb(Fact)</tt> </span><p>Behaves as <a class="lpdoc-idx-anchor" id="53" href="#retract_fact/1"><tt>retract_fact/1</tt></a>, but never waits on a fact, even if it has been declared as <a class="lpdoc-idx-anchor" id="54" href="ciaosearch.html#concurrent">concurrent</a> and is non-<a class="lpdoc-idx-anchor" id="55" href="ciaosearch.html#closed">closed</a>.<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="56" href="basic_props.html#cgoal/1"><tt>basic_props:cgoal/1</tt></a>)</span><span><span class="lpdoc-var">Fact</span> is a term which represents a goal, i.e., an atom or a structure. </span> <li><em>The following properties should hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="57" href="basic_props.html#cgoal/1"><tt>basic_props:cgoal/1</tt></a>)</span><span><span class="lpdoc-var">Fact</span> is a term which represents a goal, i.e., an atom or a structure. </span> </ul> <em>Meta-predicate</em> with arguments: <tt>retract_fact_nb(fact)</tt>.<br/></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="close_predicate/1" href="ciaosearch.html#close_predicate/1">close_predicate/1</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>close_predicate(Pred)</tt> </span><p><a class="lpdoc-idx-anchor" id="58" href="ciaosearch.html#closed"></a> Changes the behavior of the predicate <span class="lpdoc-var">Pred</span> if it has been declared as a <a class="lpdoc-idx-anchor" id="59" href="ciaosearch.html#concurrent predicate">concurrent predicate</a>: calls to this predicate will fail (instead of wait) if no more clauses of <span class="lpdoc-var">Pred</span> are available.<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="60" href="basic_props.html#cgoal/1"><tt>basic_props:cgoal/1</tt></a>)</span><span><span class="lpdoc-var">Pred</span> is a term which represents a goal, i.e., an atom or a structure. </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="basic_props.html#cgoal/1"><tt>basic_props:cgoal/1</tt></a>)</span><span><span class="lpdoc-var">Pred</span> is a term which represents a goal, i.e., an atom or a structure. </span> </ul> <em>Meta-predicate</em> with arguments: <tt>close_predicate(fact)</tt>.<br/></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="open_predicate/1" href="ciaosearch.html#open_predicate/1">open_predicate/1</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>open_predicate(Pred)</tt> </span><p>Reverts the behavior of <a class="lpdoc-idx-anchor" id="62" href="ciaosearch.html#concurrent predicate">concurrent predicate</a> <span class="lpdoc-var">Pred</span> to waiting instead of failing if no more clauses of <span class="lpdoc-var">Pred</span> are available.<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="63" href="basic_props.html#cgoal/1"><tt>basic_props:cgoal/1</tt></a>)</span><span><span class="lpdoc-var">Pred</span> is a term which represents a goal, i.e., an atom or a structure. </span> <li><em>The following properties should hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="64" href="basic_props.html#cgoal/1"><tt>basic_props:cgoal/1</tt></a>)</span><span><span class="lpdoc-var">Pred</span> is a term which represents a goal, i.e., an atom or a structure. </span> </ul> <em>Meta-predicate</em> with arguments: <tt>open_predicate(fact)</tt>.<br/></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="set_fact/1" href="ciaosearch.html#set_fact/1">set_fact/1</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>set_fact(Fact)</tt> </span><p>Sets <span class="lpdoc-var">Fact</span> as the unique fact of the corresponding <a class="lpdoc-idx-anchor" id="65" href="ciaosearch.html#data predicate">data predicate</a>.<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="66" href="basic_props.html#cgoal/1"><tt>basic_props:cgoal/1</tt></a>)</span><span><span class="lpdoc-var">Fact</span> is a term which represents a goal, i.e., an atom or a structure. </span> <li><em>The following properties should hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="67" href="basic_props.html#cgoal/1"><tt>basic_props:cgoal/1</tt></a>)</span><span><span class="lpdoc-var">Fact</span> is a term which represents a goal, i.e., an atom or a structure. </span> </ul> <em>Meta-predicate</em> with arguments: <tt>set_fact(fact)</tt>.<br/></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="erase/1" href="ciaosearch.html#erase/1">erase/1</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>erase(Ref)</tt> </span><p>Deletes the clause referenced by <span class="lpdoc-var">Ref</span>.<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="68" href="#reference/1"><tt>datafacts_rt:reference/1</tt></a>)</span><span><span class="lpdoc-var">Ref</span> is a reference of a dynamic or data clause. </span> <li><em>The following properties should hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="69" href="#reference/1"><tt>datafacts_rt:reference/1</tt></a>)</span><span><span class="lpdoc-var">Ref</span> is a reference of a dynamic or data clause. </span> <li><em>The following properties should hold globally:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="70" 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">REGTYPE</span><a class="lpdoc-idx-anchor" id="reference/1" href="ciaosearch.html#reference/1">reference/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>reference(R)</tt> </span><p><span class="lpdoc-var">R</span> is a reference of a dynamic or data clause.</p><ul class="lpdoc-itemize-minus"></ul></div></div><p> </div><div id="Documentation on internals"><h2>Documentation on internals</h2><div><div class="lpdoc-defname"><span class="lpdoc-predtag">DECLARATION</span><a class="lpdoc-idx-anchor" id="data/1" href="ciaosearch.html#data/1">data/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl">:- <tt>data(Predicates)</tt>. </span><p>Defines each predicate in <span class="lpdoc-var">Predicates</span> as a <a class="lpdoc-idx-anchor" id="71" href="ciaosearch.html#data predicate">data predicate</a>. If a predicate is defined data in a file, it must be defined data in every file containing clauses for that predicate. The directive should precede all clauses of the affected predicates. This directive is defined as a prefix operator in the compiler.</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="72" href="basic_props.html#sequence_or_list/2"><tt>basic_props:sequence_or_list/2</tt></a>)</span><span><span class="lpdoc-var">Predicates</span> is a sequence or list of <span class="lpdoc-var">predname</span>s. </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">DECLARATION</span><a class="lpdoc-idx-anchor" id="concurrent/1" href="ciaosearch.html#concurrent/1">concurrent/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl">:- <tt>concurrent(Predicates)</tt>. </span><p>Defines each predicate in <span class="lpdoc-var">Predicates</span> as a <a class="lpdoc-idx-anchor" id="73" href="ciaosearch.html#concurrent predicate">concurrent predicate</a>. If a predicate is defined concurrent in a file, it must be defined concurrent in every file containing clauses for that predicate. The directive should precede all clauses of the affected predicates. This directive is defined as a prefix operator in the compiler.</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="74" href="basic_props.html#sequence_or_list/2"><tt>basic_props:sequence_or_list/2</tt></a>)</span><span><span class="lpdoc-var">Predicates</span> is a sequence or list of <span class="lpdoc-var">predname</span>s. </span> </ul></div></div><p> </div><div id="Documentation on imports"><h2>Documentation on imports</h2>This module has the following direct dependencies:<ul class="lpdoc-itemize-minus"><li><em>Packages:</em><br/><a class="lpdoc-idx-anchor" id="75" href="noprelude_doc.html"><tt>noprelude</tt></a>, <a class="lpdoc-idx-anchor" id="76" href="ciaosearch.html#initial"><tt>initial</tt></a>, <a class="lpdoc-idx-anchor" id="77" href="condcomp_doc.html"><tt>condcomp</tt></a>, <a class="lpdoc-idx-anchor" id="78" href="assertions_doc.html"><tt>assertions</tt></a>, <a class="lpdoc-idx-anchor" id="79" href="ciaosearch.html#assertions/assertions_basic"><tt>assertions/assertions_basic</tt></a>, <a class="lpdoc-idx-anchor" id="80" href="ciaosearch.html#nortchecks"><tt>nortchecks</tt></a>, <a class="lpdoc-idx-anchor" id="81" href="isomodes_doc.html"><tt>isomodes</tt></a>. </ul></div></div><div class="lpdoc-footer">Generated with LPdoc using Ciao</div></div><div class="lpdoc-clearer"></div></div></body></html>