UNPKG

@ciao-lang/ts-ciao-interface

Version:

Simple Ciao interface for node.

59 lines 13.9 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>Miscellaneous ISO Prolog predicates &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="CompatProlog.html">&#x2191;</a><a class="lpdoc-navbutton" href="iso_char.html">&#x2190;</a><a class="lpdoc-navbutton" href="iso_incomplete.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="CompatProlog.html">PART V - Compatibility</a> &raquo;<br/> </li><li><a href=""><strong>Miscellaneous ISO Prolog predicates</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>Miscellaneous ISO Prolog predicates</h1><a class="lpdoc-idx-anchor" href="ciaosearch.html#iso_misc"></a> <strong>Author(s):</strong> <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>.<p> This module implements some miscellaneous ISO Prolog predicates.<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(iso_misc)).</tt><li><strong>Exports:</strong><br/><ul class="lpdoc-itemize-minus"><li><em>Predicates:</em><br/><a class="lpdoc-idx-anchor" id="0" href="#once/1"><tt>once/1</tt></a>, <a class="lpdoc-idx-anchor" id="1" href="#forall/2"><tt>forall/2</tt></a>, <a class="lpdoc-idx-anchor" id="2" href="#call_det/2"><tt>call_det/2</tt></a>, <a class="lpdoc-idx-anchor" id="3" href="#compound/1"><tt>compound/1</tt></a>, <a class="lpdoc-idx-anchor" id="4" href="#sub_atom/5"><tt>sub_atom/5</tt></a>, <a class="lpdoc-idx-anchor" id="5" href="#unify_with_occurs_check/2"><tt>unify_with_occurs_check/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="once/1" href="ciaosearch.html#once/1">once/1</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>once(G)</tt> </span><p>Finds the first solution of goal <span class="lpdoc-var">G</span> (if any). <a class="lpdoc-idx-anchor" id="6" href="#once/1"><tt>once/1</tt></a> behaves as <a class="lpdoc-idx-anchor" id="7" href="hiord_rt.html#call/1"><tt>call/1</tt></a>, except that no further solutions are explored on backtracking.<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="8" href="basic_props.html#cgoal/1"><tt>basic_props:cgoal/1</tt></a>)</span><span><span class="lpdoc-var">G</span> is a term which represents a goal, i.e., an atom or a structure. </span> </ul> <em>Meta-predicate</em> with arguments: <tt>once(goal)</tt>.<br/></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="forall/2" href="ciaosearch.html#forall/2">forall/2</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>forall(Generate,Test)</tt> </span><p><a class="lpdoc-idx-anchor" id="9" href="ciaosearch.html#Test"><tt>Test</tt></a> succeeds for all solutions to <a class="lpdoc-idx-anchor" id="10" href="ciaosearch.html#Generate"><tt>Generate</tt></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="11" href="basic_props.html#cgoal/1"><tt>basic_props:cgoal/1</tt></a>)</span><span><span class="lpdoc-var">Generate</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="12" href="basic_props.html#cgoal/1"><tt>basic_props:cgoal/1</tt></a>)</span><span><span class="lpdoc-var">Test</span> is a term which represents a goal, i.e., an atom or a structure. </span> </ul> <em>Meta-predicate</em> with arguments: <tt>forall(goal,goal)</tt>.<br/></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="call_det/2" href="ciaosearch.html#call_det/2">call_det/2</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>call_det(G,Det)</tt> </span><p>Call goal <span class="lpdoc-var">G</span> and unify <span class="lpdoc-var">Det</span> with <tt>true</tt> if no additional choice-points has been created, or <tt>false</tt> otherwise<p><span class="lpdoc-usage-header">Usage:</span><p></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="13" href="basic_props.html#atm/1"><tt>basic_props:atm/1</tt></a>)</span><span><span class="lpdoc-var">Det</span> is an atom. </span> <li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="14" href="basic_props.html#cgoal/1"><tt>basic_props:cgoal/1</tt></a>)</span><span><span class="lpdoc-var">G</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="15" href="basic_props.html#atm/1"><tt>basic_props:atm/1</tt></a>)</span><span><span class="lpdoc-var">Det</span> is an atom. </span> </ul> <em>Meta-predicate</em> with arguments: <tt>call_det(goal,?)</tt>.<br/></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="compound/1" href="ciaosearch.html#compound/1">compound/1</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>compound(T)</tt> </span><p><span class="lpdoc-var">T</span> is currently instantiated to a compound term.<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>Call and exit should be compatible with:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="16" href="basic_props.html#term/1"><tt>basic_props:term/1</tt></a>)</span><span><span class="lpdoc-var">T</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="17" href="basic_props.html#term/1"><tt>basic_props:term/1</tt></a>)</span><span><span class="lpdoc-var">T</span> is any term. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="18" href="basic_props.html#struct/1"><tt>basic_props:struct/1</tt></a>)</span><span><span class="lpdoc-var">T</span> is a compound term. </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="sub_atom/5" href="ciaosearch.html#sub_atom/5">sub_atom/5</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>sub_atom(Atom,Before,Length,After,Sub_atom)</tt> </span><p>Is true iff atom <span class="lpdoc-var">Atom</span> can be broken into three pieces, <span class="lpdoc-var">AtomL</span>, <span class="lpdoc-var">Sub_atom</span> and <span class="lpdoc-var">AtomR</span> such that <span class="lpdoc-var">Before</span> is the number of characters of the name of <span class="lpdoc-var">AtomL</span>, <span class="lpdoc-var">Length</span> is the number of characters of the name of <span class="lpdoc-var">Sub_atom</span> and <span class="lpdoc-var">After</span> is the number of characters of the name of <span class="lpdoc-var">AtomR</span><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>Call and exit should be compatible with:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="19" href="basic_props.html#int/1"><tt>basic_props:int/1</tt></a>)</span><span><span class="lpdoc-var">Before</span> is an integer. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="20" href="basic_props.html#int/1"><tt>basic_props:int/1</tt></a>)</span><span><span class="lpdoc-var">Length</span> is an integer. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="21" href="basic_props.html#int/1"><tt>basic_props:int/1</tt></a>)</span><span><span class="lpdoc-var">After</span> is an integer. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="22" href="basic_props.html#atm/1"><tt>basic_props:atm/1</tt></a>)</span><span><span class="lpdoc-var">Sub_atom</span> is an atom. </span> <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#atm/1"><tt>basic_props:atm/1</tt></a>)</span><span><span class="lpdoc-var">Atom</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="24" href="basic_props.html#int/1"><tt>basic_props:int/1</tt></a>)</span><span><span class="lpdoc-var">Before</span> is an integer. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="25" href="basic_props.html#int/1"><tt>basic_props:int/1</tt></a>)</span><span><span class="lpdoc-var">Length</span> is an integer. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="26" href="basic_props.html#int/1"><tt>basic_props:int/1</tt></a>)</span><span><span class="lpdoc-var">After</span> is an integer. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="27" href="basic_props.html#atm/1"><tt>basic_props:atm/1</tt></a>)</span><span><span class="lpdoc-var">Sub_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="unify_with_occurs_check/2" href="ciaosearch.html#unify_with_occurs_check/2">unify_with_occurs_check/2</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>unify_with_occurs_check(X,Y)</tt> </span><p>Attempts to compute and apply a most general unifier of the two terms <span class="lpdoc-var">X</span> and <span class="lpdoc-var">Y</span>. Is true iff <span class="lpdoc-var">X</span> and <span class="lpdoc-var">Y</span> are unifiable.<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>Call and exit should be compatible with:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="28" href="basic_props.html#term/1"><tt>basic_props:term/1</tt></a>)</span><span><span class="lpdoc-var">X</span> is any term. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="29" href="basic_props.html#term/1"><tt>basic_props:term/1</tt></a>)</span><span><span class="lpdoc-var">Y</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="30" href="basic_props.html#term/1"><tt>basic_props:term/1</tt></a>)</span><span><span class="lpdoc-var">X</span> is any term. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="31" href="basic_props.html#term/1"><tt>basic_props:term/1</tt></a>)</span><span><span class="lpdoc-var">Y</span> is any term. </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="32" href="between.html"><tt>between</tt></a>. <li><em>Packages:</em><br/><a class="lpdoc-idx-anchor" id="33" href="ciaosearch.html#prelude"><tt>prelude</tt></a>, <a class="lpdoc-idx-anchor" id="34" href="ciaosearch.html#initial"><tt>initial</tt></a>, <a class="lpdoc-idx-anchor" id="35" href="condcomp_doc.html"><tt>condcomp</tt></a>, <a class="lpdoc-idx-anchor" id="36" href="assertions_doc.html"><tt>assertions</tt></a>, <a class="lpdoc-idx-anchor" id="37" href="ciaosearch.html#assertions/assertions_basic"><tt>assertions/assertions_basic</tt></a>, <a class="lpdoc-idx-anchor" id="38" 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>