@ciao-lang/ts-ciao-interface
Version:
Simple Ciao interface for node.
47 lines • 15.3 kB
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>Filed predicates (runtime) — 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="factsdb_doc.html">↑</a><a class="lpdoc-navbutton" href="factsdb_doc.html">←</a><a class="lpdoc-navbutton" href="concurrency.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="ExtendLang.html">PART IV - Language extensions</a> »<br/> </li><li><a href="factsdb_doc.html">Filed predicates</a> »<br/> </li><li><a href=""><strong>Filed predicates (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 multifiles">Documentation on multifiles</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>Filed predicates (runtime)</h1><a class="lpdoc-idx-anchor" href="ciaosearch.html#factsdb_rt"></a>
<strong>Author(s):</strong> <a class="lpdoc-idx-anchor" id="Francisco Bueno" href="ciaosearch.html#Francisco Bueno">Francisco Bueno</a>.<p>
Runtime module for the <a class="lpdoc-idx-anchor" id="0" href="factsdb_doc.html"><tt>factsdb</tt></a> package.<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(library(factsdb/factsdb_rt)).</tt><li><strong>Exports:</strong><br/><ul class="lpdoc-itemize-minus"><li><em>Predicates:</em><br/><a class="lpdoc-idx-anchor" id="1" href="datafacts_rt.html#asserta_fact/1"><tt>asserta_fact/1</tt></a>, <a class="lpdoc-idx-anchor" id="2" href="datafacts_rt.html#assertz_fact/1"><tt>assertz_fact/1</tt></a>, <a class="lpdoc-idx-anchor" id="3" href="hiord_rt.html#call/1"><tt>call/1</tt></a>, <a class="lpdoc-idx-anchor" id="4" href="datafacts_rt.html#current_fact/1"><tt>current_fact/1</tt></a>, <a class="lpdoc-idx-anchor" id="5" href="datafacts_rt.html#retract_fact/1"><tt>retract_fact/1</tt></a>.
<li><em>Multifiles:</em><br/><a class="lpdoc-idx-anchor" id="6" href="factsdb_doc.html#$factsdb$cached_goal/3"><tt>$factsdb$cached_goal/3</tt></a>, <a class="lpdoc-idx-anchor" id="7" href="persdb_rt.html#persistent_dir/2"><tt>persistent_dir/2</tt></a>, <a class="lpdoc-idx-anchor" id="8" href="#file_alias/2"><tt>file_alias/2</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"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>asserta_fact(Fact)</tt>
</span><p>Version of <a class="lpdoc-idx-anchor" id="9" href="ciaosearch.html#datafacts_rt:asserta_fact/1"><tt>datafacts_rt:asserta_fact/1</tt></a> for filed predicates. The current instance of <span class="lpdoc-var">Fact</span> is interpreted as a fact and is added at the beginning of the definition of the corresponding predicate. Therefore, before all the facts filed in the DB file for the predicate. The predicate concerned must be declared as <a class="lpdoc-idx-anchor" id="10" href="ciaosearch.html#facts"><tt>facts</tt></a>; if it is not, then <a class="lpdoc-idx-anchor" id="11" href="ciaosearch.html#datafacts_rt:asserta_fact/1"><tt>datafacts_rt:asserta_fact/1</tt></a> is used.</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="12" 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="assertz_fact/1" href="ciaosearch.html#assertz_fact/1">assertz_fact/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>assertz_fact(Fact)</tt>
</span><p>Version of <a class="lpdoc-idx-anchor" id="13" href="ciaosearch.html#datafacts_rt:assertz_fact/1"><tt>datafacts_rt:assertz_fact/1</tt></a> for filed predicates. The current instance of <span class="lpdoc-var">Fact</span> is interpreted as a fact and is added at the end of the definition of the corresponding predicate. Therefore, after all the facts filed in the DB file for the predicate. The predicate concerned must be declared as <a class="lpdoc-idx-anchor" id="14" href="ciaosearch.html#facts"><tt>facts</tt></a>; if it is not, then <a class="lpdoc-idx-anchor" id="15" href="ciaosearch.html#datafacts_rt:assertz_fact/1"><tt>datafacts_rt:assertz_fact/1</tt></a> is used.</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="16" 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="call/1" href="ciaosearch.html#call/1">call/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>call(Fact)</tt>
</span><p>Same as <a class="lpdoc-idx-anchor" id="17" href="datafacts_rt.html#current_fact/1"><tt>current_fact/1</tt></a> if the predicate concerned is declared as <a class="lpdoc-idx-anchor" id="18" href="ciaosearch.html#facts"><tt>facts</tt></a>. If it is not, an exception is raised.</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>
</ul>
<em>Meta-predicate</em> with arguments: <tt>call(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"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>current_fact(Fact)</tt>
</span><p>Version of <a class="lpdoc-idx-anchor" id="20" href="ciaosearch.html#datafacts_rt:current_fact/1"><tt>datafacts_rt:current_fact/1</tt></a> for filed predicates. The current instance of <span class="lpdoc-var">Fact</span> is interpreted as a fact and is unified with an actual fact in the current definition of the corresponding predicate. Therefore, with a fact previously asserted or filed in the DB file for the predicate, if it has not been retracted. The predicate concerned must be declared as <a class="lpdoc-idx-anchor" id="21" href="ciaosearch.html#facts"><tt>facts</tt></a>; if it is not, then <a class="lpdoc-idx-anchor" id="22" href="ciaosearch.html#datafacts_rt:current_fact/1"><tt>datafacts_rt:current_fact/1</tt></a> is used.</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>
</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"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>retract_fact(Fact)</tt>
</span><p>Version of <a class="lpdoc-idx-anchor" id="24" href="ciaosearch.html#datafacts_rt:retract_fact/1"><tt>datafacts_rt:retract_fact/1</tt></a> for filed predicates. The current instance of <span class="lpdoc-var">Fact</span> is interpreted as a fact and is unified with an actual fact in the current definition of the corresponding predicate; such a fact is deleted from the predicate definition. This is true even for the facts filed in the DB file for the predicate; but these are NOT deleted from the file (unless the predicate is persistent). The predicate concerned must be declared as <a class="lpdoc-idx-anchor" id="25" href="ciaosearch.html#facts"><tt>facts</tt></a>; if it is not, then <a class="lpdoc-idx-anchor" id="26" href="ciaosearch.html#datafacts_rt:retract_fact/1"><tt>datafacts_rt:retract_fact/1</tt></a> is used.</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="27" 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 id="Documentation on multifiles"><h2>Documentation on multifiles</h2><div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="$factsdb$cached_goal/3" href="ciaosearch.html#$factsdb$cached_goal/3">$factsdb$cached_goal/3</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>$factsdb$cached_goal(Spec,Spec,Key)</tt>
</span><p>Predicate <span class="lpdoc-var">Spec</span> is filed within database <span class="lpdoc-var">Key</span>. Programmers should not define this predicate directly in the program.
The predicate is <em>multifile</em>.<br/></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="persistent_dir/2" href="ciaosearch.html#persistent_dir/2">persistent_dir/2</a></div><div class="lpdoc-deftext">See <a class="lpdoc-idx-anchor" id="28" href="ciaosearch.html#persdb"><tt>persdb</tt></a>.
The predicate is <em>multifile</em>.<br/>
The predicate is of type <em>data</em>.<br/></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="file_alias/2" href="ciaosearch.html#file_alias/2">file_alias/2</a></div><div class="lpdoc-deftext">See <a class="lpdoc-idx-anchor" id="29" href="symfnames.html"><tt>symfnames</tt></a>. This predicate is used only if <a class="lpdoc-idx-anchor" id="30" href="persdb_rt.html#persistent_dir/2"><tt>persistent_dir/2</tt></a> fails.
The predicate is <em>multifile</em>.<br/>
The predicate is of type <em>data</em>.<br/></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="facts/2" href="ciaosearch.html#facts/2">facts/2</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl">:- <tt>facts(PredDesc,Keyword)</tt>.
</span><p>Declares the predicate <span class="lpdoc-var">PredDesc</span> as filed. <span class="lpdoc-var">Keyword</span> is the <a class="lpdoc-idx-anchor" id="31" href="ciaosearch.html#identifier of a location">identifier of a location</a> where the file DB for the predicate is kept. The location <span class="lpdoc-var">Keyword</span> is described in the <a class="lpdoc-idx-anchor" id="32" href="ciaosearch.html#file_alias"><tt>file_alias</tt></a> predicate, which must contain a fact in which the first argument unifies with <span class="lpdoc-var">Keyword</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="33" href="basic_props.html#predname/1"><tt>basic_props:predname/1</tt></a>)</span><span><span class="lpdoc-var">PredDesc</span> is a predicate name.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="34" href="persdb_rt.html#keyword/1"><tt>persdb_cache:keyword/1</tt></a>)</span><span><span class="lpdoc-var">Keyword</span> is an atom corresponding to a directory identifier.
</span>
</ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="keyword/1" href="ciaosearch.html#keyword/1">keyword/1</a></div><div class="lpdoc-deftext">See <a class="lpdoc-idx-anchor" id="35" href="persdb_rt.html"><tt>persdb_rt</tt></a>. The same conventions for location of DB files apply in both packages.</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>System library modules:</em><br/><a class="lpdoc-idx-anchor" id="36" href="datafacts_rt.html"><tt>datafacts_rt</tt></a>, <a class="lpdoc-idx-anchor" id="37" href="counters.html"><tt>counters</tt></a>, <a class="lpdoc-idx-anchor" id="38" href="read.html"><tt>read</tt></a>, <a class="lpdoc-idx-anchor" id="39" href="ciaosearch.html#persdb_cache"><tt>persdb_cache</tt></a>.
<li><em>Packages:</em><br/><a class="lpdoc-idx-anchor" id="40" href="ciaosearch.html#prelude"><tt>prelude</tt></a>, <a class="lpdoc-idx-anchor" id="41" href="ciaosearch.html#initial"><tt>initial</tt></a>, <a class="lpdoc-idx-anchor" id="42" href="condcomp_doc.html"><tt>condcomp</tt></a>, <a class="lpdoc-idx-anchor" id="43" href="assertions_doc.html"><tt>assertions</tt></a>, <a class="lpdoc-idx-anchor" id="44" href="ciaosearch.html#assertions/assertions_basic"><tt>assertions/assertions_basic</tt></a>, <a class="lpdoc-idx-anchor" id="45" href="datafacts_doc.html"><tt>datafacts</tt></a>.
</ul></div></div><div class="lpdoc-footer">Generated with LPdoc using Ciao</div></div><div class="lpdoc-clearer"></div></div></body></html>