UNPKG

@ciao-lang/ts-ciao-interface

Version:

Simple Ciao interface for node.

69 lines 33.6 kB
<!DOCTYPE HTML><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><meta name="theme-color" content="#273f79"/><link rel="stylesheet" href="lpdoc.css" type="text/css"/><script type="text/javascript" src="lpdoc.js"></script><title>Types and properties related to assertions &mdash; The lpdoc Documentation Generator v3.5</title></head><body><div class="lpdoc-page fixleftbar"><a href="#" id="sidebar-toggle-button" class="lpdoc-navbutton"><span id="sidebar-button-arrow">&#9776;</span></a><div id="sidebar" class="lpdoc-sidebar"><div style="height: 40px; margin-left: auto; margin-right: auto"><img src="lpdoc-logo-128_autofig.png" width=auto height=100%></div><div class="lpdoc-nav"><span class="lpdoc-on-right"><a class="lpdoc-navbutton" href="assertions_doc.html">&#x2191;</a><a class="lpdoc-navbutton" href="assertions_doc.html">&#x2190;</a><a class="lpdoc-navbutton" href="regtypes_doc.html">&#x2192;</a><a class="lpdoc-navbutton" href="lpdoc_ref_mansearch.html">&#x1F50D;</a></span><span><a href="lpdoc_ref_manfulltoc.html">TOC</a></span></div><hr></hr><ul class="lpdoc-itemize-sectpath"><li><a href="lpdoc_ref_man.html">The lpdoc Documentation Generator</a> &raquo;<br/> </li><li><a href="assertions_doc.html">The Ciao assertion language</a> &raquo;<br/> </li><li><a href=""><strong>Types and properties related to assertions</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>Types and properties related to assertions</h1><a class="lpdoc-idx-anchor" href="lpdoc_ref_mansearch.html#assertions_props"></a> <strong>Author(s):</strong> <a class="lpdoc-idx-anchor" id="Manuel Hermenegildo" href="lpdoc_ref_mansearch.html#Manuel Hermenegildo">Manuel Hermenegildo</a>.<p> This module is part of the <a class="lpdoc-idx-anchor" id="0" href="assertions_doc.html"><tt>assertions</tt></a> library. It provides the formal definition of the syntax of several forms of assertions and describes their meaning. It does so by defining types and properties related to the assertions themselves. The text describes, for example, the overall fields which are admissible in the bodies of assertions, where properties can be used inside these bodies, how to combine properties for a given predicate argument (e.g., conjunctions) , etc. and provides some examples.<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(assertions/assertions_props)).</tt><li><strong>Exports:</strong><br/><ul class="lpdoc-itemize-minus"><li><em>Properties:</em><br/><a class="lpdoc-idx-anchor" id="1" href="#head_pattern/1"><tt>head_pattern/1</tt></a>, <a class="lpdoc-idx-anchor" id="2" href="#nabody/1"><tt>nabody/1</tt></a>, <a class="lpdoc-idx-anchor" id="3" href="comments.html#docstring/1"><tt>docstring/1</tt></a>. <li><em>Regular Types:</em><br/><a class="lpdoc-idx-anchor" id="4" href="#assrt_body/1"><tt>assrt_body/1</tt></a>, <a class="lpdoc-idx-anchor" id="5" href="#complex_arg_property/1"><tt>complex_arg_property/1</tt></a>, <a class="lpdoc-idx-anchor" id="6" href="#property_conjunction/1"><tt>property_conjunction/1</tt></a>, <a class="lpdoc-idx-anchor" id="7" href="#property_starterm/1"><tt>property_starterm/1</tt></a>, <a class="lpdoc-idx-anchor" id="8" href="#complex_goal_property/1"><tt>complex_goal_property/1</tt></a>, <a class="lpdoc-idx-anchor" id="9" href="#dictionary/1"><tt>dictionary/1</tt></a>, <a class="lpdoc-idx-anchor" id="10" href="#c_assrt_body/1"><tt>c_assrt_body/1</tt></a>, <a class="lpdoc-idx-anchor" id="11" href="#s_assrt_body/1"><tt>s_assrt_body/1</tt></a>, <a class="lpdoc-idx-anchor" id="12" href="#g_assrt_body/1"><tt>g_assrt_body/1</tt></a>, <a class="lpdoc-idx-anchor" id="13" href="#assrt_status/1"><tt>assrt_status/1</tt></a>, <a class="lpdoc-idx-anchor" id="14" href="#assrt_type/1"><tt>assrt_type/1</tt></a>, <a class="lpdoc-idx-anchor" id="15" href="#predfunctor/1"><tt>predfunctor/1</tt></a>, <a class="lpdoc-idx-anchor" id="16" href="#propfunctor/1"><tt>propfunctor/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">REGTYPE</span><a class="lpdoc-idx-anchor" id="assrt_body/1" href="lpdoc_ref_mansearch.html#assrt_body/1">assrt_body/1</a></div><div class="lpdoc-deftext"><a class="lpdoc-idx-anchor" id="17" href="lpdoc_ref_mansearch.html#assertion body syntax"></a> This predicate defines the different types of syntax admissible in the bodies of <a class="lpdoc-idx-anchor" id="18" href="assertions_doc.html#pred/1"><tt>pred/1</tt></a>, <a class="lpdoc-idx-anchor" id="19" href="assertions_doc.html#decl/1"><tt>decl/1</tt></a>, etc. assertions. Such a body is of the form:<p><pre class="lpdoc-codeblock"> Pr [:: DP] [: CP] [=&gt; AP] [+ GP] [# CO]</pre> <p>where (fields between [...] are optional):<p><ul> <p><li><span class="lpdoc-var">Pr</span> is a <a class="lpdoc-idx-anchor" id="20" href="lpdoc_ref_mansearch.html#head pattern">head pattern</a> (<a class="lpdoc-idx-anchor" id="21" href="#head_pattern/1"><tt>head_pattern/1</tt></a>) which describes the predicate or property and possibly gives some implicit call/answer information.<p><li><span class="lpdoc-var">DP</span> is a (possibly empty) <a class="lpdoc-idx-anchor" id="22" href="lpdoc_ref_mansearch.html#complex argument property">complex argument property</a> (<a class="lpdoc-idx-anchor" id="23" href="#complex_arg_property/1"><tt>complex_arg_property/1</tt></a>) which expresses properties which are <a class="lpdoc-idx-anchor" id="24" href="lpdoc_ref_mansearch.html#compatible">compatible</a> with the predicate, i.e., instantiations made by the predicate are <em>compatible</em> with the properties in the sense that applying the property at any point would not make it fail.<p><li><span class="lpdoc-var">CP</span> is a (possibly empty) <a class="lpdoc-idx-anchor" id="25" href="lpdoc_ref_mansearch.html#complex argument property">complex argument property</a> (<a class="lpdoc-idx-anchor" id="26" href="#complex_arg_property/1"><tt>complex_arg_property/1</tt></a>) which applies to the <em>calls</em> to the predicate.<p><li><span class="lpdoc-var">AP</span> is a (possibly empty) <a class="lpdoc-idx-anchor" id="27" href="lpdoc_ref_mansearch.html#complex argument property">complex argument property</a> (<a class="lpdoc-idx-anchor" id="28" href="#complex_arg_property/1"><tt>complex_arg_property/1</tt></a>) which applies to the <em>answers</em> to the predicate (if the predicate succeeds). These only apply if the (possibly empty) properties given for calls in the assertion hold.<p><li><span class="lpdoc-var">GP</span> is a (possibly empty) <a class="lpdoc-idx-anchor" id="29" href="lpdoc_ref_mansearch.html#complex goal property">complex goal property</a> (<a class="lpdoc-idx-anchor" id="30" href="#complex_goal_property/1"><tt>complex_goal_property/1</tt></a>) which applies to the <em>whole execution</em> of a call to the predicate. These only apply if the (possibly empty) properties given for calls in the assertion hold.<p><li><span class="lpdoc-var">CO</span> is a <a class="lpdoc-idx-anchor" id="31" href="lpdoc_ref_mansearch.html#comment string">comment string</a> (<a class="lpdoc-idx-anchor" id="32" href="comments.html#docstring/1"><tt>docstring/1</tt></a>). This comment only applies if the (possibly empty) properties given for calls in the assertion hold. The usual formatting commands that are applicable in comment strings can be used (see <a class="lpdoc-idx-anchor" id="33" href="comments.html#stringcommand/1"><tt>stringcommand/1</tt></a>).<p>See the <a class="lpdoc-idx-anchor" id="34" href="lpdoc_ref_mansearch.html#lpdoc"><tt>lpdoc</tt></a> manual for documentation on assertion comments.<p></ul> <p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>assrt_body(X)</tt> </span><p><span class="lpdoc-var">X</span> is an assertion body.</p><ul class="lpdoc-itemize-minus"></ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PROPERTY</span><a class="lpdoc-idx-anchor" id="head_pattern/1" href="lpdoc_ref_mansearch.html#head_pattern/1">head_pattern/1</a></div><div class="lpdoc-deftext">A <a class="lpdoc-idx-anchor" id="35" href="lpdoc_ref_mansearch.html#head pattern">head pattern</a> can be a predicate name (functor/arity) (<a class="lpdoc-idx-anchor" id="36" href="basic_props.html#predname/1"><tt>predname/1</tt></a>) or a term. Thus, both <tt>p/3</tt> and <tt>p(A,B,C)</tt> are valid head patterns. In the case in which the head pattern is a term, each argument of such a term can be:<p><ul> <p><li>A variable. This is useful in order to be able to refer to the corresponding argument positions by name within properties and in comments. Thus, <tt>p(Input,Parameter,Output)</tt> is a valid head pattern.<p><li>A variable, as above, but preceded by a ``<a class="lpdoc-idx-anchor" id="37" href="lpdoc_ref_mansearch.html#mode">mode</a>.&apos;&apos; This mode determines in a compact way certain call or answer properties. For example, the head pattern <tt>p(Input,+Parameter,Output)</tt> is valid, as long as <a class="lpdoc-idx-anchor" id="38" href="lpdoc_ref_mansearch.html#+/1"><tt>+/1</tt></a> is declared as a mode.<p>Some useful mode definitions can be found in the <a class="lpdoc-idx-anchor" id="39" href="lpdoc_ref_mansearch.html#basicmodes"><tt>basicmodes</tt></a> and <a class="lpdoc-idx-anchor" id="40" href="lpdoc_ref_mansearch.html#isomodes"><tt>isomodes</tt></a> libraries. Users can define modes using the <a class="lpdoc-idx-anchor" id="41" href="assertions_doc.html#modedef/1"><tt>modedef/1</tt></a> declaration. <a class="lpdoc-idx-anchor" id="42" href="lpdoc_ref_mansearch.html#useful modes"></a> <p><li>Any term. In this case this term determines the instantiation state of the corresponding argument position of the predicate calls to which the assertion applies.<p><li>A ground term preceded by a ``<a class="lpdoc-idx-anchor" id="43" href="lpdoc_ref_mansearch.html#mode">mode</a>.&apos;&apos; The ground term determines a property of the corresponding argument. The mode determines if it applies to the calls and/or the successes. The actual property referred to is that given by the term but with one more argument added at the beginning, which is a new variable which, in a rewriting of the head pattern, appears at the argument position occupied by the term. For example, the head pattern <tt>p(Input,+list(int),Output)</tt> is valid for mode <a class="lpdoc-idx-anchor" id="44" href="lpdoc_ref_mansearch.html#+/1"><tt>+/1</tt></a> defined in <a class="lpdoc-idx-anchor" id="45" href="lpdoc_ref_mansearch.html#library(isomodes)"><tt>library(isomodes)</tt></a>, and equivalent in this case to having the head pattern <tt>p(Input,A,Output)</tt> and stating that the property <tt>list(int,A)</tt> holds for the calls of the predicate.<p><li>Any term preceded by a ``<a class="lpdoc-idx-anchor" id="46" href="lpdoc_ref_mansearch.html#mode">mode</a>.&apos;&apos; In this case, only one variable is admitted, it has to be the first argument of the mode, and it represents the argument position. I.e., it plays the role of the new variable mentioned above. Thus, no rewriting of the head pattern is performed in this case. For example, the head pattern <tt>p(Input,+(Parameter,list(int)),Output)</tt> is valid for mode <a class="lpdoc-idx-anchor" id="47" href="lpdoc_ref_mansearch.html#+/2"><tt>+/2</tt></a> defined in <a class="lpdoc-idx-anchor" id="48" href="lpdoc_ref_mansearch.html#library(isomodes)"><tt>library(isomodes)</tt></a>, and equivalent in this case to having the head pattern <tt>p(Input,Parameter,Output)</tt> and stating that the property <tt>list(int,Parameter)</tt> holds for the calls of the predicate.<p></ul> <p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>head_pattern(Pr)</tt> </span><p><span class="lpdoc-var">Pr</span> is a head pattern.</p><ul class="lpdoc-itemize-minus"></ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">REGTYPE</span><a class="lpdoc-idx-anchor" id="complex_arg_property/1" href="lpdoc_ref_mansearch.html#complex_arg_property/1">complex_arg_property/1</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>complex_arg_property(Props)</tt> </span><p><span class="lpdoc-var">Props</span> is a (possibly empty) <a class="lpdoc-idx-anchor" id="49" href="lpdoc_ref_mansearch.html#complex argument property">complex argument property</a>. Such properties can appear in two formats, which are defined by <a class="lpdoc-idx-anchor" id="50" href="#property_conjunction/1"><tt>property_conjunction/1</tt></a> and <a class="lpdoc-idx-anchor" id="51" href="#property_starterm/1"><tt>property_starterm/1</tt></a> respectively. The two formats can be mixed provided they are not in the same field of an assertion. I.e., the following is a valid assertion:<p><tt>:- pred foo(X,Y) : nonvar * var =&gt; (ground(X),ground(Y)).</tt><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>complex_arg_property(Props)</tt> </span><p><span class="lpdoc-var">Props</span> is a (possibly empty) complex argument property</p><ul class="lpdoc-itemize-minus"></ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">REGTYPE</span><a class="lpdoc-idx-anchor" id="property_conjunction/1" href="lpdoc_ref_mansearch.html#property_conjunction/1">property_conjunction/1</a></div><div class="lpdoc-deftext">This type defines the first, unabridged format in which properties can be expressed in the bodies of assertions. It is essentially a conjunction of properties which refer to variables. The following is an example of a complex property in this format:<p><ul> <p><li><tt>(integer(X),list(integer,Y))</tt>: <span class="lpdoc-var">X</span> has the property <a class="lpdoc-idx-anchor" id="52" href="lpdoc_ref_mansearch.html#integer/1"><tt>integer/1</tt></a> and <span class="lpdoc-var">Y</span> has the property <a class="lpdoc-idx-anchor" id="53" href="basic_props.html#list/2"><tt>list/2</tt></a>, with second argument <tt>integer</tt>.<p></ul><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>property_conjunction(Props)</tt> </span><p><span class="lpdoc-var">Props</span> is either a term or a <em>conjunction</em> of terms. The main functor and arity of each of those terms corresponds to the definition of a property. The first argument of each such term is a variable which appears as a head argument.</p><ul class="lpdoc-itemize-minus"></ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">REGTYPE</span><a class="lpdoc-idx-anchor" id="property_starterm/1" href="lpdoc_ref_mansearch.html#property_starterm/1">property_starterm/1</a></div><div class="lpdoc-deftext">This type defines a second, compact format in which properties can be expressed in the bodies of assertions. A <a class="lpdoc-idx-anchor" id="54" href="#property_starterm/1"><tt>property_starterm/1</tt></a> is a term whose main functor is <a class="lpdoc-idx-anchor" id="55" href="lpdoc_ref_mansearch.html#*/2"><tt>*/2</tt></a> and, when it appears in an assertion, the number of terms joined by <a class="lpdoc-idx-anchor" id="56" href="lpdoc_ref_mansearch.html#*/2"><tt>*/2</tt></a> is exactly the arity of the predicate it refers to. A similar series of properties as in <a class="lpdoc-idx-anchor" id="57" href="#property_conjunction/1"><tt>property_conjunction/1</tt></a> appears, but the arity of each property is one less: the argument position to which they refer (first argument) is left out and determined by the position of the property in the <a class="lpdoc-idx-anchor" id="58" href="#property_starterm/1"><tt>property_starterm/1</tt></a>. The idea is that each element of the <a class="lpdoc-idx-anchor" id="59" href="lpdoc_ref_mansearch.html#*/2"><tt>*/2</tt></a> term corresponds to a head argument position. Several properties can be assigned to each argument position by grouping them in curly brackets. The following is an example of a complex property in this format:<p><ul> <p><li><tt> integer * list(integer)</tt>: the first argument of the procedure (or function, or ...) has the property <a class="lpdoc-idx-anchor" id="60" href="lpdoc_ref_mansearch.html#integer/1"><tt>integer/1</tt></a> and the second one has the property <a class="lpdoc-idx-anchor" id="61" href="basic_props.html#list/2"><tt>list/2</tt></a>, with second argument <tt>integer</tt>.<p><li><tt> {integer,var} * list(integer)</tt>: the first argument of the procedure (or function, or ...) has the properties <a class="lpdoc-idx-anchor" id="62" href="lpdoc_ref_mansearch.html#integer/1"><tt>integer/1</tt></a> and <a class="lpdoc-idx-anchor" id="63" href="lpdoc_ref_mansearch.html#var/1"><tt>var/1</tt></a> and the second one has the property <a class="lpdoc-idx-anchor" id="64" href="basic_props.html#list/2"><tt>list/2</tt></a>, with second argument <tt>integer</tt>.<p></ul><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>property_starterm(Props)</tt> </span><p><span class="lpdoc-var">Props</span> is either a term or several terms separated by <a class="lpdoc-idx-anchor" id="65" href="lpdoc_ref_mansearch.html#*/2"><tt>*/2</tt></a>. The main functor of each of those terms corresponds to that of the definition of a property, and the arity should be one less than in the definition of such property. All arguments of each such term are ground.</p><ul class="lpdoc-itemize-minus"></ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">REGTYPE</span><a class="lpdoc-idx-anchor" id="complex_goal_property/1" href="lpdoc_ref_mansearch.html#complex_goal_property/1">complex_goal_property/1</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>complex_goal_property(Props)</tt> </span><p><span class="lpdoc-var">Props</span> is a (possibly empty) <a class="lpdoc-idx-anchor" id="66" href="lpdoc_ref_mansearch.html#complex goal property">complex goal property</a>. Such properties can be either a term or a <em>conjunction</em> of terms. The main functor and arity of each of those terms corresponds to the definition of a property. Such properties apply to all executions of all goals of the predicate which comply with the assertion in which the <span class="lpdoc-var">Props</span> appear.<p>The arguments of the terms in <span class="lpdoc-var">Props</span> are implicitely augmented with a first argument which corresponds to a goal of the predicate of the assertion in which the <span class="lpdoc-var">Props</span> appear. For example, the assertion <pre class="lpdoc-codeblock"> :- comp var(A) + not_further_inst(A).</pre> has property <a class="lpdoc-idx-anchor" id="67" href="lpdoc_ref_mansearch.html#not_further_inst/1"><tt>not_further_inst/1</tt></a> as goal property, and establishes that in all executions of <tt>var(A)</tt> it should hold that <tt>not_further_inst(var(A),A)</tt>.<p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>complex_goal_property(Props)</tt> </span><p><span class="lpdoc-var">Props</span> is either a term or a <em>conjunction</em> of terms. The main functor and arity of each of those terms corresponds to the definition of a property. A first implicit argument in such terms identifies goals to which the properties apply.</p><ul class="lpdoc-itemize-minus"></ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PROPERTY</span><a class="lpdoc-idx-anchor" id="nabody/1" href="lpdoc_ref_mansearch.html#nabody/1">nabody/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>nabody(ABody)</tt> </span><p><span class="lpdoc-var">ABody</span> is a normalized assertion body.</p><ul class="lpdoc-itemize-minus"></ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">REGTYPE</span><a class="lpdoc-idx-anchor" id="dictionary/1" href="lpdoc_ref_mansearch.html#dictionary/1">dictionary/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>dictionary(D)</tt> </span><p><span class="lpdoc-var">D</span> is a dictionary of variable names.</p><ul class="lpdoc-itemize-minus"></ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">REGTYPE</span><a class="lpdoc-idx-anchor" id="c_assrt_body/1" href="lpdoc_ref_mansearch.html#c_assrt_body/1">c_assrt_body/1</a></div><div class="lpdoc-deftext"><a class="lpdoc-idx-anchor" id="68" href="lpdoc_ref_mansearch.html#assertion body syntax"></a> This predicate defines the different types of syntax admissible in the bodies of <a class="lpdoc-idx-anchor" id="69" href="lpdoc_ref_mansearch.html#call/1"><tt>call/1</tt></a>, <a class="lpdoc-idx-anchor" id="70" href="assertions_doc.html#entry/1"><tt>entry/1</tt></a>, etc. assertions. The following are admissible:<p><pre class="lpdoc-codeblock"> Pr : CP [# CO]</pre> <p>where (fields between [...] are optional):<p><ul> <p><li><span class="lpdoc-var">CP</span> is a (possibly empty) <a class="lpdoc-idx-anchor" id="71" href="lpdoc_ref_mansearch.html#complex argument property">complex argument property</a> (<a class="lpdoc-idx-anchor" id="72" href="#complex_arg_property/1"><tt>complex_arg_property/1</tt></a>) which applies to the <em>calls</em> to the predicate.<p><li><span class="lpdoc-var">CO</span> is a <a class="lpdoc-idx-anchor" id="73" href="lpdoc_ref_mansearch.html#comment string">comment string</a> (<a class="lpdoc-idx-anchor" id="74" href="comments.html#docstring/1"><tt>docstring/1</tt></a>). This comment only applies if the (possibly empty) properties given for calls in the assertion hold. The usual formatting commands that are applicable in comment strings can be used (see <a class="lpdoc-idx-anchor" id="75" href="comments.html#stringcommand/1"><tt>stringcommand/1</tt></a>).<p></ul> <p>The format of the different parts of the assertion body are given by <a class="lpdoc-idx-anchor" id="76" href="lpdoc_ref_mansearch.html#n_assrt_body/5"><tt>n_assrt_body/5</tt></a> and its auxiliary types.<p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>c_assrt_body(X)</tt> </span><p><span class="lpdoc-var">X</span> is a call assertion body.</p><ul class="lpdoc-itemize-minus"></ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">REGTYPE</span><a class="lpdoc-idx-anchor" id="s_assrt_body/1" href="lpdoc_ref_mansearch.html#s_assrt_body/1">s_assrt_body/1</a></div><div class="lpdoc-deftext"><a class="lpdoc-idx-anchor" id="77" href="lpdoc_ref_mansearch.html#assertion body syntax"></a> This predicate defines the different types of syntax admissible in the bodies of <a class="lpdoc-idx-anchor" id="78" href="assertions_doc.html#pred/1"><tt>pred/1</tt></a>, <a class="lpdoc-idx-anchor" id="79" href="lpdoc_ref_mansearch.html#func/1"><tt>func/1</tt></a>, etc. assertions. The following are admissible:<p><pre class="lpdoc-codeblock"> Pr : CP =&gt; AP # CO Pr : CP =&gt; AP Pr =&gt; AP # CO Pr =&gt; AP</pre> <p>where:<p><ul> <p><li><span class="lpdoc-var">Pr</span> is a <a class="lpdoc-idx-anchor" id="80" href="lpdoc_ref_mansearch.html#head pattern">head pattern</a> (<a class="lpdoc-idx-anchor" id="81" href="#head_pattern/1"><tt>head_pattern/1</tt></a>) which describes the predicate or property and possibly gives some implicit call/answer information.<p><li><span class="lpdoc-var">CP</span> is a (possibly empty) <a class="lpdoc-idx-anchor" id="82" href="lpdoc_ref_mansearch.html#complex argument property">complex argument property</a> (<a class="lpdoc-idx-anchor" id="83" href="#complex_arg_property/1"><tt>complex_arg_property/1</tt></a>) which applies to the <em>calls</em> to the predicate.<p><li><span class="lpdoc-var">AP</span> is a (possibly empty) <a class="lpdoc-idx-anchor" id="84" href="lpdoc_ref_mansearch.html#complex argument property">complex argument property</a> (<a class="lpdoc-idx-anchor" id="85" href="#complex_arg_property/1"><tt>complex_arg_property/1</tt></a>) which applies to the <em>answers</em> to the predicate (if the predicate succeeds). These only apply if the (possibly empty) properties given for calls in the assertion hold.<p><li><span class="lpdoc-var">CO</span> is a <a class="lpdoc-idx-anchor" id="86" href="lpdoc_ref_mansearch.html#comment string">comment string</a> (<a class="lpdoc-idx-anchor" id="87" href="comments.html#docstring/1"><tt>docstring/1</tt></a>). This comment only applies if the (possibly empty) properties given for calls in the assertion hold. The usual formatting commands that are applicable in comment strings can be used (see <a class="lpdoc-idx-anchor" id="88" href="comments.html#stringcommand/1"><tt>stringcommand/1</tt></a>).<p></ul> <p>The format of the different parts of the assertion body are given by <a class="lpdoc-idx-anchor" id="89" href="lpdoc_ref_mansearch.html#n_assrt_body/5"><tt>n_assrt_body/5</tt></a> and its auxiliary types.<p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>s_assrt_body(X)</tt> </span><p><span class="lpdoc-var">X</span> is a predicate assertion body.</p><ul class="lpdoc-itemize-minus"></ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">REGTYPE</span><a class="lpdoc-idx-anchor" id="g_assrt_body/1" href="lpdoc_ref_mansearch.html#g_assrt_body/1">g_assrt_body/1</a></div><div class="lpdoc-deftext"><a class="lpdoc-idx-anchor" id="90" href="lpdoc_ref_mansearch.html#assertion body syntax"></a> This predicate defines the different types of syntax admissible in the bodies of <a class="lpdoc-idx-anchor" id="91" href="assertions_doc.html#comp/1"><tt>comp/1</tt></a> assertions. The following are admissible:<p><pre class="lpdoc-codeblock"> Pr : CP + GP # CO Pr : CP + GP Pr + GP # CO Pr + GP</pre> <p>where:<p><ul> <p><li><span class="lpdoc-var">Pr</span> is a <a class="lpdoc-idx-anchor" id="92" href="lpdoc_ref_mansearch.html#head pattern">head pattern</a> (<a class="lpdoc-idx-anchor" id="93" href="#head_pattern/1"><tt>head_pattern/1</tt></a>) which describes the predicate or property and possibly gives some implicit call/answer information.<p><li><span class="lpdoc-var">CP</span> is a (possibly empty) <a class="lpdoc-idx-anchor" id="94" href="lpdoc_ref_mansearch.html#complex argument property">complex argument property</a> (<a class="lpdoc-idx-anchor" id="95" href="#complex_arg_property/1"><tt>complex_arg_property/1</tt></a>) which applies to the <em>calls</em> to the predicate.<p><li><span class="lpdoc-var">GP</span> contains (possibly empty) <a class="lpdoc-idx-anchor" id="96" href="lpdoc_ref_mansearch.html#complex goal property">complex goal property</a> (<a class="lpdoc-idx-anchor" id="97" href="#complex_goal_property/1"><tt>complex_goal_property/1</tt></a>) which applies to the <em>whole execution</em> of a call to the predicate. These only apply if the (possibly empty) properties given for calls in the assertion hold.<p><li><span class="lpdoc-var">CO</span> is a <a class="lpdoc-idx-anchor" id="98" href="lpdoc_ref_mansearch.html#comment string">comment string</a> (<a class="lpdoc-idx-anchor" id="99" href="comments.html#docstring/1"><tt>docstring/1</tt></a>). This comment only applies if the (possibly empty) properties given for calls in the assertion hold. The usual formatting commands that are applicable in comment strings can be used (see <a class="lpdoc-idx-anchor" id="100" href="comments.html#stringcommand/1"><tt>stringcommand/1</tt></a>).<p></ul> <p>The format of the different parts of the assertion body are given by <a class="lpdoc-idx-anchor" id="101" href="lpdoc_ref_mansearch.html#n_assrt_body/5"><tt>n_assrt_body/5</tt></a> and its auxiliary types.<p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>g_assrt_body(X)</tt> </span><p><span class="lpdoc-var">X</span> is a comp assertion body.</p><ul class="lpdoc-itemize-minus"></ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">REGTYPE</span><a class="lpdoc-idx-anchor" id="assrt_status/1" href="lpdoc_ref_mansearch.html#assrt_status/1">assrt_status/1</a></div><div class="lpdoc-deftext">The types of assertion status. They have the same meaning as the program-point assertions, and are as follows: <pre class="lpdoc-codeblock">assrt_status(true). assrt_status(false). assrt_status(check). assrt_status(checked). assrt_status(trust). </pre><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>assrt_status(X)</tt> </span><p><span class="lpdoc-var">X</span> is an acceptable status for an assertion.</p><ul class="lpdoc-itemize-minus"></ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">REGTYPE</span><a class="lpdoc-idx-anchor" id="assrt_type/1" href="lpdoc_ref_mansearch.html#assrt_type/1">assrt_type/1</a></div><div class="lpdoc-deftext">The admissible kinds of assertions: <pre class="lpdoc-codeblock">assrt_type(pred). assrt_type(prop). assrt_type(decl). assrt_type(func). assrt_type(calls). assrt_type(success). assrt_type(comp). assrt_type(entry). assrt_type(exit). assrt_type(test). assrt_type(texec). assrt_type(modedef). </pre><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>assrt_type(X)</tt> </span><p><span class="lpdoc-var">X</span> is an admissible kind of assertion.</p><ul class="lpdoc-itemize-minus"></ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">REGTYPE</span><a class="lpdoc-idx-anchor" id="predfunctor/1" href="lpdoc_ref_mansearch.html#predfunctor/1">predfunctor/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>predfunctor(X)</tt> </span><p><span class="lpdoc-var">X</span> is a type of assertion which defines a predicate.</p><ul class="lpdoc-itemize-minus"></ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">REGTYPE</span><a class="lpdoc-idx-anchor" id="propfunctor/1" href="lpdoc_ref_mansearch.html#propfunctor/1">propfunctor/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>propfunctor(X)</tt> </span><p><span class="lpdoc-var">X</span> is a type of assertion which defines a <em>property</em>.</p><ul class="lpdoc-itemize-minus"></ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PROPERTY</span><a class="lpdoc-idx-anchor" id="docstring/1" href="lpdoc_ref_mansearch.html#docstring/1">docstring/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>docstring(String)</tt> </span><p><span class="lpdoc-var">String</span> is a text comment with admissible documentation commands. The usual formatting commands that are applicable in comment strings are defined by <a class="lpdoc-idx-anchor" id="102" href="comments.html#stringcommand/1"><tt>stringcommand/1</tt></a>. See the <a class="lpdoc-idx-anchor" id="103" href="lpdoc_ref_mansearch.html#lpdoc"><tt>lpdoc</tt></a> manual for documentation on comments.</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>Internal (engine) modules:</em><br/><a class="lpdoc-idx-anchor" id="104" href="lpdoc_ref_mansearch.html#term_basic"><tt>term_basic</tt></a>, <a class="lpdoc-idx-anchor" id="105" href="lpdoc_ref_mansearch.html#arithmetic"><tt>arithmetic</tt></a>, <a class="lpdoc-idx-anchor" id="106" href="lpdoc_ref_mansearch.html#atomic_basic"><tt>atomic_basic</tt></a>, <a class="lpdoc-idx-anchor" id="107" href="lpdoc_ref_mansearch.html#basiccontrol"><tt>basiccontrol</tt></a>, <a class="lpdoc-idx-anchor" id="108" href="lpdoc_ref_mansearch.html#exceptions"><tt>exceptions</tt></a>, <a class="lpdoc-idx-anchor" id="109" href="lpdoc_ref_mansearch.html#term_compare"><tt>term_compare</tt></a>, <a class="lpdoc-idx-anchor" id="110" href="lpdoc_ref_mansearch.html#term_typing"><tt>term_typing</tt></a>, <a class="lpdoc-idx-anchor" id="111" href="lpdoc_ref_mansearch.html#debugger_support"><tt>debugger_support</tt></a>, <a class="lpdoc-idx-anchor" id="112" href="basic_props.html"><tt>basic_props</tt></a>. <li><em>Packages:</em><br/><a class="lpdoc-idx-anchor" id="113" href="lpdoc_ref_mansearch.html#prelude"><tt>prelude</tt></a>, <a class="lpdoc-idx-anchor" id="114" href="lpdoc_ref_mansearch.html#initial"><tt>initial</tt></a>, <a class="lpdoc-idx-anchor" id="115" href="lpdoc_ref_mansearch.html#condcomp"><tt>condcomp</tt></a>, <a class="lpdoc-idx-anchor" id="116" href="assertions_doc.html"><tt>assertions</tt></a>, <a class="lpdoc-idx-anchor" id="117" href="lpdoc_ref_mansearch.html#assertions/assertions_basic"><tt>assertions/assertions_basic</tt></a>, <a class="lpdoc-idx-anchor" id="118" href="regtypes_doc.html"><tt>regtypes</tt></a>. </ul></div></div><div class="lpdoc-footer">Generated with LPdoc using Ciao</div></div><div class="lpdoc-clearer"></div></div></body></html>