UNPKG

@ciao-lang/ts-ciao-interface

Version:

Simple Ciao interface for node.

33 lines 11.1 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>Meta-properties &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="native_props_cost_doc.html">&#x2190;</a><a class="lpdoc-navbutton" href="lpdoc_examples.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>Meta-properties</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 internals">Documentation on internals</a></li><li><a href="#Documentation on imports">Documentation on imports</a></li></ul></div><div class="lpdoc-main"><div id=""><h1>Meta-properties</h1><a class="lpdoc-idx-anchor" href="lpdoc_ref_mansearch.html#meta_props"></a> <strong>Author(s):</strong> <a class="lpdoc-idx-anchor" id="Francisco Bueno" href="lpdoc_ref_mansearch.html#Francisco Bueno">Francisco Bueno</a>.<p> This library allows the use of some meta-constructs which provide for specifying properties of terms which are unknown at the time of the specification, or expressed with a shorthand for the property definition, i.e., without really defining it.<p>An example of such use is an assertion which specifies that any property holding upon call will also hold upon exit: <pre class="lpdoc-codeblock"> :- pred p(X) : Prop(X) =&gt; Prop(X).</pre> <p>Another example is using shorthands for properties when documenting: <pre class="lpdoc-codeblock"> :- pred p(X) : regtype(X,(^(list;list);list)).</pre> <p>(See below for an explanation of such a regular type.)<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/meta_props))</tt> <p>or also as a package <tt>:- use_package(metaprops)</tt>.<p>Note the different names of the library and the package.<li><strong>Exports:</strong><br/><ul class="lpdoc-itemize-minus"><li><em>Properties:</em><br/><a class="lpdoc-idx-anchor" id="0" href="#call/2"><tt>call/2</tt></a>, <a class="lpdoc-idx-anchor" id="1" href="assertions_doc.html#prop/2"><tt>prop/2</tt></a>, <a class="lpdoc-idx-anchor" id="2" href="regtypes_doc.html#regtype/2"><tt>regtype/2</tt></a>. <li><em>Multifiles:</em><br/><a class="lpdoc-idx-anchor" id="3" href="#callme/2"><tt>callme/2</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">PROPERTY</span><a class="lpdoc-idx-anchor" id="call/2" href="lpdoc_ref_mansearch.html#call/2">call/2</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>call(P,A)</tt> </span><p><span class="lpdoc-var">A</span> has property <span class="lpdoc-var">P</span> (provided that <span class="lpdoc-var">P</span> is a property). Equivalent to <tt>P(A)</tt>.<p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>call(P,A)</tt> </span><p><span class="lpdoc-var">A</span> has property <span class="lpdoc-var">P</span>.</p><ul class="lpdoc-itemize-minus"><li><em>If the following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="4" href="basic_props.html#cgoal/1"><tt>cgoal/1</tt></a>)</span><span><span class="lpdoc-var">P</span> is a term which represents a goal, i.e., an atom or a structure. </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PROPERTY</span><a class="lpdoc-idx-anchor" id="prop/2" href="lpdoc_ref_mansearch.html#prop/2">prop/2</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>prop(A,P)</tt> </span><p><span class="lpdoc-var">A</span> has property <span class="lpdoc-var">P</span>.</p><ul class="lpdoc-itemize-minus"><li><em>If the following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="5" href="assertions_doc.html#prop/2"><tt>prop/2</tt></a>)</span><span><span class="lpdoc-var">P</span> has property <span class="lpdoc-var">^((cgoal;prop_abs))</span>. </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PROPERTY</span><a class="lpdoc-idx-anchor" id="regtype/2" href="lpdoc_ref_mansearch.html#regtype/2">regtype/2</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>regtype(A,T)</tt> </span><p><span class="lpdoc-var">A</span> is of type <span class="lpdoc-var">T</span>.</p><ul class="lpdoc-itemize-minus"><li><em>If the following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="6" href="assertions_doc.html#prop/2"><tt>prop/2</tt></a>)</span><span><span class="lpdoc-var">T</span> has property <span class="lpdoc-var">^((regtype;prop_abs))</span>. </span> </ul></div></div><p> </div><div id="Documentation on multifiles"><h2>Documentation on multifiles</h2><div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="callme/2" href="lpdoc_ref_mansearch.html#callme/2">callme/2</a></div><div class="lpdoc-deftext">(User defined.) A hook predicate you have to define as <tt>callme(P,X):- P(X), !.</tt> in the program that uses this library. This is done automatically if the package is used instead of the library module (but then you <em>should not</em> define <tt>callme/2</tt> in your program).<p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>callme(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="7" href="basic_props.html#cgoal/1"><tt>cgoal/1</tt></a>)</span><span><span class="lpdoc-var">A</span> is a term which represents a goal, i.e., an atom or a structure. </span> </ul> The predicate is <em>multifile</em>.<br/></div></div><p> </div><div id="Documentation on internals"><h2>Documentation on internals</h2><div><div class="lpdoc-defname"><span class="lpdoc-predtag">PROPERTY</span><a class="lpdoc-idx-anchor" id="prop_abs/1" href="lpdoc_ref_mansearch.html#prop_abs/1">prop_abs/1</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>prop_abs(Prop)</tt> </span><p><span class="lpdoc-var">Prop</span> is a <a class="lpdoc-idx-anchor" id="8" href="lpdoc_ref_mansearch.html#property abstraction"><em>property abstraction</em></a>, i.e., a <a class="lpdoc-idx-anchor" id="9" href="lpdoc_ref_mansearch.html#parametric property"><em>parametric property</em></a>, or a term formed of property abstractions, where the functors used in the term are escaped by <tt>^</tt>.<p>One particular case of property abstractions are <a class="lpdoc-idx-anchor" id="10" href="lpdoc_ref_mansearch.html#parametric regular type abstractions"><em>parametric regular type abstractions</em></a>, i.e., a parametric type functor or a <tt>^</tt>-escaped term formed of regular type abstractions.<p>Such abstractions are a short-hand for a corresponding regular type (correspondingly, property). For example, the following abstraction: <pre class="lpdoc-codeblock"> ^(list;list);list</pre> denotes terms of the form <tt>(X;Y)</tt> where <tt>list(X)</tt> and <tt>list(Y)</tt> hold and also terms <tt>T</tt> such that <tt>list(T)</tt> holds. It is equivalent to the regular type: <pre class="lpdoc-codeblock"> abstract_type((X;Y)):- list(X), list(Y). abstract_type(T):- list(T).</pre><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>prop_abs(Prop)</tt> </span><p><span class="lpdoc-var">Prop</span> is a <a class="lpdoc-idx-anchor" id="11" href="lpdoc_ref_mansearch.html#property abstraction">property abstraction</a>.</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="12" href="lpdoc_ref_mansearch.html#term_basic"><tt>term_basic</tt></a>, <a class="lpdoc-idx-anchor" id="13" href="lpdoc_ref_mansearch.html#arithmetic"><tt>arithmetic</tt></a>, <a class="lpdoc-idx-anchor" id="14" href="lpdoc_ref_mansearch.html#atomic_basic"><tt>atomic_basic</tt></a>, <a class="lpdoc-idx-anchor" id="15" href="lpdoc_ref_mansearch.html#basiccontrol"><tt>basiccontrol</tt></a>, <a class="lpdoc-idx-anchor" id="16" href="lpdoc_ref_mansearch.html#exceptions"><tt>exceptions</tt></a>, <a class="lpdoc-idx-anchor" id="17" href="lpdoc_ref_mansearch.html#term_compare"><tt>term_compare</tt></a>, <a class="lpdoc-idx-anchor" id="18" href="lpdoc_ref_mansearch.html#term_typing"><tt>term_typing</tt></a>, <a class="lpdoc-idx-anchor" id="19" href="lpdoc_ref_mansearch.html#debugger_support"><tt>debugger_support</tt></a>, <a class="lpdoc-idx-anchor" id="20" href="basic_props.html"><tt>basic_props</tt></a>, <a class="lpdoc-idx-anchor" id="21" href="lpdoc_ref_mansearch.html#hiord_rt"><tt>hiord_rt</tt></a>. <li><em>Packages:</em><br/><a class="lpdoc-idx-anchor" id="22" href="lpdoc_ref_mansearch.html#prelude"><tt>prelude</tt></a>, <a class="lpdoc-idx-anchor" id="23" href="lpdoc_ref_mansearch.html#initial"><tt>initial</tt></a>, <a class="lpdoc-idx-anchor" id="24" href="lpdoc_ref_mansearch.html#condcomp"><tt>condcomp</tt></a>, <a class="lpdoc-idx-anchor" id="25" href="assertions_doc.html"><tt>assertions</tt></a>, <a class="lpdoc-idx-anchor" id="26" href="lpdoc_ref_mansearch.html#assertions/assertions_basic"><tt>assertions/assertions_basic</tt></a>, <a class="lpdoc-idx-anchor" id="27" href="lpdoc_ref_mansearch.html#hiord"><tt>hiord</tt></a>. </ul></div></div><div class="lpdoc-footer">Generated with LPdoc using Ciao</div></div><div class="lpdoc-clearer"></div></div></body></html>