@ciao-lang/ts-ciao-interface
Version:
Simple Ciao interface for node.
179 lines • 37.6 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>Common higher-order predicates — 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="DataStructuresAlgs.html">↑</a><a class="lpdoc-navbutton" href="lists.html">←</a><a class="lpdoc-navbutton" href="sort.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="DataStructuresAlgs.html">PART VI - Data structures and algorithms</a> »<br/> </li><li><a href=""><strong>Common higher-order 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>Common higher-order predicates</h1><a class="lpdoc-idx-anchor" href="ciaosearch.html#hiordlib"></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="Manuel Carro" href="ciaosearch.html#Manuel Carro">Manuel Carro</a>, <a class="lpdoc-idx-anchor" id="Edison Mera" href="ciaosearch.html#Edison Mera">Edison Mera</a>, <a class="lpdoc-idx-anchor" id="Jose F. Morales" href="ciaosearch.html#Jose F. Morales">Jose F. Morales</a>.<p>
This library implements a few basic higher-order predicates for reducing and transforming lists. <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(hiordlib)).</tt><li><strong>Exports:</strong><br/><ul class="lpdoc-itemize-minus"><li><em>Predicates:</em><br/><a class="lpdoc-idx-anchor" id="0" href="#foldl/4"><tt>foldl/4</tt></a>, <a class="lpdoc-idx-anchor" id="1" href="#foldl/5"><tt>foldl/5</tt></a>, <a class="lpdoc-idx-anchor" id="2" href="#foldl/6"><tt>foldl/6</tt></a>, <a class="lpdoc-idx-anchor" id="3" href="#foldl/7"><tt>foldl/7</tt></a>, <a class="lpdoc-idx-anchor" id="4" href="#foldl/8"><tt>foldl/8</tt></a>, <a class="lpdoc-idx-anchor" id="5" href="#foldr/4"><tt>foldr/4</tt></a>, <a class="lpdoc-idx-anchor" id="6" href="#minimum/3"><tt>minimum/3</tt></a>, <a class="lpdoc-idx-anchor" id="7" href="#filter/3"><tt>filter/3</tt></a>, <a class="lpdoc-idx-anchor" id="8" href="#partition/4"><tt>partition/4</tt></a>, <a class="lpdoc-idx-anchor" id="9" href="#maplist/2"><tt>maplist/2</tt></a>, <a class="lpdoc-idx-anchor" id="10" href="#maplist/3"><tt>maplist/3</tt></a>, <a class="lpdoc-idx-anchor" id="11" href="#maplist/4"><tt>maplist/4</tt></a>, <a class="lpdoc-idx-anchor" id="12" href="#maplist/5"><tt>maplist/5</tt></a>, <a class="lpdoc-idx-anchor" id="13" href="#maplist/6"><tt>maplist/6</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="foldl/4" href="ciaosearch.html#foldl/4">foldl/4</a></div><div class="lpdoc-deftext"> The left fold family <tt>foldl/(n+3)</tt> is equivalent to:<p><pre class="lpdoc-codeblock">foldl(P, [X11, ..., X1m], ..., [Xn1, ..., Xnm], V0, V) :-
P(X11, ..., Xn1, V0, V1),
...
P(X1m, ..., Xnm, Vm_1, V).
</pre> <p>where <tt>P</tt> is a predicate of arity <tt>n+2</tt>, i.e., of type <tt>pred(n+2)</tt>. <p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>foldl(P,Xs,V0,V)</tt>
</span><p>Reduces (fold) <span class="lpdoc-var">Xs</span> from the left applying <span class="lpdoc-var">P</span> and using <span class="lpdoc-var">V0</span>-<span class="lpdoc-var">V</span> as accumulator.</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="14" href="basic_props.html#cgoal/1"><tt>basic_props:cgoal/1</tt></a>)</span><span><span class="lpdoc-var">P</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="15" href="basic_props.html#list/2"><tt>basic_props:list/2</tt></a>)</span><span><span class="lpdoc-var">Xs</span> is a list of <span class="lpdoc-var">term</span>s.
</span><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">V0</span> is any term.
</span><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">V</span> is any term.
</span>
<li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="18" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">P</span> is currently a term which is not a free variable.
</span>
</ul>
<em>Meta-predicate</em> with arguments: <tt>foldl(pred(3),?,?,?)</tt>.<br/></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="foldl/5" href="ciaosearch.html#foldl/5">foldl/5</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>foldl(P,Xs,Ys,V0,V)</tt>
</span><p>Like <a class="lpdoc-idx-anchor" id="19" href="#foldl/4"><tt>foldl/4</tt></a> but applied to successive tuples from <span class="lpdoc-var">Xs</span>, <span class="lpdoc-var">Ys</span>.</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="20" href="basic_props.html#cgoal/1"><tt>basic_props:cgoal/1</tt></a>)</span><span><span class="lpdoc-var">P</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="21" href="basic_props.html#list/2"><tt>basic_props:list/2</tt></a>)</span><span><span class="lpdoc-var">Xs</span> is a list of <span class="lpdoc-var">term</span>s.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="22" href="basic_props.html#list/2"><tt>basic_props:list/2</tt></a>)</span><span><span class="lpdoc-var">Ys</span> is a list of <span class="lpdoc-var">term</span>s.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="23" href="basic_props.html#term/1"><tt>basic_props:term/1</tt></a>)</span><span><span class="lpdoc-var">V0</span> is any term.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="24" href="basic_props.html#term/1"><tt>basic_props:term/1</tt></a>)</span><span><span class="lpdoc-var">V</span> is any term.
</span>
<li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="25" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">P</span> is currently a term which is not a free variable.
</span>
</ul>
<em>Meta-predicate</em> with arguments: <tt>foldl(pred(4),?,?,?,?)</tt>.<br/></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="foldl/6" href="ciaosearch.html#foldl/6">foldl/6</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>foldl(P,Xs,Ys,Zs,V0,V)</tt>
</span><p>Like <a class="lpdoc-idx-anchor" id="26" href="#foldl/4"><tt>foldl/4</tt></a> but applied to successive tuples from <span class="lpdoc-var">Xs</span>, <span class="lpdoc-var">Ys</span>, <span class="lpdoc-var">Zs</span>.</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="27" href="basic_props.html#cgoal/1"><tt>basic_props:cgoal/1</tt></a>)</span><span><span class="lpdoc-var">P</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="28" href="basic_props.html#list/2"><tt>basic_props:list/2</tt></a>)</span><span><span class="lpdoc-var">Xs</span> is a list of <span class="lpdoc-var">term</span>s.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="29" href="basic_props.html#list/2"><tt>basic_props:list/2</tt></a>)</span><span><span class="lpdoc-var">Ys</span> is a list of <span class="lpdoc-var">term</span>s.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="30" href="basic_props.html#list/2"><tt>basic_props:list/2</tt></a>)</span><span><span class="lpdoc-var">Zs</span> is a list of <span class="lpdoc-var">term</span>s.
</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">V0</span> is any term.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="32" href="basic_props.html#term/1"><tt>basic_props:term/1</tt></a>)</span><span><span class="lpdoc-var">V</span> is any term.
</span>
<li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="33" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">P</span> is currently a term which is not a free variable.
</span>
</ul>
<em>Meta-predicate</em> with arguments: <tt>foldl(pred(5),?,?,?,?,?)</tt>.<br/></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="foldl/7" href="ciaosearch.html#foldl/7">foldl/7</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>foldl(P,Xs,Ys,Zs,Us,V0,V)</tt>
</span><p>Like <a class="lpdoc-idx-anchor" id="34" href="#foldl/4"><tt>foldl/4</tt></a> but applied to successive tuples from <span class="lpdoc-var">Xs</span>, <span class="lpdoc-var">Ys</span>, <span class="lpdoc-var">Zs</span>, <span class="lpdoc-var">Us</span>.</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="35" href="basic_props.html#cgoal/1"><tt>basic_props:cgoal/1</tt></a>)</span><span><span class="lpdoc-var">P</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="36" href="basic_props.html#list/2"><tt>basic_props:list/2</tt></a>)</span><span><span class="lpdoc-var">Xs</span> is a list of <span class="lpdoc-var">term</span>s.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="37" href="basic_props.html#list/2"><tt>basic_props:list/2</tt></a>)</span><span><span class="lpdoc-var">Ys</span> is a list of <span class="lpdoc-var">term</span>s.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="38" href="basic_props.html#list/2"><tt>basic_props:list/2</tt></a>)</span><span><span class="lpdoc-var">Zs</span> is a list of <span class="lpdoc-var">term</span>s.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="39" href="basic_props.html#list/2"><tt>basic_props:list/2</tt></a>)</span><span><span class="lpdoc-var">Us</span> is a list of <span class="lpdoc-var">term</span>s.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="40" href="basic_props.html#term/1"><tt>basic_props:term/1</tt></a>)</span><span><span class="lpdoc-var">V0</span> is any term.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="41" href="basic_props.html#term/1"><tt>basic_props:term/1</tt></a>)</span><span><span class="lpdoc-var">V</span> is any term.
</span>
<li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="42" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">P</span> is currently a term which is not a free variable.
</span>
</ul>
<em>Meta-predicate</em> with arguments: <tt>foldl(pred(6),?,?,?,?,?,?)</tt>.<br/></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="foldl/8" href="ciaosearch.html#foldl/8">foldl/8</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>foldl(P,Xs,Ys,Zs,Us,Ws,V0,V)</tt>
</span><p>Like <a class="lpdoc-idx-anchor" id="43" href="#foldl/4"><tt>foldl/4</tt></a> but applied to successive tuples from <span class="lpdoc-var">Xs</span>, <span class="lpdoc-var">Ys</span>, <span class="lpdoc-var">Zs</span>, <span class="lpdoc-var">Us</span>, <span class="lpdoc-var">Ws</span>.</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="44" href="basic_props.html#cgoal/1"><tt>basic_props:cgoal/1</tt></a>)</span><span><span class="lpdoc-var">P</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="45" href="basic_props.html#list/2"><tt>basic_props:list/2</tt></a>)</span><span><span class="lpdoc-var">Xs</span> is a list of <span class="lpdoc-var">term</span>s.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="46" href="basic_props.html#list/2"><tt>basic_props:list/2</tt></a>)</span><span><span class="lpdoc-var">Ys</span> is a list of <span class="lpdoc-var">term</span>s.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="47" href="basic_props.html#list/2"><tt>basic_props:list/2</tt></a>)</span><span><span class="lpdoc-var">Zs</span> is a list of <span class="lpdoc-var">term</span>s.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="48" href="basic_props.html#list/2"><tt>basic_props:list/2</tt></a>)</span><span><span class="lpdoc-var">Us</span> is a list of <span class="lpdoc-var">term</span>s.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="49" href="basic_props.html#list/2"><tt>basic_props:list/2</tt></a>)</span><span><span class="lpdoc-var">Ws</span> is a list of <span class="lpdoc-var">term</span>s.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="50" href="basic_props.html#term/1"><tt>basic_props:term/1</tt></a>)</span><span><span class="lpdoc-var">V0</span> is any term.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="51" href="basic_props.html#term/1"><tt>basic_props:term/1</tt></a>)</span><span><span class="lpdoc-var">V</span> is any term.
</span>
<li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="52" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">P</span> is currently a term which is not a free variable.
</span>
</ul>
<em>Meta-predicate</em> with arguments: <tt>foldl(pred(7),?,?,?,?,?,?,?)</tt>.<br/></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="foldr/4" href="ciaosearch.html#foldr/4">foldr/4</a></div><div class="lpdoc-deftext"> The right fold family <tt>foldr/(n+3)</tt> is equivalent to:<p><pre class="lpdoc-codeblock">foldr(P, [X11, ..., X1m], ..., [Xn1, ..., Xnm], V0, V) :-
P(X1m, ..., Xnm, V0, V1),
...
P(X11, ..., Xn1, Vm_1, V).
</pre> <p>where <tt>P</tt> is a predicate of arity <tt>n+2</tt>, i.e., of type <tt>pred(n+2)</tt>.<p>Note that <tt>foldr/(n+3)</tt> is not tail recursive. When <tt>P(...,?,?)</tt> is a valid calling mode, it would be possible to reorder the calls as in:<p><pre class="lpdoc-codeblock">foldr_tail(P, [X11, ..., X1m], ..., [Xn1, ..., Xnm], V0, V) :-
P(X11, ..., Xn1, Vm_1, V),
...
P(X1m, ..., Xnm, V0, V1).
</pre> <p>which is exactly like <tt>foldl/(n+3)</tt> but with flipped accumulator arguments. See <tt>foldl/(n+3)</tt> examples. <p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>foldr(F,Xs,V0,V)</tt>
</span><p>Reduces (fold) <span class="lpdoc-var">Xs</span> from the right applying <span class="lpdoc-var">P</span> and using <span class="lpdoc-var">V0</span>-<span class="lpdoc-var">V</span> as accumulator.</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="53" href="basic_props.html#cgoal/1"><tt>basic_props:cgoal/1</tt></a>)</span><span><span class="lpdoc-var">F</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="54" href="basic_props.html#list/2"><tt>basic_props:list/2</tt></a>)</span><span><span class="lpdoc-var">Xs</span> is a list of <span class="lpdoc-var">term</span>s.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="55" href="basic_props.html#term/1"><tt>basic_props:term/1</tt></a>)</span><span><span class="lpdoc-var">V0</span> is any term.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="56" href="basic_props.html#term/1"><tt>basic_props:term/1</tt></a>)</span><span><span class="lpdoc-var">V</span> is any term.
</span>
<li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="57" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">F</span> is currently a term which is not a free variable.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="58" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">V0</span> is currently a term which is not a free variable.
</span>
</ul>
<em>Meta-predicate</em> with arguments: <tt>foldr(pred(3),?,?,?)</tt>.<br/></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="minimum/3" href="ciaosearch.html#minimum/3">minimum/3</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>minimum(List,SmallerThan,Minimum)</tt>
</span><p><span class="lpdoc-var">Minimum</span> is the smaller in the nonempty list <span class="lpdoc-var">List</span> according to the relation <span class="lpdoc-var">SmallerThan</span>: <a class="lpdoc-idx-anchor" id="59" href="ciaosearch.html#SmallerThan(X, Y)"><tt>SmallerThan(X, Y)</tt></a> succeeds iff X is smaller than Y.</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="60" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">SmallerThan</span> is currently a term which is not a free variable.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="61" href="basic_props.html#list/1"><tt>basic_props:list/1</tt></a>)</span><span><span class="lpdoc-var">List</span> is a list.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="62" href="basic_props.html#cgoal/1"><tt>basic_props:cgoal/1</tt></a>)</span><span><span class="lpdoc-var">SmallerThan</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="63" href="basic_props.html#term/1"><tt>basic_props:term/1</tt></a>)</span><span><span class="lpdoc-var">Minimum</span> is any term.
</span>
</ul>
<em>Meta-predicate</em> with arguments: <tt>minimum(?,pred(2),?)</tt>.<br/></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="filter/3" href="ciaosearch.html#filter/3">filter/3</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>filter(P,Xs,Ys)</tt>
</span><p><span class="lpdoc-var">Ys</span> contains all elements <span class="lpdoc-var">X</span> of <span class="lpdoc-var">Xs</span> such that <tt>P(X)</tt> holds (preserving the order)</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="64" href="basic_props.html#cgoal/1"><tt>basic_props:cgoal/1</tt></a>)</span><span><span class="lpdoc-var">P</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="65" href="basic_props.html#list/1"><tt>basic_props:list/1</tt></a>)</span><span><span class="lpdoc-var">Xs</span> is a list.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="66" href="basic_props.html#list/1"><tt>basic_props:list/1</tt></a>)</span><span><span class="lpdoc-var">Ys</span> is a list.
</span>
<li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="67" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">P</span> is currently a term which is not a free variable.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="68" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">Xs</span> is currently a term which is not 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="69" href="native_props_nfdet_doc.html#is_det/1"><tt>native_props:is_det/1</tt></a>)</span><span>All calls of the form <span class="lpdoc-var">filter(P,Xs,Ys)</span> are deterministic.
</span>
</ul>
<em>Meta-predicate</em> with arguments: <tt>filter(pred(1),?,?)</tt>.<br/></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="partition/4" href="ciaosearch.html#partition/4">partition/4</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>partition(P,Xs,Ys,Zs)</tt>
</span><p><span class="lpdoc-var">Ys</span> contains all elements <span class="lpdoc-var">X</span> of <span class="lpdoc-var">Xs</span> such that <tt>P(X)</tt> holds, and <span class="lpdoc-var">Zs</span> all that does not (preserving the order)</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="70" href="basic_props.html#cgoal/1"><tt>basic_props:cgoal/1</tt></a>)</span><span><span class="lpdoc-var">P</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="71" href="basic_props.html#list/1"><tt>basic_props:list/1</tt></a>)</span><span><span class="lpdoc-var">Xs</span> is a list.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="72" href="basic_props.html#list/1"><tt>basic_props:list/1</tt></a>)</span><span><span class="lpdoc-var">Ys</span> is a list.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="73" href="basic_props.html#list/1"><tt>basic_props:list/1</tt></a>)</span><span><span class="lpdoc-var">Zs</span> is a list.
</span>
<li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="74" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">P</span> is currently a term which is not a free variable.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="75" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">Xs</span> is currently a term which is not a free variable.
</span>
</ul>
<em>Meta-predicate</em> with arguments: <tt>partition(pred(1),?,?,?)</tt>.<br/></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="maplist/2" href="ciaosearch.html#maplist/2">maplist/2</a></div><div class="lpdoc-deftext"> The map list family <tt>maplist/(n+1)</tt> is equivalent to:<p><pre class="lpdoc-codeblock">maplist(P, [X11, ..., X1m], ..., [Xn1, ..., Xnm]) :-
P(X11, ..., Xn1),
...
P(X1m, ..., Xnm).
</pre> <p>where <tt>P</tt> is a predicate of arity <tt>n</tt>, i.e., of type <tt>pred(n)</tt>. <p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>maplist(P,Xs)</tt>
</span><p><tt>P(X)</tt> succeeds for each element <span class="lpdoc-var">X</span> of <span class="lpdoc-var">Xs</span></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="76" href="basic_props.html#cgoal/1"><tt>basic_props:cgoal/1</tt></a>)</span><span><span class="lpdoc-var">P</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="77" href="basic_props.html#list/1"><tt>basic_props:list/1</tt></a>)</span><span><span class="lpdoc-var">Xs</span> is a list.
</span>
<li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="78" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">P</span> is currently a term which is not a free variable.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="79" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">Xs</span> is currently a term which is not a free variable.
</span>
</ul>
<em>Meta-predicate</em> with arguments: <tt>maplist(pred(1),?)</tt>.<br/></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="maplist/3" href="ciaosearch.html#maplist/3">maplist/3</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>maplist(P,Xs,Ys)</tt>
</span><p>Like <a class="lpdoc-idx-anchor" id="80" href="#maplist/2"><tt>maplist/2</tt></a> but applied to successive tuples from <span class="lpdoc-var">Xs</span>, <span class="lpdoc-var">Ys</span>.</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="81" href="basic_props.html#cgoal/1"><tt>basic_props:cgoal/1</tt></a>)</span><span><span class="lpdoc-var">P</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="82" href="basic_props.html#list/1"><tt>basic_props:list/1</tt></a>)</span><span><span class="lpdoc-var">Xs</span> is a list.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="83" href="basic_props.html#list/1"><tt>basic_props:list/1</tt></a>)</span><span><span class="lpdoc-var">Ys</span> is a list.
</span>
<li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="84" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">P</span> is currently a term which is not a free variable.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="85" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">Xs</span> is currently a term which is not a free variable.
</span>
</ul>
<em>Meta-predicate</em> with arguments: <tt>maplist(pred(2),?,?)</tt>.<br/></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="maplist/4" href="ciaosearch.html#maplist/4">maplist/4</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>maplist(P,Xs,Ys,Zs)</tt>
</span><p>Like <a class="lpdoc-idx-anchor" id="86" href="#maplist/2"><tt>maplist/2</tt></a> but applied to successive tuples from <span class="lpdoc-var">Xs</span>, <span class="lpdoc-var">Ys</span>, <span class="lpdoc-var">Zs</span>.</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="87" href="basic_props.html#cgoal/1"><tt>basic_props:cgoal/1</tt></a>)</span><span><span class="lpdoc-var">P</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="88" href="basic_props.html#list/1"><tt>basic_props:list/1</tt></a>)</span><span><span class="lpdoc-var">Xs</span> is a list.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="89" href="basic_props.html#list/1"><tt>basic_props:list/1</tt></a>)</span><span><span class="lpdoc-var">Ys</span> is a list.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="90" href="basic_props.html#list/1"><tt>basic_props:list/1</tt></a>)</span><span><span class="lpdoc-var">Zs</span> is a list.
</span>
<li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="91" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">P</span> is currently a term which is not a free variable.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="92" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">Xs</span> is currently a term which is not a free variable.
</span>
</ul>
<em>Meta-predicate</em> with arguments: <tt>maplist(pred(3),?,?,?)</tt>.<br/></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="maplist/5" href="ciaosearch.html#maplist/5">maplist/5</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>maplist(P,Xs,Ys,Zs,Vs)</tt>
</span><p>Like <a class="lpdoc-idx-anchor" id="93" href="#maplist/2"><tt>maplist/2</tt></a> but applied to successive tuples from <span class="lpdoc-var">Xs</span>, <span class="lpdoc-var">Ys</span>, <span class="lpdoc-var">Zs</span>, <span class="lpdoc-var">Vs</span>.</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="94" href="basic_props.html#cgoal/1"><tt>basic_props:cgoal/1</tt></a>)</span><span><span class="lpdoc-var">P</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="95" href="basic_props.html#list/1"><tt>basic_props:list/1</tt></a>)</span><span><span class="lpdoc-var">Xs</span> is a list.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="96" href="basic_props.html#list/1"><tt>basic_props:list/1</tt></a>)</span><span><span class="lpdoc-var">Ys</span> is a list.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="97" href="basic_props.html#list/1"><tt>basic_props:list/1</tt></a>)</span><span><span class="lpdoc-var">Zs</span> is a list.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="98" href="basic_props.html#list/1"><tt>basic_props:list/1</tt></a>)</span><span><span class="lpdoc-var">Vs</span> is a list.
</span>
<li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="99" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">P</span> is currently a term which is not a free variable.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="100" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">Xs</span> is currently a term which is not a free variable.
</span>
</ul>
<em>Meta-predicate</em> with arguments: <tt>maplist(pred(4),?,?,?,?)</tt>.<br/></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="maplist/6" href="ciaosearch.html#maplist/6">maplist/6</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>maplist(P,Xs,Ys,Zs,Vs,Ws)</tt>
</span><p>Like <a class="lpdoc-idx-anchor" id="101" href="#maplist/2"><tt>maplist/2</tt></a> but applied to successive tuples from <span class="lpdoc-var">Xs</span>, <span class="lpdoc-var">Ys</span>, <span class="lpdoc-var">Zs</span>, <span class="lpdoc-var">Vs</span>, <span class="lpdoc-var">Ws</span>.</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="102" href="basic_props.html#cgoal/1"><tt>basic_props:cgoal/1</tt></a>)</span><span><span class="lpdoc-var">P</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="103" href="basic_props.html#list/1"><tt>basic_props:list/1</tt></a>)</span><span><span class="lpdoc-var">Xs</span> is a list.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="104" href="basic_props.html#list/1"><tt>basic_props:list/1</tt></a>)</span><span><span class="lpdoc-var">Ys</span> is a list.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="105" href="basic_props.html#list/1"><tt>basic_props:list/1</tt></a>)</span><span><span class="lpdoc-var">Zs</span> is a list.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="106" href="basic_props.html#list/1"><tt>basic_props:list/1</tt></a>)</span><span><span class="lpdoc-var">Vs</span> is a list.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="107" href="basic_props.html#list/1"><tt>basic_props:list/1</tt></a>)</span><span><span class="lpdoc-var">Ws</span> is a list.
</span>
<li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="108" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">P</span> is currently a term which is not a free variable.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="109" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">Xs</span> is currently a term which is not a free variable.
</span>
</ul>
<em>Meta-predicate</em> with arguments: <tt>maplist(pred(5),?,?,?,?,?)</tt>.<br/></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="110" href="ciaosearch.html#native_props"><tt>native_props</tt></a>.
<li><em>Packages:</em><br/><a class="lpdoc-idx-anchor" id="111" href="ciaosearch.html#prelude"><tt>prelude</tt></a>, <a class="lpdoc-idx-anchor" id="112" href="ciaosearch.html#initial"><tt>initial</tt></a>, <a class="lpdoc-idx-anchor" id="113" href="condcomp_doc.html"><tt>condcomp</tt></a>, <a class="lpdoc-idx-anchor" id="114" href="assertions_doc.html"><tt>assertions</tt></a>, <a class="lpdoc-idx-anchor" id="115" href="ciaosearch.html#assertions/assertions_basic"><tt>assertions/assertions_basic</tt></a>, <a class="lpdoc-idx-anchor" id="116" href="basicmodes_doc.html"><tt>basicmodes</tt></a>, <a class="lpdoc-idx-anchor" id="117" href="ciaosearch.html#nativeprops"><tt>nativeprops</tt></a>, <a class="lpdoc-idx-anchor" id="118" href="dcg_doc.html"><tt>dcg</tt></a>, <a class="lpdoc-idx-anchor" id="119" href="fsyntax_doc.html"><tt>fsyntax</tt></a>, <a class="lpdoc-idx-anchor" id="120" href="ciaosearch.html#hiord"><tt>hiord</tt></a>, <a class="lpdoc-idx-anchor" id="121" href="ciaosearch.html#unittestdecls"><tt>unittestdecls</tt></a>.
</ul></div></div><div class="lpdoc-footer">Generated with LPdoc using Ciao</div></div><div class="lpdoc-clearer"></div></div></body></html>