UNPKG

@ciao-lang/ts-ciao-interface

Version:

Simple Ciao interface for node.

8 lines (6 loc) 4.2 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>Dynamic predicates (not source preserving) &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="ExtendLang.html">&#x2191;</a><a class="lpdoc-navbutton" href="datafacts_rt.html">&#x2190;</a><a class="lpdoc-navbutton" href="dynamic_rt.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=""><strong>Dynamic predicates (not source preserving)</strong></a> &#9662;<ul><li><a href="dynamic_rt.html">Dynamic predicates (not source preserving) (runtime)</a></li></ul></li></ul><hr></hr><em>ON THIS PAGE</em><ul><li><a href="#Usage and interface">Usage and interface</a></li></ul></div><div class="lpdoc-main"><div id=""><h1>Dynamic predicates (not source preserving)</h1><a class="lpdoc-idx-anchor" href="ciaosearch.html#dynamic"></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> This module implements the assert/retract family of predicates to manipulate dynamic predicates.<p><div class="lpdoc-note"> This module does not preserve the original source definition of dynamic predicates. That is, <a class="lpdoc-idx-anchor" id="0" href="dynamic_rt.html#clause/2"><tt>clause/2</tt></a> may obtain the asserted clauses in lower-level expanded form rather than in the original shape. Use <a class="lpdoc-idx-anchor" id="1" href="dynamic_clauses_doc.html"><tt>dynamic_clauses</tt></a> if you need consulting the original form. </div> <p>The defined predicates (see <a class="lpdoc-idx-anchor" id="2" href="dynamic_rt.html"><tt>dynamic_rt</tt></a>) allow modification of the program as it is actually running. Clauses can be added to the program (<em>asserted</em>) or removed from the program (<em>retracted</em>). For these predicates, the argument which corresponds to the clause head must be instantiated to an atom or a compound term. The argument corresponding to the clause must be instantiated either to a term <tt>Head :- Body</tt> or, if the body part is empty, to <tt>Head</tt>. An empty body part is represented as <tt>true</tt>.<p>Note that using this library is very detrimental to global analysis, and that for most uses the predicates listed in <a href="datafacts_doc.html">Fast/concurrent update of facts</a> suffice.<br/><div id="Usage and interface"><h2>Usage and interface</h2><div class="lpdoc-cartouche"><ul><li><strong>Library usage:</strong><br/><tt>:- use_package(dynamic).</tt> or <tt>:- module(...,...,[dynamic]).</tt><li><strong>Implicit imports:</strong><br/><ul class="lpdoc-itemize-minus"><li><em>Packages:</em><br/><a class="lpdoc-idx-anchor" id="3" href="ciaosearch.html#prelude"><tt>prelude</tt></a>, <a class="lpdoc-idx-anchor" id="4" href="ciaosearch.html#initial"><tt>initial</tt></a>, <a class="lpdoc-idx-anchor" id="5" href="condcomp_doc.html"><tt>condcomp</tt></a>, <a class="lpdoc-idx-anchor" id="6" href="assertions_doc.html"><tt>assertions</tt></a>, <a class="lpdoc-idx-anchor" id="7" href="ciaosearch.html#assertions/assertions_basic"><tt>assertions/assertions_basic</tt></a>. </ul></ul></div></div></div><div class="lpdoc-footer">Generated with LPdoc using Ciao</div></div><div class="lpdoc-clearer"></div></div></body></html>