@ciao-lang/ts-ciao-interface
Version:
Simple Ciao interface for node.
174 lines (173 loc) • 33.1 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>Basic term manipulation — 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="BasicLang.html">↑</a><a class="lpdoc-navbutton" href="term_typing.html">←</a><a class="lpdoc-navbutton" href="term_compare.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="BasicLang.html">PART II - The Ciao basic language</a> »<br/> </li><li><a href=""><strong>Basic term manipulation</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>Basic term manipulation</h1><a class="lpdoc-idx-anchor" href="ciaosearch.html#term_basic"></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 Hermenegildo" href="ciaosearch.html#Manuel Hermenegildo">Manuel Hermenegildo</a>.<p>
This module provides basic term manipulation.<br/><div id="Usage and interface"><h2>Usage and interface</h2><div class="lpdoc-cartouche"><ul><li><strong>Library usage:</strong><br/>This module is imported by default (unless the <a class="lpdoc-idx-anchor" id="0" href="noprelude_doc.html"><tt>noprelude</tt></a> or <a class="lpdoc-idx-anchor" id="1" href="pure_doc.html"><tt>pure</tt></a> packages are used). <li><strong>Exports:</strong><br/><ul class="lpdoc-itemize-minus"><li><em>Predicates:</em><br/><a class="lpdoc-idx-anchor" id="2" href="#\=/2"><tt>\=/2</tt></a>, <a class="lpdoc-idx-anchor" id="3" href="#arg/3"><tt>arg/3</tt></a>, <a class="lpdoc-idx-anchor" id="4" href="#functor/3"><tt>functor/3</tt></a>, <a class="lpdoc-idx-anchor" id="5" href="#=../2"><tt>=../2</tt></a>, <a class="lpdoc-idx-anchor" id="6" href="#copy_term/2"><tt>copy_term/2</tt></a>, <a class="lpdoc-idx-anchor" id="7" href="#copy_term_nat/2"><tt>copy_term_nat/2</tt></a>, <a class="lpdoc-idx-anchor" id="8" href="#C/3"><tt>C/3</tt></a>, <a class="lpdoc-idx-anchor" id="9" href="#cyclic_term/1"><tt>cyclic_term/1</tt></a>.
<li><em>Properties:</em><br/><a class="lpdoc-idx-anchor" id="10" href="#=/2"><tt>=/2</tt></a>, <a class="lpdoc-idx-anchor" id="11" href="#const_head/1"><tt>const_head/1</tt></a>.
<li><em>Regular Types:</em><br/><a class="lpdoc-idx-anchor" id="12" href="#list_functor/1"><tt>list_functor/1</tt></a>, <a class="lpdoc-idx-anchor" id="13" href="#non_empty_list/1"><tt>non_empty_list/1</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="=/2" href="ciaosearch.html#=/2">=/2</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>X=Y</tt>
</span><p><span class="lpdoc-var">X</span> and <span class="lpdoc-var">Y</span> unify.</p><ul class="lpdoc-itemize-minus"><li><em>The following properties hold globally:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="14" href="basic_props.html#sideff/2"><tt>basic_props:sideff/2</tt></a>)</span><span><span class="lpdoc-var">X=Y</span> is side-effect <span class="lpdoc-var">free</span>.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="15" href="basic_props.html#native/1"><tt>basic_props:native/1</tt></a>)</span><span>This predicate is understood natively by CiaoPP.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="16" href="basic_props.html#eval/1"><tt>basic_props:eval/1</tt></a>)</span><span><span class="lpdoc-var">X=Y</span> is evaluable at compile-time.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="17" 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">X=Y</span> are deterministic.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="18" href="native_props_cardinality_doc.html#relations/2"><tt>native_props:relations/2</tt></a>)</span><span>Goal <span class="lpdoc-var">X=Y</span> produces <span class="lpdoc-var">inf</span> solutions.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="19" href="ciaosearch.html#test_type/2"><tt>native_props:test_type/2</tt></a>)</span><span>Indicates the type of test that a predicate performs. Required by the nonfailure analyisis.
</span>
</ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</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"><span class="lpdoc-on-right"><span class="lpdoc-iso">ISO</span></span><span><tt>X\=Y</tt></span>
</span><p><span class="lpdoc-var">X</span> and <span class="lpdoc-var">Y</span> are not unifiable.</p><ul class="lpdoc-itemize-minus"><li><em>The following properties hold globally:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="20" href="basic_props.html#sideff/2"><tt>basic_props:sideff/2</tt></a>)</span><span><span class="lpdoc-var">X\=Y</span> is side-effect <span class="lpdoc-var">free</span>.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="21" href="basic_props.html#bind_ins/1"><tt>basic_props:bind_ins/1</tt></a>)</span><span><span class="lpdoc-var">X\=Y</span> is binding insensitive.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="22" 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">X\=Y</span> are deterministic.
</span>
</ul>
<strong>Other properties:</strong> <br/><span class="lpdoc-usage-decl"><tt>X\=Y</tt>
</span><p></p><ul class="lpdoc-itemize-minus"><li><em>If the following properties hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="23" href="term_typing.html#ground/1"><tt>term_typing:ground/1</tt></a>)</span><span><span class="lpdoc-var">X</span> is currently ground (it contains no variables).
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="24" href="term_typing.html#ground/1"><tt>term_typing:ground/1</tt></a>)</span><span><span class="lpdoc-var">Y</span> is currently ground (it contains no variables).
</span>
<br/><em>then the following properties hold globally:</em>
<br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="25" href="basic_props.html#eval/1"><tt>basic_props:eval/1</tt></a>)</span><span><span class="lpdoc-var">X\=Y</span> is evaluable at compile-time.
</span>
</ul><span class="lpdoc-usage-decl"><tt>X\=Y</tt>
</span><p></p><ul class="lpdoc-itemize-minus"><li><em>The following properties hold globally:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="26" href="basic_props.html#sideff/2"><tt>basic_props:sideff/2</tt></a>)</span><span><span class="lpdoc-var">X\=Y</span> is side-effect <span class="lpdoc-var">free</span>.
</span>
</ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="arg/3" href="ciaosearch.html#arg/3">arg/3</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage 1:</span><span class="lpdoc-usage-decl"><tt>arg(ArgNo,Term,Arg)</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="27" href="basic_props.html#num/1"><tt>basic_props:num/1</tt></a>)</span><span><span class="lpdoc-var">ArgNo</span> is a number.
</span>
<li><em>The following properties hold globally:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="28" 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">arg(ArgNo,Term,Arg)</span> are deterministic.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="29" href="native_props_cardinality_doc.html#relations/2"><tt>native_props:relations/2</tt></a>)</span><span>Goal <span class="lpdoc-var">arg(ArgNo,Term,Arg)</span> produces <span class="lpdoc-var">inf</span> solutions.
</span>
</ul><p><span class="lpdoc-usage-header">Usage 2:</span><span class="lpdoc-usage-decl"><tt>arg(ArgNo,Term,Arg)</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="30" href="basic_props.html#num/1"><tt>basic_props:num/1</tt></a>)</span><span><span class="lpdoc-var">ArgNo</span> is a number.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="31" href="basic_props.html#gnd/1"><tt>basic_props:gnd/1</tt></a>)</span><span><span class="lpdoc-var">Term</span> is ground.
</span>
<li><em>The following properties hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="32" href="basic_props.html#gnd/1"><tt>basic_props:gnd/1</tt></a>)</span><span><span class="lpdoc-var">Arg</span> is ground.
</span>
</ul><p><span class="lpdoc-usage-header">Usage 3:</span><span class="lpdoc-usage-decl"><span class="lpdoc-on-right"><span class="lpdoc-iso">ISO</span></span><span><tt>arg(ArgNo,Term,Arg)</tt></span>
</span><p>Argument <span class="lpdoc-var">ArgNo</span> of the term <span class="lpdoc-var">Term</span> is <span class="lpdoc-var">Arg</span>.</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="33" href="basic_props.html#nnegint/1"><tt>basic_props:nnegint/1</tt></a>)</span><span><span class="lpdoc-var">ArgNo</span> is a non-negative integer.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="34" href="basic_props.html#struct/1"><tt>basic_props:struct/1</tt></a>)</span><span><span class="lpdoc-var">Term</span> is a compound term.
</span>
<li><em>The following properties hold globally:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="35" href="basic_props.html#sideff/2"><tt>basic_props:sideff/2</tt></a>)</span><span><span class="lpdoc-var">arg(ArgNo,Term,Arg)</span> is side-effect <span class="lpdoc-var">free</span>.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="36" href="basic_props.html#native/1"><tt>basic_props:native/1</tt></a>)</span><span>This predicate is understood natively by CiaoPP.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="37" href="basic_props.html#bind_ins/1"><tt>basic_props:bind_ins/1</tt></a>)</span><span><span class="lpdoc-var">arg(ArgNo,Term,Arg)</span> is binding insensitive.
</span>
</ul><p><span class="lpdoc-usage-header">Usage 4:</span><span class="lpdoc-usage-decl"><tt>arg(ArgNo,Term,Arg)</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="38" href="basic_props.html#nnegint/1"><tt>basic_props:nnegint/1</tt></a>)</span><span><span class="lpdoc-var">ArgNo</span> is a non-negative integer.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="39" href="basic_props.html#gnd/1"><tt>basic_props:gnd/1</tt></a>)</span><span><span class="lpdoc-var">Term</span> is ground.
</span>
<li><em>The following properties hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="40" href="basic_props.html#gnd/1"><tt>basic_props:gnd/1</tt></a>)</span><span><span class="lpdoc-var">Arg</span> is ground.
</span>
</ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="functor/3" href="ciaosearch.html#functor/3">functor/3</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage 1:</span><span class="lpdoc-usage-decl"><span class="lpdoc-on-right"><span class="lpdoc-iso">ISO</span></span><span><tt>functor(Term,Name,Arity)</tt></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="41" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">Term</span> is currently a term which is not a free variable.
</span>
<li><em>The following properties hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="42" href="basic_props.html#atm/1"><tt>basic_props:atm/1</tt></a>)</span><span><span class="lpdoc-var">Name</span> is an atom.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="43" href="basic_props.html#nnegint/1"><tt>basic_props:nnegint/1</tt></a>)</span><span><span class="lpdoc-var">Arity</span> is a non-negative integer.
</span>
<li><em>The following properties hold globally:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="44" href="basic_props.html#not_further_inst/2"><tt>basic_props:not_further_inst/2</tt></a>)</span><span><span class="lpdoc-var">Term</span> is not further instantiated.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="45" href="basic_props.html#sideff/2"><tt>basic_props:sideff/2</tt></a>)</span><span><span class="lpdoc-var">functor(Term,Name,Arity)</span> is side-effect <span class="lpdoc-var">free</span>.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="46" href="basic_props.html#native/1"><tt>basic_props:native/1</tt></a>)</span><span>This predicate is understood natively by CiaoPP.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="47" href="basic_props.html#bind_ins/1"><tt>basic_props:bind_ins/1</tt></a>)</span><span><span class="lpdoc-var">functor(Term,Name,Arity)</span> is binding insensitive.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="48" href="basic_props.html#eval/1"><tt>basic_props:eval/1</tt></a>)</span><span><span class="lpdoc-var">functor(Term,Name,Arity)</span> is evaluable at compile-time.
</span>
</ul><p><span class="lpdoc-usage-header">Usage 2:</span><span class="lpdoc-usage-decl"><span class="lpdoc-on-right"><span class="lpdoc-iso">ISO</span></span><span><tt>functor(Term,Name,Arity)</tt></span>
</span><p>The principal functor of the term <span class="lpdoc-var">Term</span> has name <span class="lpdoc-var">Name</span> and arity <span class="lpdoc-var">Arity</span>.</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="49" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">Name</span> is currently a term which is not a free variable.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="50" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">Arity</span> is currently a term which is not a free variable.
</span>
<li><em>The following properties hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="51" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">Term</span> is currently a term which is not a free variable.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="52" href="basic_props.html#atm/1"><tt>basic_props:atm/1</tt></a>)</span><span><span class="lpdoc-var">Name</span> is an atom.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="53" href="basic_props.html#nnegint/1"><tt>basic_props:nnegint/1</tt></a>)</span><span><span class="lpdoc-var">Arity</span> is a non-negative integer.
</span>
<li><em>The following properties hold globally:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="54" href="basic_props.html#sideff/2"><tt>basic_props:sideff/2</tt></a>)</span><span><span class="lpdoc-var">functor(Term,Name,Arity)</span> is side-effect <span class="lpdoc-var">free</span>.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="55" href="basic_props.html#native/1"><tt>basic_props:native/1</tt></a>)</span><span>This predicate is understood natively by CiaoPP.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="56" href="basic_props.html#bind_ins/1"><tt>basic_props:bind_ins/1</tt></a>)</span><span><span class="lpdoc-var">functor(Term,Name,Arity)</span> is binding insensitive.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="57" href="basic_props.html#eval/1"><tt>basic_props:eval/1</tt></a>)</span><span><span class="lpdoc-var">functor(Term,Name,Arity)</span> is evaluable at compile-time.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="58" href="native_props_nfdet_doc.html#not_fails/1"><tt>native_props:not_fails/1</tt></a>)</span><span>All the calls of the form <span class="lpdoc-var">functor(Term,Name,Arity)</span> do not fail.
</span>
</ul><p><span class="lpdoc-usage-header">Usage 3:</span><span class="lpdoc-usage-decl"><tt>functor(Term,Name,Arity)</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="59" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">Term</span> is currently a term which is not a free variable.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="60" href="term_typing.html#var/1"><tt>term_typing:var/1</tt></a>)</span><span><span class="lpdoc-var">Name</span> is a free variable.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="61" href="term_typing.html#var/1"><tt>term_typing:var/1</tt></a>)</span><span><span class="lpdoc-var">Arity</span> is a free variable.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="62" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">Term</span> is currently a term which is not a free variable.
</span>
<li><em>The following properties hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="63" href="native_props_cost_doc.html#size/2"><tt>native_props:size/2</tt></a>)</span><span><span class="lpdoc-var">1</span> is the size of argument <span class="lpdoc-var">Name</span>, for any approximation.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="64" href="native_props_cost_doc.html#size/2"><tt>native_props:size/2</tt></a>)</span><span><span class="lpdoc-var">arity(Term)</span> is the size of argument <span class="lpdoc-var">Arity</span>, for any approximation.
</span>
<li><em>The following properties hold globally:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="65" href="native_props_cost_doc.html#size_metric/3"><tt>native_props:size_metric/3</tt></a>)</span><span><span class="lpdoc-var">arity</span> is the measure used to determine the size of the terms that <span class="lpdoc-var">Term</span> is bound to, for any type of approximation.
</span>
</ul>
<strong>Other properties:</strong> <br/><p></p><ul class="lpdoc-itemize-minus"><li><em>The following properties hold globally:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="66" href="basic_props.html#sideff/2"><tt>basic_props:sideff/2</tt></a>)</span><span><span class="lpdoc-var">functor(Arg1,Arg2,Arg3)</span> is side-effect <span class="lpdoc-var">free</span>.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="67" href="basic_props.html#native/1"><tt>basic_props:native/1</tt></a>)</span><span>This predicate is understood natively by CiaoPP.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="68" 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">functor(Arg1,Arg2,Arg3)</span> are deterministic.
</span>
</ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</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"><span class="lpdoc-on-right"><span class="lpdoc-iso">ISO</span></span><span><tt>Term=..List</tt></span>
</span><p>The functor and arguments of the term <span class="lpdoc-var">Term</span> comprise the list <span class="lpdoc-var">List</span>.</p><ul class="lpdoc-itemize-minus"><li><em>The following properties hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="69" 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>
<li><em>The following properties hold globally:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="70" href="basic_props.html#sideff/2"><tt>basic_props:sideff/2</tt></a>)</span><span><span class="lpdoc-var">Term=..List</span> is side-effect <span class="lpdoc-var">free</span>.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="71" href="basic_props.html#native/1"><tt>basic_props:native/1</tt></a>)</span><span>This predicate is understood natively by CiaoPP.
</span>
</ul>
<strong>Other properties:</strong> <br/><p></p><ul class="lpdoc-itemize-minus"><li><em>If the following properties hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="72" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">Arg1</span> is currently a term which is not a free variable.
</span>
<br/><em>then the following properties hold globally:</em>
<br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="73" href="basic_props.html#eval/1"><tt>basic_props:eval/1</tt></a>)</span><span><span class="lpdoc-var">Arg1=..Arg2</span> is evaluable at compile-time.
</span>
</ul><span class="lpdoc-usage-decl"><tt>Arg1=..List</tt>
</span><p></p><ul class="lpdoc-itemize-minus"><li><em>If the following properties hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="74" 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="76" href="#const_head/1"><tt>term_basic:const_head/1</tt></a>)</span><span><a class="lpdoc-idx-anchor" id="75" href="ciaosearch.html#const_head(List)"><tt>term_basic:const_head(List)</tt></a>
</span>
<br/><em>then the following properties hold globally:</em>
<br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="77" href="basic_props.html#eval/1"><tt>basic_props:eval/1</tt></a>)</span><span><span class="lpdoc-var">Arg1=..List</span> is evaluable at compile-time.
</span>
</ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="const_head/1" href="ciaosearch.html#const_head/1">const_head/1</a></div><div class="lpdoc-deftext">No further documentation available for this predicate.</div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="copy_term/2" href="ciaosearch.html#copy_term/2">copy_term/2</a></div><div class="lpdoc-deftext"><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><tt>copy_term(Term,Copy)</tt></span>
</span><p><span class="lpdoc-var">Copy</span> is a renaming of <span class="lpdoc-var">Term</span>, such that brand new variables have been substituted for all variables in <span class="lpdoc-var">Term</span>. If any of the variables of <span class="lpdoc-var">Term</span> have <a class="lpdoc-idx-anchor" id="78" href="ciaosearch.html#attributes">attributes</a>, the copied variables will have copies of the attributes as well. It behaves as if defined by:<p><pre class="lpdoc-codeblock">:- data 'copy of'/1.
copy_term(X, Y) :-
asserta_fact('copy of'(X)),
retract_fact('copy of'(Y)).
</pre></p><ul class="lpdoc-itemize-minus"><li><em>The following properties hold globally:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="79" href="basic_props.html#sideff/2"><tt>basic_props:sideff/2</tt></a>)</span><span><span class="lpdoc-var">copy_term(Term,Copy)</span> is side-effect <span class="lpdoc-var">free</span>.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="80" href="basic_props.html#native/1"><tt>basic_props:native/1</tt></a>)</span><span>This predicate is understood natively by CiaoPP.
</span>
</ul>
<strong>Other properties:</strong> <br/><span class="lpdoc-usage-decl"><tt>copy_term(Term,Copy)</tt>
</span><p></p><ul class="lpdoc-itemize-minus"><li><em>If the following properties hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="81" href="term_typing.html#ground/1"><tt>term_typing:ground/1</tt></a>)</span><span><span class="lpdoc-var">Term</span> is currently ground (it contains no variables).
</span>
<br/><em>then the following properties hold globally:</em>
<br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="82" href="basic_props.html#eval/1"><tt>basic_props:eval/1</tt></a>)</span><span><span class="lpdoc-var">copy_term(Term,Copy)</span> is evaluable at compile-time.
</span>
</ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="copy_term_nat/2" href="ciaosearch.html#copy_term_nat/2">copy_term_nat/2</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>copy_term_nat(Term,Copy)</tt>
</span><p>Same as <a class="lpdoc-idx-anchor" id="83" href="#copy_term/2"><tt>copy_term/2</tt></a>, except that attributes of variables are not copied.</p><ul class="lpdoc-itemize-minus"><li><em>The following properties hold globally:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="84" href="basic_props.html#sideff/2"><tt>basic_props:sideff/2</tt></a>)</span><span><span class="lpdoc-var">copy_term_nat(Term,Copy)</span> is side-effect <span class="lpdoc-var">free</span>.
</span>
</ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="C/3" href="ciaosearch.html#C/3">C/3</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage 1:</span><span class="lpdoc-usage-decl"><tt>C(S1,Terminal,S2)</tt>
</span><p></p><ul class="lpdoc-itemize-minus"><li><em>The following properties hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="86" href="#list_functor/1"><tt>term_basic:list_functor/1</tt></a>)</span><span><a class="lpdoc-idx-anchor" id="85" href="ciaosearch.html#list_functor(S1)"><tt>term_basic:list_functor(S1)</tt></a>
</span>
</ul><p><span class="lpdoc-usage-header">Usage 2:</span><span class="lpdoc-usage-decl"><tt>C(S1,Terminal,S2)</tt>
</span><p><span class="lpdoc-var">S1</span> is connected by the terminal <span class="lpdoc-var">Terminal</span> to <span class="lpdoc-var">S2</span>. Internally used in <em>DCG grammar rules</em>. Defined as if by the single clause: <tt>'C'([X|S], X, S).</tt></p><ul class="lpdoc-itemize-minus"><li><em>The following properties hold globally:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="87" href="basic_props.html#sideff/2"><tt>basic_props:sideff/2</tt></a>)</span><span><span class="lpdoc-var">C(S1,Terminal,S2)</span> is side-effect <span class="lpdoc-var">free</span>.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="88" href="basic_props.html#native/1"><tt>basic_props:native/1</tt></a>)</span><span>This predicate is understood natively by CiaoPP.
</span>
</ul>
<strong>Other properties:</strong> <br/><span class="lpdoc-usage-decl"><tt>C(S1,Terminal,S2)</tt>
</span><p></p><ul class="lpdoc-itemize-minus"><li><em>If the following properties hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="89" href="#non_empty_list/1"><tt>term_basic:non_empty_list/1</tt></a>)</span><span>A list that is not the empty list [].
</span>
<br/><em>then the following properties hold upon exit:</em>
<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">S2</span> is a list.
</span>
</ul><p></p><ul class="lpdoc-itemize-minus"><li><em>If the following properties 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">Arg1</span> is currently a term which is not a free variable.
</span>
<br/><em>then the following properties hold globally:</em>
<br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="92" href="basic_props.html#eval/1"><tt>basic_props:eval/1</tt></a>)</span><span><span class="lpdoc-var">C(Arg1,Arg2,Arg3)</span> is evaluable at compile-time.
</span>
</ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">REGTYPE</span><a class="lpdoc-idx-anchor" id="list_functor/1" href="ciaosearch.html#list_functor/1">list_functor/1</a></div><div class="lpdoc-deftext">A regular type, defined as follows:<pre class="lpdoc-codeblock">list_functor([A|B]) :-
term(A),
term(B).
</pre> </div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">REGTYPE</span><a class="lpdoc-idx-anchor" id="non_empty_list/1" href="ciaosearch.html#non_empty_list/1">non_empty_list/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>non_empty_list(A)</tt>
</span><p>A list that is not the empty list [].</p><ul class="lpdoc-itemize-minus"></ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="cyclic_term/1" href="ciaosearch.html#cyclic_term/1">cyclic_term/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>cyclic_term(T)</tt>
</span><p>True if <span class="lpdoc-var">T</span> is cyclic (infinite).</p><ul class="lpdoc-itemize-minus"></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="93" href="ciaosearch.html#native_props"><tt>native_props</tt></a>.
<li><em>Packages:</em><br/><a class="lpdoc-idx-anchor" id="94" href="ciaosearch.html#prelude"><tt>prelude</tt></a>, <a class="lpdoc-idx-anchor" id="95" href="ciaosearch.html#initial"><tt>initial</tt></a>, <a class="lpdoc-idx-anchor" id="96" href="condcomp_doc.html"><tt>condcomp</tt></a>, <a class="lpdoc-idx-anchor" id="97" href="assertions_doc.html"><tt>assertions</tt></a>, <a class="lpdoc-idx-anchor" id="98" href="ciaosearch.html#assertions/assertions_basic"><tt>assertions/assertions_basic</tt></a>, <a class="lpdoc-idx-anchor" id="99" href="ciaosearch.html#nativeprops"><tt>nativeprops</tt></a>, <a class="lpdoc-idx-anchor" id="100" href="isomodes_doc.html"><tt>isomodes</tt></a>, <a class="lpdoc-idx-anchor" id="101" href="ciaosearch.html#nortchecks"><tt>nortchecks</tt></a>.
</ul></div></div><div class="lpdoc-footer">Generated with LPdoc using Ciao</div></div><div class="lpdoc-clearer"></div></div></body></html>