UNPKG

@ciao-lang/ts-ciao-interface

Version:

Simple Ciao interface for node.

84 lines (82 loc) 16.6 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>Some basic Prolog modes &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="AssrtLang.html">&#x2191;</a><a class="lpdoc-navbutton" href="isomodes_doc.html">&#x2190;</a><a class="lpdoc-navbutton" href="doccomments_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="AssrtLang.html">PART III - Assertions and auto-documentation</a> &raquo;<br/> </li><li><a href=""><strong>Some basic Prolog modes</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 new modes">Documentation on new modes</a></li></ul></div><div class="lpdoc-main"><div id=""><h1>Some basic Prolog modes</h1><a class="lpdoc-idx-anchor" href="ciaosearch.html#basicmodes"></a> <strong>Author(s):</strong> <a class="lpdoc-idx-anchor" id="Manuel Hermenegildo" href="ciaosearch.html#Manuel Hermenegildo">Manuel Hermenegildo</a>.<p> This file defines a number of very simple ``<a class="lpdoc-idx-anchor" id="0" href="ciaosearch.html#modes">modes</a>&apos;&apos; which are frequently useful in programs. These correspond to some of the modes used in classical Prolog texts with simple addtions. Note that some of these modes use the same symbol as one of the <a class="lpdoc-idx-anchor" id="1" href="modes_doc.html"><tt>modes</tt></a> and <a class="lpdoc-idx-anchor" id="2" href="isomodes_doc.html"><tt>isomodes</tt></a> packages (see <a href="modes_doc.html">Classical Prolog modes</a> and <a href="isomodes_doc.html">ISO-Prolog modes</a>) but have in some cases subtly different meaning.<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(basicmodes).</tt> or <tt>:- module(...,...,[basicmodes]).</tt><li><strong>New operators defined:</strong><br/><a class="lpdoc-idx-anchor" id="3" href="modes_doc.html#?/1"><tt>?/1</tt></a> [500,fx], <a class="lpdoc-idx-anchor" id="4" href="modes_doc.html#@/1"><tt>@/1</tt></a> [500,fx]. <li><strong>New modes defined:</strong><br/><a class="lpdoc-idx-anchor" id="5" href="modes_doc.html#+/1"><tt>+/1</tt></a>, <a class="lpdoc-idx-anchor" id="6" href="modes_doc.html#-/1"><tt>-/1</tt></a>, <a class="lpdoc-idx-anchor" id="7" href="modes_doc.html#?/1"><tt>?/1</tt></a>, <a class="lpdoc-idx-anchor" id="8" href="modes_doc.html#@/1"><tt>@/1</tt></a>, <a class="lpdoc-idx-anchor" id="9" href="modes_doc.html#in/1"><tt>in/1</tt></a>, <a class="lpdoc-idx-anchor" id="10" href="modes_doc.html#out/1"><tt>out/1</tt></a>, <a class="lpdoc-idx-anchor" id="11" href="modes_doc.html#go/1"><tt>go/1</tt></a>, <a class="lpdoc-idx-anchor" id="12" href="modes_doc.html#+/2"><tt>+/2</tt></a>, <a class="lpdoc-idx-anchor" id="13" href="modes_doc.html#-/2"><tt>-/2</tt></a>, <a class="lpdoc-idx-anchor" id="14" href="modes_doc.html#?/2"><tt>?/2</tt></a>, <a class="lpdoc-idx-anchor" id="15" href="modes_doc.html#@/2"><tt>@/2</tt></a>, <a class="lpdoc-idx-anchor" id="16" href="modes_doc.html#in/2"><tt>in/2</tt></a>, <a class="lpdoc-idx-anchor" id="17" href="modes_doc.html#out/2"><tt>out/2</tt></a>, <a class="lpdoc-idx-anchor" id="18" href="modes_doc.html#go/2"><tt>go/2</tt></a>. <li><strong>Implicit imports:</strong><br/><ul class="lpdoc-itemize-minus"><li><em>System library modules:</em><br/><a class="lpdoc-idx-anchor" id="19" href="ciaosearch.html#meta_props"><tt>meta_props</tt></a>. <li><em>Packages:</em><br/><a class="lpdoc-idx-anchor" id="20" href="ciaosearch.html#prelude"><tt>prelude</tt></a>, <a class="lpdoc-idx-anchor" id="21" href="ciaosearch.html#initial"><tt>initial</tt></a>, <a class="lpdoc-idx-anchor" id="22" href="condcomp_doc.html"><tt>condcomp</tt></a>, <a class="lpdoc-idx-anchor" id="23" href="assertions_doc.html"><tt>assertions</tt></a>, <a class="lpdoc-idx-anchor" id="24" href="ciaosearch.html#assertions/assertions_basic"><tt>assertions/assertions_basic</tt></a>, <a class="lpdoc-idx-anchor" id="25" href="ciaosearch.html#metaprops"><tt>metaprops</tt></a>, <a class="lpdoc-idx-anchor" id="26" href="ciaosearch.html#hiord"><tt>hiord</tt></a>. </ul></ul></div></div><div id="Documentation on new modes"><h2>Documentation on new modes</h2><div><div class="lpdoc-defname"><span class="lpdoc-predtag">MODE</span><a class="lpdoc-idx-anchor" id="+/1" href="ciaosearch.html#+/1">+/1</a></div><div class="lpdoc-deftext">Input value in argument.<p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>+A</tt> </span><p></p><ul class="lpdoc-itemize-minus"><li><em>The following properties are added at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="27" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">A</span> is currently a term which is not a free variable. </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">MODE</span><a class="lpdoc-idx-anchor" id="-/1" href="ciaosearch.html#-/1">-/1</a></div><div class="lpdoc-deftext">No input value in argument.<p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>-A</tt> </span><p></p><ul class="lpdoc-itemize-minus"><li><em>The following properties are added at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="28" href="term_typing.html#var/1"><tt>term_typing:var/1</tt></a>)</span><span><span class="lpdoc-var">A</span> is a free variable. </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">MODE</span><a class="lpdoc-idx-anchor" id="?/1" href="ciaosearch.html#?/1">?/1</a></div><div class="lpdoc-deftext">Unspecified argument.</div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">MODE</span><a class="lpdoc-idx-anchor" id="@/1" href="ciaosearch.html#@/1">@/1</a></div><div class="lpdoc-deftext">No output value in argument.<p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>@(A)</tt> </span><p></p><ul class="lpdoc-itemize-minus"><li><em>The following properties are added globally:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="29" href="basic_props.html#not_further_inst/2"><tt>basic_props:not_further_inst/2</tt></a>)</span><span><span class="lpdoc-var">A</span> is not further instantiated. </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">MODE</span><a class="lpdoc-idx-anchor" id="in/1" href="ciaosearch.html#in/1">in/1</a></div><div class="lpdoc-deftext">Input argument.<p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>in(A)</tt> </span><p></p><ul class="lpdoc-itemize-minus"><li><em>The following properties are added at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="30" href="term_typing.html#ground/1"><tt>term_typing:ground/1</tt></a>)</span><span><span class="lpdoc-var">A</span> is currently ground (it contains no variables). </span> <li><em>The following properties are added upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="31" href="term_typing.html#ground/1"><tt>term_typing:ground/1</tt></a>)</span><span><span class="lpdoc-var">A</span> is currently ground (it contains no variables). </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">MODE</span><a class="lpdoc-idx-anchor" id="out/1" href="ciaosearch.html#out/1">out/1</a></div><div class="lpdoc-deftext">Output argument.<p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>out(A)</tt> </span><p></p><ul class="lpdoc-itemize-minus"><li><em>The following properties are added at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="32" href="term_typing.html#var/1"><tt>term_typing:var/1</tt></a>)</span><span><span class="lpdoc-var">A</span> is a free variable. </span> <li><em>The following properties are added upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="33" href="term_typing.html#ground/1"><tt>term_typing:ground/1</tt></a>)</span><span><span class="lpdoc-var">A</span> is currently ground (it contains no variables). </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">MODE</span><a class="lpdoc-idx-anchor" id="go/1" href="ciaosearch.html#go/1">go/1</a></div><div class="lpdoc-deftext">Ground output (input/output argument).<p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>go(A)</tt> </span><p></p><ul class="lpdoc-itemize-minus"><li><em>The following properties are added upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="34" href="term_typing.html#ground/1"><tt>term_typing:ground/1</tt></a>)</span><span><span class="lpdoc-var">A</span> is currently ground (it contains no variables). </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">MODE</span><a class="lpdoc-idx-anchor" id="+/2" href="ciaosearch.html#+/2">+/2</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>A+X</tt> </span><p></p><ul class="lpdoc-itemize-minus"><li><em>Call and exit are compatible with:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="35" href="hiord_rt.html#call/2"><tt>meta_props:call/2</tt></a>)</span><span><span class="lpdoc-var">A</span> has property <span class="lpdoc-var">X</span>. </span> <li><em>The following properties are added at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="36" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">A</span> is currently a term which is not a free variable. </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">MODE</span><a class="lpdoc-idx-anchor" id="-/2" href="ciaosearch.html#-/2">-/2</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>A-X</tt> </span><p></p><ul class="lpdoc-itemize-minus"><li><em>Call and exit are compatible with:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="37" href="hiord_rt.html#call/2"><tt>meta_props:call/2</tt></a>)</span><span><span class="lpdoc-var">A</span> has property <span class="lpdoc-var">X</span>. </span> <li><em>The following properties are added at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="38" href="term_typing.html#var/1"><tt>term_typing:var/1</tt></a>)</span><span><span class="lpdoc-var">A</span> is a free variable. </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">MODE</span><a class="lpdoc-idx-anchor" id="?/2" href="ciaosearch.html#?/2">?/2</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>?(A,X)</tt> </span><p></p><ul class="lpdoc-itemize-minus"><li><em>Call and exit are compatible with:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="39" href="hiord_rt.html#call/2"><tt>meta_props:call/2</tt></a>)</span><span><span class="lpdoc-var">A</span> has property <span class="lpdoc-var">X</span>. </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">MODE</span><a class="lpdoc-idx-anchor" id="@/2" href="ciaosearch.html#@/2">@/2</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>@(A,X)</tt> </span><p></p><ul class="lpdoc-itemize-minus"><li><em>Call and exit are compatible with:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="40" href="hiord_rt.html#call/2"><tt>meta_props:call/2</tt></a>)</span><span><span class="lpdoc-var">A</span> has property <span class="lpdoc-var">X</span>. </span> <li><em>The following properties are added globally:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="41" href="basic_props.html#not_further_inst/2"><tt>basic_props:not_further_inst/2</tt></a>)</span><span><span class="lpdoc-var">A</span> is not further instantiated. </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">MODE</span><a class="lpdoc-idx-anchor" id="in/2" href="ciaosearch.html#in/2">in/2</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>in(A,X)</tt> </span><p></p><ul class="lpdoc-itemize-minus"><li><em>Call and exit are compatible with:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="42" href="hiord_rt.html#call/2"><tt>meta_props:call/2</tt></a>)</span><span><span class="lpdoc-var">A</span> has property <span class="lpdoc-var">X</span>. </span> <li><em>The following properties are added at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="43" href="term_typing.html#ground/1"><tt>term_typing:ground/1</tt></a>)</span><span><span class="lpdoc-var">A</span> is currently ground (it contains no variables). </span> <li><em>The following properties are added upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="44" href="term_typing.html#ground/1"><tt>term_typing:ground/1</tt></a>)</span><span><span class="lpdoc-var">A</span> is currently ground (it contains no variables). </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">MODE</span><a class="lpdoc-idx-anchor" id="out/2" href="ciaosearch.html#out/2">out/2</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>out(A,X)</tt> </span><p></p><ul class="lpdoc-itemize-minus"><li><em>Call and exit are compatible with:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="45" href="hiord_rt.html#call/2"><tt>meta_props:call/2</tt></a>)</span><span><span class="lpdoc-var">A</span> has property <span class="lpdoc-var">X</span>. </span> <li><em>The following properties are added at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="46" href="term_typing.html#var/1"><tt>term_typing:var/1</tt></a>)</span><span><span class="lpdoc-var">A</span> is a free variable. </span> <li><em>The following properties are added upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="47" href="term_typing.html#ground/1"><tt>term_typing:ground/1</tt></a>)</span><span><span class="lpdoc-var">A</span> is currently ground (it contains no variables). </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">MODE</span><a class="lpdoc-idx-anchor" id="go/2" href="ciaosearch.html#go/2">go/2</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>go(A,X)</tt> </span><p></p><ul class="lpdoc-itemize-minus"><li><em>Call and exit are compatible with:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="48" href="hiord_rt.html#call/2"><tt>meta_props:call/2</tt></a>)</span><span><span class="lpdoc-var">A</span> has property <span class="lpdoc-var">X</span>. </span> <li><em>The following properties are added upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="49" href="term_typing.html#ground/1"><tt>term_typing:ground/1</tt></a>)</span><span><span class="lpdoc-var">A</span> is currently ground (it contains no variables). </span> </ul></div></div><p> </div></div><div class="lpdoc-footer">Generated with LPdoc using Ciao</div></div><div class="lpdoc-clearer"></div></div></body></html>