@ciao-lang/ts-ciao-interface
Version:
Simple Ciao interface for node.
32 lines • 9.96 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>Quintus-like internal database — 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="CompatProlog.html">↑</a><a class="lpdoc-navbutton" href="dec10_io.html">←</a><a class="lpdoc-navbutton" href="ttyout.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="CompatProlog.html">PART V - Compatibility</a> »<br/> </li><li><a href=""><strong>Quintus-like internal database</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 imports">Documentation on imports</a></li></ul></div><div class="lpdoc-main"><div id=""><h1>Quintus-like internal database</h1><a class="lpdoc-idx-anchor" href="ciaosearch.html#old_database"></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>.<p>
The predicates described in this section were introduced in early implementations of Prolog to provide efficient means of performing operations on large quantities of data. The introduction of indexed dynamic predicates have rendered these predicates obsolete, and the sole purpose of providing them is to support existing code. Their use in new code is discouraged.<p>These predicates store arbitrary terms in the database without interfering with the clauses which make up the program. The terms which are stored in this way can subsequently be retrieved via the key on which they were stored. Many terms may be stored on the same key, and they can be individually accessed by pattern matching. Alternatively, access can be achieved via a special identifier which uniquely identifies each recorded term and which is returned when the term is stored. <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(old_database)).</tt><li><strong>Exports:</strong><br/><ul class="lpdoc-itemize-minus"><li><em>Predicates:</em><br/><a class="lpdoc-idx-anchor" id="0" href="#recorda/3"><tt>recorda/3</tt></a>, <a class="lpdoc-idx-anchor" id="1" href="#recordz/3"><tt>recordz/3</tt></a>, <a class="lpdoc-idx-anchor" id="2" href="#recorded/3"><tt>recorded/3</tt></a>, <a class="lpdoc-idx-anchor" id="3" href="#current_key/2"><tt>current_key/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="recorda/3" href="ciaosearch.html#recorda/3">recorda/3</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>recorda(Key,Term,Ref)</tt>
</span><p>The term <span class="lpdoc-var">Term</span> is recorded in the internal database as the first item for the key <span class="lpdoc-var">Key</span>, where <span class="lpdoc-var">Ref</span> is its implementation-defined identifier. The key must be given, and only its principal functor is significant. Any uninstantiated variables in the <span class="lpdoc-var">Term</span> will be replaced by new private variables, along with copies of any subgoals blocked on these variables.<p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>recorda(Key,Term,Ref)</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="4" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">Key</span> is currently a term which is not a free variable.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="5" 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 globally:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="6" 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="recordz/3" href="ciaosearch.html#recordz/3">recordz/3</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>recordz(Key,Term,Ref)</tt>
</span><p>Like <tt>recorda/3</tt>, except that the new term becomes the <em>last</em> item for the key <span class="lpdoc-var">Key</span>.<p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>recordz(Key,Term,Ref)</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="7" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">Key</span> is currently a term which is not a free variable.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="8" 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 globally:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="9" 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="recorded/3" href="ciaosearch.html#recorded/3">recorded/3</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>recorded(Key,Term,Ref)</tt>
</span><p>The internal database is searched for terms recorded under the key <span class="lpdoc-var">Key</span>. These terms are successively unified with <span class="lpdoc-var">Term</span> in the order they occur in the database. At the same time, <span class="lpdoc-var">Ref</span> is unified with the implementation-defined identifier uniquely identifying the recorded item. If the key is instantiated to a compound term, only its principal functor is significant. If the key is uninstantiated, all terms in the database are successively unified with <span class="lpdoc-var">Term</span> in the order they occur.<p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>recorded(Key,Term,Ref)</tt>
</span><p></p><ul class="lpdoc-itemize-minus"><li><em>The following properties should hold globally:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="10" 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="current_key/2" href="ciaosearch.html#current_key/2">current_key/2</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>current_key(KeyName,KeyTerm)</tt>
</span><p><span class="lpdoc-var">KeyTerm</span> is the most general form of the key for a currently recorded term, and <span class="lpdoc-var">KeyName</span> is the name of that key. This predicate can be used to enumerate in undefined order all keys for currently recorded terms through backtracking.<p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>current_key(Name,Key)</tt>
</span><p></p><ul class="lpdoc-itemize-minus"><li><em>The following properties should hold globally:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="11" 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 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="12" href="datafacts_rt.html"><tt>datafacts_rt</tt></a>.
<li><em>Packages:</em><br/><a class="lpdoc-idx-anchor" id="13" href="ciaosearch.html#prelude"><tt>prelude</tt></a>, <a class="lpdoc-idx-anchor" id="14" href="ciaosearch.html#initial"><tt>initial</tt></a>, <a class="lpdoc-idx-anchor" id="15" href="condcomp_doc.html"><tt>condcomp</tt></a>, <a class="lpdoc-idx-anchor" id="16" href="assertions_doc.html"><tt>assertions</tt></a>, <a class="lpdoc-idx-anchor" id="17" href="ciaosearch.html#assertions/assertions_basic"><tt>assertions/assertions_basic</tt></a>, <a class="lpdoc-idx-anchor" id="18" href="isomodes_doc.html"><tt>isomodes</tt></a>, <a class="lpdoc-idx-anchor" id="19" 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>