@ciao-lang/ts-ciao-interface
Version:
Simple Ciao interface for node.
203 lines (200 loc) • 51.7 kB
HTML
<!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>Arithmetic — 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="atomic_basic.html">←</a><a class="lpdoc-navbutton" href="AssrtLang.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>Arithmetic</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 multifiles">Documentation on multifiles</a></li><li><a href="#Documentation on imports">Documentation on imports</a></li></ul></div><div class="lpdoc-main"><div id=""><h1>Arithmetic</h1><a class="lpdoc-idx-anchor" href="ciaosearch.html#arithmetic"></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>
Arithmetic is performed by built-in predicates which take as arguments arithmetic expressions (see <a class="lpdoc-idx-anchor" id="0" href="#arithexpression/1"><tt>arithexpression/1</tt></a>) and evaluate them. Terms representing arithmetic expressions can be created dynamically, but at the time of evaluation, each variable in an arithmetic expression must be bound to a non-variable expression (the term must be ground). For example, given the code in the first line a possible shell interaction follows: <pre class="lpdoc-codeblock">evaluate(Expression, Answer) :- Answer is Expression.
?- _X=24*9, evaluate(_X+6, Ans).
Ans = 222 ?
yes
</pre> <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="1" href="noprelude_doc.html"><tt>noprelude</tt></a> or <a class="lpdoc-idx-anchor" id="2" 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="3" href="#is/2"><tt>is/2</tt></a>, <a class="lpdoc-idx-anchor" id="4" href="#</2"><tt></2</tt></a>, <a class="lpdoc-idx-anchor" id="5" href="#=</2"><tt>=</2</tt></a>, <a class="lpdoc-idx-anchor" id="6" href="#>/2"><tt>>/2</tt></a>, <a class="lpdoc-idx-anchor" id="7" href="#>=/2"><tt>>=/2</tt></a>, <a class="lpdoc-idx-anchor" id="8" href="#=:=/2"><tt>=:=/2</tt></a>, <a class="lpdoc-idx-anchor" id="9" href="#=\=/2"><tt>=\=/2</tt></a>.
<li><em>Regular Types:</em><br/><a class="lpdoc-idx-anchor" id="10" href="#arithexpression/1"><tt>arithexpression/1</tt></a>, <a class="lpdoc-idx-anchor" id="11" href="#intexpression/1"><tt>intexpression/1</tt></a>.
<li><em>Multifiles:</em><br/><a class="lpdoc-idx-anchor" id="12" href="#$internal_error_where_term/4"><tt>$internal_error_where_term/4</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="is/2" href="ciaosearch.html#is/2">is/2</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><span class="lpdoc-on-right"><span class="lpdoc-iso">ISO</span></span><span><tt>Val is Exp</tt></span>
</span><p>The arithmetic expression <span class="lpdoc-var">Exp</span> is evaluated and the result is unified with <span class="lpdoc-var">Val</span><p><span class="lpdoc-usage-header">Usage 1:</span><span class="lpdoc-usage-decl"><tt>A is B</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="13" 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><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="14" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">B</span> is currently a term which is not a free variable.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="15" 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><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="16" href="#arithexpression/1"><tt>arithmetic:arithexpression/1</tt></a>)</span><span><span class="lpdoc-var">B</span> is an arithmetic expression.
</span>
<li><em>The following properties hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="17" href="basic_props.html#num/1"><tt>basic_props:num/1</tt></a>)</span><span><span class="lpdoc-var">A</span> is a number.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="18" href="#arithexpression/1"><tt>arithmetic:arithexpression/1</tt></a>)</span><span><span class="lpdoc-var">B</span> is an arithmetic expression.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="19" href="native_props_cost_doc.html#size/2"><tt>native_props:size/2</tt></a>)</span><span><span class="lpdoc-var">int(B)</span> is the size of argument <span class="lpdoc-var">A</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="20" 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">A is B</span> do not fail.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="21" href="basic_props.html#eval/1"><tt>basic_props:eval/1</tt></a>)</span><span><span class="lpdoc-var">A is B</span> is evaluable at compile-time.
</span>
</ul><p><span class="lpdoc-usage-header">Usage 2:</span><span class="lpdoc-usage-decl"><tt>A is B</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="22" 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><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="23" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">B</span> is currently a term which is not a free variable.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="24" 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><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="25" href="#intexpression/1"><tt>arithmetic:intexpression/1</tt></a>)</span><span><span class="lpdoc-var">B</span> is an integer expression.
</span>
<li><em>The following properties hold upon exit:</em><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">A</span> is an integer.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="27" href="#intexpression/1"><tt>arithmetic:intexpression/1</tt></a>)</span><span><span class="lpdoc-var">B</span> is an integer expression.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="28" href="native_props_cost_doc.html#size/2"><tt>native_props:size/2</tt></a>)</span><span><span class="lpdoc-var">int(B)</span> is the size of argument <span class="lpdoc-var">A</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="29" 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">A is B</span> do not fail.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="30" href="basic_props.html#eval/1"><tt>basic_props:eval/1</tt></a>)</span><span><span class="lpdoc-var">A is B</span> is evaluable at compile-time.
</span>
</ul><p><span class="lpdoc-usage-header">Usage 3:</span><span class="lpdoc-usage-decl"><tt>A is B</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="31" 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><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="32" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">B</span> is currently a term which is not a free variable.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="33" href="basic_props.html#num/1"><tt>basic_props:num/1</tt></a>)</span><span><span class="lpdoc-var">A</span> is a number.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="34" href="#arithexpression/1"><tt>arithmetic:arithexpression/1</tt></a>)</span><span><span class="lpdoc-var">B</span> is an arithmetic expression.
</span>
<li><em>The following properties hold globally:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="35" 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><p><span class="lpdoc-usage-header">Usage 4:</span><span class="lpdoc-usage-decl"><tt>A is B</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="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><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="37" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">B</span> is currently a term which is not a free variable.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="38" href="basic_props.html#int/1"><tt>basic_props:int/1</tt></a>)</span><span><span class="lpdoc-var">A</span> is an integer.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="39" href="#intexpression/1"><tt>arithmetic:intexpression/1</tt></a>)</span><span><span class="lpdoc-var">B</span> is an integer expression.
</span>
<li><em>The following properties hold globally:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="40" 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>
<strong>Other properties:</strong> <br/><span class="lpdoc-usage-decl"><tt>A is B</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="41" href="native_props_cost_doc.html#size_metric/3"><tt>native_props:size_metric/3</tt></a>)</span><span><span class="lpdoc-var">int</span> is the measure used to determine the size of the terms that <span class="lpdoc-var">A</span> is bound to, for any type of approximation.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="42" href="native_props_cost_doc.html#size_metric/3"><tt>native_props:size_metric/3</tt></a>)</span><span><span class="lpdoc-var">int</span> is the measure used to determine the size of the terms that <span class="lpdoc-var">B</span> is bound to, for any type of approximation.
</span>
</ul><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="43" 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="44" href="basic_props.html#sideff/2"><tt>basic_props:sideff/2</tt></a>)</span><span><span class="lpdoc-var">Val is Exp</span> is side-effect <span class="lpdoc-var">free</span>.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="45" href="basic_props.html#bind_ins/1"><tt>basic_props:bind_ins/1</tt></a>)</span><span><span class="lpdoc-var">Val is Exp</span> is binding insensitive.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="46" 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">Val is Exp</span> are deterministic.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="47" href="native_props_cardinality_doc.html#relations/2"><tt>native_props:relations/2</tt></a>)</span><span>Goal <span class="lpdoc-var">Val is Exp</span> produces <span class="lpdoc-var">inf</span> solutions.
</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"><span class="lpdoc-usage-decl"><span class="lpdoc-on-right"><span class="lpdoc-iso">ISO</span></span><span><tt>Exp1<Exp2</tt></span>
</span><p>The numeric value of <span class="lpdoc-var">Exp1</span> is less than the numeric value of <span class="lpdoc-var">Exp2</span> when both are evaluated as arithmetic expressions.<p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>A<B</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="48" 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><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">B</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="#arithexpression/1"><tt>arithmetic:arithexpression/1</tt></a>)</span><span><span class="lpdoc-var">A</span> is an arithmetic expression.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="51" href="#arithexpression/1"><tt>arithmetic:arithexpression/1</tt></a>)</span><span><span class="lpdoc-var">B</span> is an arithmetic expression.
</span>
<li><em>The following properties hold globally:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="52" href="basic_props.html#eval/1"><tt>basic_props:eval/1</tt></a>)</span><span><span class="lpdoc-var">A<B</span> is evaluable at compile-time.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="53" href="native_props_cost_doc.html#size_metric/3"><tt>native_props:size_metric/3</tt></a>)</span><span><span class="lpdoc-var">int</span> is the measure used to determine the size of the terms that <span class="lpdoc-var">A</span> is bound to, for any type of approximation.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="54" href="native_props_cost_doc.html#size_metric/3"><tt>native_props:size_metric/3</tt></a>)</span><span><span class="lpdoc-var">int</span> is the measure used to determine the size of the terms that <span class="lpdoc-var">B</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="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#sideff/2"><tt>basic_props:sideff/2</tt></a>)</span><span><span class="lpdoc-var">Exp1<Exp2</span> is side-effect <span class="lpdoc-var">free</span>.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="57" href="basic_props.html#bind_ins/1"><tt>basic_props:bind_ins/1</tt></a>)</span><span><span class="lpdoc-var">Exp1<Exp2</span> is binding insensitive.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="58" 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">Exp1<Exp2</span> are deterministic.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="59" href="native_props_cardinality_doc.html#relations/2"><tt>native_props:relations/2</tt></a>)</span><span>Goal <span class="lpdoc-var">Exp1<Exp2</span> produces <span class="lpdoc-var">inf</span> solutions.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="60" 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"><span class="lpdoc-usage-decl"><span class="lpdoc-on-right"><span class="lpdoc-iso">ISO</span></span><span><tt>Exp1=<Exp2</tt></span>
</span><p>The numeric value of <span class="lpdoc-var">Exp1</span> is less than or equal to the numeric value of <span class="lpdoc-var">Exp2</span> when both are evaluated as arithmetic expressions.<p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>A=<B</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="61" 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><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">B</span> is currently a term which is not a free variable.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="63" href="#arithexpression/1"><tt>arithmetic:arithexpression/1</tt></a>)</span><span><span class="lpdoc-var">A</span> is an arithmetic expression.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="64" href="#arithexpression/1"><tt>arithmetic:arithexpression/1</tt></a>)</span><span><span class="lpdoc-var">B</span> is an arithmetic expression.
</span>
<li><em>The following properties hold globally:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="65" href="basic_props.html#eval/1"><tt>basic_props:eval/1</tt></a>)</span><span><span class="lpdoc-var">A=<B</span> is evaluable at compile-time.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="66" href="native_props_cost_doc.html#size_metric/3"><tt>native_props:size_metric/3</tt></a>)</span><span><span class="lpdoc-var">int</span> is the measure used to determine the size of the terms that <span class="lpdoc-var">A</span> is bound to, for any type of approximation.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="67" href="native_props_cost_doc.html#size_metric/3"><tt>native_props:size_metric/3</tt></a>)</span><span><span class="lpdoc-var">int</span> is the measure used to determine the size of the terms that <span class="lpdoc-var">B</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="68" 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="69" href="basic_props.html#sideff/2"><tt>basic_props:sideff/2</tt></a>)</span><span><span class="lpdoc-var">Exp1=<Exp2</span> is side-effect <span class="lpdoc-var">free</span>.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="70" href="basic_props.html#bind_ins/1"><tt>basic_props:bind_ins/1</tt></a>)</span><span><span class="lpdoc-var">Exp1=<Exp2</span> is binding insensitive.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="71" 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">Exp1=<Exp2</span> are deterministic.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="72" href="native_props_cardinality_doc.html#relations/2"><tt>native_props:relations/2</tt></a>)</span><span>Goal <span class="lpdoc-var">Exp1=<Exp2</span> produces <span class="lpdoc-var">inf</span> solutions.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="73" 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"><span class="lpdoc-usage-decl"><span class="lpdoc-on-right"><span class="lpdoc-iso">ISO</span></span><span><tt>Exp1>Exp2</tt></span>
</span><p>The numeric value of <span class="lpdoc-var">Exp1</span> is greater than the numeric value of <span class="lpdoc-var">Exp2</span> when both are evaluated as arithmetic expressions.<p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>A>B</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="74" 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><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">B</span> is currently a term which is not a free variable.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="76" href="#arithexpression/1"><tt>arithmetic:arithexpression/1</tt></a>)</span><span><span class="lpdoc-var">A</span> is an arithmetic expression.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="77" href="#arithexpression/1"><tt>arithmetic:arithexpression/1</tt></a>)</span><span><span class="lpdoc-var">B</span> is an arithmetic expression.
</span>
<li><em>The following properties hold globally:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="78" href="basic_props.html#eval/1"><tt>basic_props:eval/1</tt></a>)</span><span><span class="lpdoc-var">A>B</span> is evaluable at compile-time.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="79" href="native_props_cost_doc.html#size_metric/3"><tt>native_props:size_metric/3</tt></a>)</span><span><span class="lpdoc-var">int</span> is the measure used to determine the size of the terms that <span class="lpdoc-var">A</span> is bound to, for any type of approximation.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="80" href="native_props_cost_doc.html#size_metric/3"><tt>native_props:size_metric/3</tt></a>)</span><span><span class="lpdoc-var">int</span> is the measure used to determine the size of the terms that <span class="lpdoc-var">B</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="81" 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="82" href="basic_props.html#sideff/2"><tt>basic_props:sideff/2</tt></a>)</span><span><span class="lpdoc-var">Exp1>Exp2</span> is side-effect <span class="lpdoc-var">free</span>.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="83" href="basic_props.html#bind_ins/1"><tt>basic_props:bind_ins/1</tt></a>)</span><span><span class="lpdoc-var">Exp1>Exp2</span> is binding insensitive.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="84" 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">Exp1>Exp2</span> are deterministic.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="85" href="native_props_cardinality_doc.html#relations/2"><tt>native_props:relations/2</tt></a>)</span><span>Goal <span class="lpdoc-var">Exp1>Exp2</span> produces <span class="lpdoc-var">inf</span> solutions.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="86" 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"><span class="lpdoc-usage-decl"><span class="lpdoc-on-right"><span class="lpdoc-iso">ISO</span></span><span><tt>Exp1>=Exp2</tt></span>
</span><p>The numeric value of <span class="lpdoc-var">Exp1</span> is greater than or equal to the numeric value of <span class="lpdoc-var">Exp2</span> when both are evaluated as arithmetic expressions.<p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>A>=B</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="87" 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><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="88" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">B</span> is currently a term which is not a free variable.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="89" href="#arithexpression/1"><tt>arithmetic:arithexpression/1</tt></a>)</span><span><span class="lpdoc-var">A</span> is an arithmetic expression.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="90" href="#arithexpression/1"><tt>arithmetic:arithexpression/1</tt></a>)</span><span><span class="lpdoc-var">B</span> is an arithmetic expression.
</span>
<li><em>The following properties hold globally:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="91" href="basic_props.html#eval/1"><tt>basic_props:eval/1</tt></a>)</span><span><span class="lpdoc-var">A>=B</span> is evaluable at compile-time.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="92" href="native_props_cost_doc.html#size_metric/3"><tt>native_props:size_metric/3</tt></a>)</span><span><span class="lpdoc-var">int</span> is the measure used to determine the size of the terms that <span class="lpdoc-var">A</span> is bound to, for any type of approximation.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="93" href="native_props_cost_doc.html#size_metric/3"><tt>native_props:size_metric/3</tt></a>)</span><span><span class="lpdoc-var">int</span> is the measure used to determine the size of the terms that <span class="lpdoc-var">B</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="94" 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="95" href="basic_props.html#sideff/2"><tt>basic_props:sideff/2</tt></a>)</span><span><span class="lpdoc-var">Exp1>=Exp2</span> is side-effect <span class="lpdoc-var">free</span>.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="96" href="basic_props.html#bind_ins/1"><tt>basic_props:bind_ins/1</tt></a>)</span><span><span class="lpdoc-var">Exp1>=Exp2</span> is binding insensitive.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="97" 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">Exp1>=Exp2</span> are deterministic.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="98" href="native_props_cardinality_doc.html#relations/2"><tt>native_props:relations/2</tt></a>)</span><span>Goal <span class="lpdoc-var">Exp1>=Exp2</span> produces <span class="lpdoc-var">inf</span> solutions.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="99" 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"><span class="lpdoc-usage-decl"><span class="lpdoc-on-right"><span class="lpdoc-iso">ISO</span></span><span><tt>Exp1=:=Exp2</tt></span>
</span><p>The numeric values of <span class="lpdoc-var">Exp1</span> and <span class="lpdoc-var">Exp2</span> are equal when both are evaluated as arithmetic expressions.<p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>A=:=B</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="100" 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><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="101" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">B</span> is currently a term which is not a free variable.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="102" href="#arithexpression/1"><tt>arithmetic:arithexpression/1</tt></a>)</span><span><span class="lpdoc-var">A</span> is an arithmetic expression.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="103" href="#arithexpression/1"><tt>arithmetic:arithexpression/1</tt></a>)</span><span><span class="lpdoc-var">B</span> is an arithmetic expression.
</span>
<li><em>The following properties hold globally:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="104" href="basic_props.html#eval/1"><tt>basic_props:eval/1</tt></a>)</span><span><span class="lpdoc-var">A=:=B</span> is evaluable at compile-time.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="105" href="native_props_cost_doc.html#size_metric/3"><tt>native_props:size_metric/3</tt></a>)</span><span><span class="lpdoc-var">int</span> is the measure used to determine the size of the terms that <span class="lpdoc-var">A</span> is bound to, for any type of approximation.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="106" href="native_props_cost_doc.html#size_metric/3"><tt>native_props:size_metric/3</tt></a>)</span><span><span class="lpdoc-var">int</span> is the measure used to determine the size of the terms that <span class="lpdoc-var">B</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="107" 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="108" href="basic_props.html#sideff/2"><tt>basic_props:sideff/2</tt></a>)</span><span><span class="lpdoc-var">Exp1=:=Exp2</span> is side-effect <span class="lpdoc-var">free</span>.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="109" href="basic_props.html#bind_ins/1"><tt>basic_props:bind_ins/1</tt></a>)</span><span><span class="lpdoc-var">Exp1=:=Exp2</span> is binding insensitive.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="110" 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">Exp1=:=Exp2</span> are deterministic.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="111" href="native_props_cardinality_doc.html#relations/2"><tt>native_props:relations/2</tt></a>)</span><span>Goal <span class="lpdoc-var">Exp1=:=Exp2</span> produces <span class="lpdoc-var">inf</span> solutions.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="112" 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"><span class="lpdoc-usage-decl"><span class="lpdoc-on-right"><span class="lpdoc-iso">ISO</span></span><span><tt>Exp1=\=Exp2</tt></span>
</span><p>The numeric values of <span class="lpdoc-var">Exp1</span> and <span class="lpdoc-var">Exp2</span> are not equal when both are evaluated as arithmetic expressions.<p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>A=\=B</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="113" 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><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="114" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">B</span> is currently a term which is not a free variable.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="115" href="#arithexpression/1"><tt>arithmetic:arithexpression/1</tt></a>)</span><span><span class="lpdoc-var">A</span> is an arithmetic expression.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="116" href="#arithexpression/1"><tt>arithmetic:arithexpression/1</tt></a>)</span><span><span class="lpdoc-var">B</span> is an arithmetic expression.
</span>
<li><em>The following properties hold globally:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="117" href="basic_props.html#eval/1"><tt>basic_props:eval/1</tt></a>)</span><span><span class="lpdoc-var">A=\=B</span> is evaluable at compile-time.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="118" href="native_props_cost_doc.html#size_metric/3"><tt>native_props:size_metric/3</tt></a>)</span><span><span class="lpdoc-var">int</span> is the measure used to determine the size of the terms that <span class="lpdoc-var">A</span> is bound to, for any type of approximation.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="119" href="native_props_cost_doc.html#size_metric/3"><tt>native_props:size_metric/3</tt></a>)</span><span><span class="lpdoc-var">int</span> is the measure used to determine the size of the terms that <span class="lpdoc-var">B</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="120" 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="121" href="basic_props.html#sideff/2"><tt>basic_props:sideff/2</tt></a>)</span><span><span class="lpdoc-var">Exp1=\=Exp2</span> is side-effect <span class="lpdoc-var">free</span>.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="122" href="basic_props.html#bind_ins/1"><tt>basic_props:bind_ins/1</tt></a>)</span><span><span class="lpdoc-var">Exp1=\=Exp2</span> is binding insensitive.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="123" 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">Exp1=\=Exp2</span> are deterministic.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="124" href="native_props_cardinality_doc.html#relations/2"><tt>native_props:relations/2</tt></a>)</span><span>Goal <span class="lpdoc-var">Exp1=\=Exp2</span> produces <span class="lpdoc-var">inf</span> solutions.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="125" 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">REGTYPE</span><a class="lpdoc-idx-anchor" id="arithexpression/1" href="ciaosearch.html#arithexpression/1">arithexpression/1</a></div><div class="lpdoc-deftext">An arithmetic expression is a term built from numbers and <a class="lpdoc-idx-anchor" id="126" href="ciaosearch.html#evaluable functors">evaluable functors</a> that represent arithmetic functions. An arithmetic expression evaluates to a number, which may be an integer (<a class="lpdoc-idx-anchor" id="127" href="basic_props.html#int/1"><tt>int/1</tt></a>) or a float (<a class="lpdoc-idx-anchor" id="128" href="basic_props.html#flt/1"><tt>flt/1</tt></a>). The evaluable functors allowed in an arithmetic expression are listed below, together with an indication of the functions they represent. All evaluable functors defined in <a class="lpdoc-idx-anchor" id="129" href="ciaosearch.html#ISO-Prolog">ISO-Prolog</a> are implemented, as well as some other useful or traditional. Unless stated otherwise, an expression evaluates to a float if any of its arguments is a float, otherwise to an integer.<p><ul> <p><li><a class="lpdoc-idx-anchor" id="130" href="ciaosearch.html#- /1"><tt>- /1</tt></a>: sign reversal. <span class="lpdoc-iso">ISO</span> <li><a class="lpdoc-idx-anchor" id="131" href="ciaosearch.html#+ /1"><tt>+ /1</tt></a>: identity.<p><li><a class="lpdoc-idx-anchor" id="132" href="ciaosearch.html#-- /1"><tt>-- /1</tt></a>: decrement by one.<p><li><a class="lpdoc-idx-anchor" id="133" href="ciaosearch.html#++ /1"><tt>++ /1</tt></a>: increment by one.<p><li><a class="lpdoc-idx-anchor" id="134" href="ciaosearch.html#+ /2"><tt>+ /2</tt></a>: addition. <span class="lpdoc-iso">ISO</span> <li><a class="lpdoc-idx-anchor" id="135" href="ciaosearch.html#- /2"><tt>- /2</tt></a>: subtraction. <span class="lpdoc-iso">ISO</span> <li><a class="lpdoc-idx-anchor" id="136" href="ciaosearch.html#* /2"><tt>* /2</tt></a>: multiplication. <span class="lpdoc-iso">ISO</span> <li><a class="lpdoc-idx-anchor" id="137" href="ciaosearch.html#// /2"><tt>// /2</tt></a>: integer division. Float arguments are truncated to integers, result always integer. <span class="lpdoc-iso">ISO</span> <li><a class="lpdoc-idx-anchor" id="138" href="ciaosearch.html#/ /2"><tt>/ /2</tt></a>: division. Result always float. <span class="lpdoc-iso">ISO</span> <li><a class="lpdoc-idx-anchor" id="139" href="ciaosearch.html#rem/2"><tt>rem/2</tt></a>: integer remainder. The result is always an integer, its sign is the sign of the first argument. <span class="lpdoc-iso">ISO</span> <li><a class="lpdoc-idx-anchor" id="140" href="ciaosearch.html#mod/2"><tt>mod/2</tt></a>: modulo. The result is always a positive integer. <span class="lpdoc-iso">ISO</span> <li><a class="lpdoc-idx-anchor" id="141" href="ciaosearch.html#abs/1"><tt>abs/1</tt></a>: absolute value. <span class="lpdoc-iso">ISO</span> <li><a class="lpdoc-idx-anchor" id="142" href="ciaosearch.html#sign/1"><tt>sign/1</tt></a>: sign of. <span class="lpdoc-iso">ISO</span> <li><a class="lpdoc-idx-anchor" id="143" href="ciaosearch.html#float_integer_part/1"><tt>float_integer_part/1</tt></a>: float integer part. Result always float. <span class="lpdoc-iso">ISO</span> <li><a class="lpdoc-idx-anchor" id="144" href="ciaosearch.html#float_fractional_part/1"><tt>float_fractional_part/1</tt></a>: float fractional part. Result always float. <span class="lpdoc-iso">ISO</span> <li><a class="lpdoc-idx-anchor" id="145" href="ciaosearch.html#truncate/1"><tt>truncate/1</tt></a>: The result is the integer equal to the integer part of the argument. <span class="lpdoc-iso">ISO</span> <li><a class="lpdoc-idx-anchor" id="146" href="term_typing.html#integer/1"><tt>integer/1</tt></a>: same as <a class="lpdoc-idx-anchor" id="147" href="ciaosearch.html#truncate/1"><tt>truncate/1</tt></a>.<p><li><a class="lpdoc-idx-anchor" id="148" href="term_typing.html#float/1"><tt>float/1</tt></a>: conversion to float. <span class="lpdoc-iso">ISO</span> <li><a class="lpdoc-idx-anchor" id="149" href="ciaosearch.html#floor/1"><tt>floor/1</tt></a>: largest integer not greater than. <span class="lpdoc-iso">ISO</span> <li><a class="lpdoc-idx-anchor" id="150" href="ciaosearch.html#round/1"><tt>round/1</tt></a>: integer nearest to. <span class="lpdoc-iso">ISO</span> <li><a class="lpdoc-idx-anchor" id="151" href="ciaosearch.html#ceiling/1"><tt>ceiling/1</tt></a>: smallest integer not smaller than. <span class="lpdoc-iso">ISO</span> <li><a class="lpdoc-idx-anchor" id="152" href="ciaosearch.html#** /2"><tt>** /2</tt></a>: exponentiation. Result always float. <span class="lpdoc-iso">ISO</span> <li><a class="lpdoc-idx-anchor" id="153" href="ciaosearch.html#>> /2"><tt>>> /2</tt></a>: integer bitwise right shift. <span class="lpdoc-iso">ISO</span> <li><a class="lpdoc-idx-anchor" id="154" href="ciaosearch.html#<< /2"><tt><< /2</tt></a>: integer bitwise left shift. <span class="lpdoc-iso">ISO</span> <li><a class="lpdoc-idx-anchor" id="155" href="ciaosearch.html#/\ /2"><tt>/\ /2</tt></a>: integer bitwise and. <span class="lpdoc-iso">ISO</span> <li><a class="lpdoc-idx-anchor" id="156" href="ciaosearch.html#\/ /2"><tt>\/ /2</tt></a>: integer bitwise or. <span class="lpdoc-iso">ISO</span> <li><a class="lpdoc-idx-anchor" id="157" href="ciaosearch.html#\ /1"><tt>\ /1</tt></a>: integer bitwise complement. <span class="lpdoc-iso">ISO</span> <li><a class="lpdoc-idx-anchor" id="158" href="ciaosearch.html## /2"><tt># /2</tt></a>: integer bitwise exclusive or (xor).<p><li><a class="lpdoc-idx-anchor" id="159" href="ciaosearch.html#exp/1"><tt>exp/1</tt></a>: exponential (<em>e</em> to the power of). Result always float. <span class="lpdoc-iso">ISO</span> <li><a class="lpdoc-idx-anchor" id="160" href="ciaosearch.html#log/1"><tt>log/1</tt></a>: natural logarithm (base <em>e</em>). Result always float. <span class="lpdoc-iso">ISO</span> <li><a class="lpdoc-idx-anchor" id="161" href="ciaosearch.html#sqrt/1"><tt>sqrt/1</tt></a>: square root. Result always float. <span class="lpdoc-iso">ISO</span> <li><a class="lpdoc-idx-anchor" id="162" href="ciaosearch.html#sin/1"><tt>sin/1</tt></a>: sine. Result always float. <span class="lpdoc-iso">ISO</span> <li><a class="lpdoc-idx-anchor" id="163" href="ciaosearch.html#cos/1"><tt>cos/1</tt></a>: cosine. Result always float. <span class="lpdoc-iso">ISO</span> <li><a class="lpdoc-idx-anchor" id="164" href="ciaosearch.html#atan/1"><tt>atan/1</tt></a>: arc tangent. Result always float. <span class="lpdoc-iso">ISO</span> <p><li><a class="lpdoc-idx-anchor" id="165" href="ciaosearch.html#gcd/2"><tt>gcd/2</tt></a>: Greatest common divisor. Arguments must evaluate to integers, result always integer.<p></ul> <p>In addition to these functors, a list of just a number evaluates to this number. Since a <a class="lpdoc-idx-anchor" id="166" href="ciaosearch.html#quoted string">quoted string</a> is just a list of integers, this allows a quoted character to be used in place of its <a class="lpdoc-idx-anchor" id="167" href="ciaosearch.html#ASCII code">ASCII code</a>; e.g. <tt>"A"</tt> behaves within arithmetic expressions as the integer 65. Note that this is not <a class="lpdoc-idx-anchor" id="168" href="ciaosearch.html#ISO-Prolog"></a>ISO-compliant, and that can be achieved by using the ISO notation <tt>0'A</tt>.<p>Arithmetic expressions, as described above, are just data structures. If you want one evaluated you must pass it as an argument to one of the arithmetic predicates defined in this library. <p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>arithexpression(E)</tt>
</span><p><span class="lpdoc-var">E</span> is an arithmetic expression.</p><ul class="lpdoc-itemize-minus"></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="169" href="basic_props.html#sideff/2"><tt>basic_props:sideff/2</tt></a>)</span><span><span class="lpdoc-var">arithexpression(Arg1)</span> is side-effect <span class="lpdoc-var">free</span>.
</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="170" 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="171" 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">arithexpression(Arg1)</span> are deterministic.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="172" 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">REGTYPE</span><a class="lpdoc-idx-anchor" id="intexpression/1" href="ciaosearch.html#intexpression/1">intexpression/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>intexpression(E)</tt>
</span><p><span class="lpdoc-var">E</span> is an integer expression.</p><ul class="lpdoc-itemize-minus"></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="173" href="basic_props.html#sideff/2"><tt>basic_props:sideff/2</tt></a>)</span><span><span class="lpdoc-var">intexpression(Arg1)</span> is side-effect <span class="lpdoc-var">free</span>.
</span>
</ul></div></