UNPKG

@ciao-lang/ts-ciao-interface

Version:

Simple Ciao interface for node.

112 lines 15 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>native (library) &mdash; The CiaoPP Program Processor v1.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="ciao-logo_autofig.png" width=auto height=100%></div><div class="lpdoc-nav"><span class="lpdoc-on-right"><a class="lpdoc-navbutton" href="Punit.html">&#x2191;</a><a class="lpdoc-navbutton" href="p_unit.html">&#x2190;</a><a class="lpdoc-navbutton" href="program_keys.html">&#x2192;</a><a class="lpdoc-navbutton" href="ciaopp_ref_mansearch.html">&#x1F50D;</a></span><span><a href="ciaopp_ref_manfulltoc.html">TOC</a></span></div><hr></hr><ul class="lpdoc-itemize-sectpath"><li><a href="ciaopp_ref_man.html">The CiaoPP Program Processor</a> &raquo;<br/> </li><li><a href="part_internals.html">PART IV - CiaoPP Internals</a> &raquo;<br/> </li><li><a href="Punit.html">The Preprocessing Unit Component</a> &raquo;<br/> </li><li><a href=""><strong>native (library)</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>native (library)</h1><a class="lpdoc-idx-anchor" href="ciaopp_ref_mansearch.html#native"></a> This module has the basic procedures for understanding predicates as builtins and properties as native properties.<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(compiler/p_unit/native)).</tt><li><strong>Exports:</strong><br/><ul class="lpdoc-itemize-minus"><li><em>Predicates:</em><br/><a class="lpdoc-idx-anchor" id="0" href="#builtin/2"><tt>builtin/2</tt></a>, <a class="lpdoc-idx-anchor" id="1" href="#native_prop_map/3"><tt>native_prop_map/3</tt></a>, <a class="lpdoc-idx-anchor" id="2" href="#wam_builtin/2"><tt>wam_builtin/2</tt></a>. <li><em>Regular Types:</em><br/><a class="lpdoc-idx-anchor" id="3" href="#native_prop_term/1"><tt>native_prop_term/1</tt></a>. <li><em>Multifiles:</em><br/><a class="lpdoc-idx-anchor" id="4" href="frontend_driver.html#hook_compact_global_prop/2"><tt>hook_compact_global_prop/2</tt></a>, <a class="lpdoc-idx-anchor" id="5" href="frontend_driver.html#hook_compact_calls_prop/2"><tt>hook_compact_calls_prop/2</tt></a>, <a class="lpdoc-idx-anchor" id="6" href="frontend_driver.html#hook_native_prop/2"><tt>hook_native_prop/2</tt></a>, <a class="lpdoc-idx-anchor" id="7" href="frontend_driver.html#hook_pp_info_clause/3"><tt>hook_pp_info_clause/3</tt></a>, <a class="lpdoc-idx-anchor" id="8" href="frontend_driver.html#hook_pp_info_lit/4"><tt>hook_pp_info_lit/4</tt></a>, <a class="lpdoc-idx-anchor" id="9" href="frontend_driver.html#hook_legal_regtype/1"><tt>hook_legal_regtype/1</tt></a>, <a class="lpdoc-idx-anchor" id="10" href="frontend_driver.html#hook_insert_regtype/2"><tt>hook_insert_regtype/2</tt></a>, <a class="lpdoc-idx-anchor" id="11" href="frontend_driver.html#hook_post_init_regtypes/0"><tt>hook_post_init_regtypes/0</tt></a>, <a class="lpdoc-idx-anchor" id="12" href="frontend_driver.html#hook_cleanup_lib_regtypes/0"><tt>hook_cleanup_lib_regtypes/0</tt></a>, <a class="lpdoc-idx-anchor" id="13" href="frontend_driver.html#hook_restore_lib_regtypes/1"><tt>hook_restore_lib_regtypes/1</tt></a>, <a class="lpdoc-idx-anchor" id="14" href="frontend_driver.html#hook_save_lib_regtypes/1"><tt>hook_save_lib_regtypes/1</tt></a>. </ul></ul></div></div><div id="Documentation on exports"><h2>Documentation on exports</h2><div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="builtin/2" href="ciaopp_ref_mansearch.html#builtin/2">builtin/2</a></div><div class="lpdoc-deftext">checks that a user level (property) predicate is declared native and translates it into the internal representation for that native (builtin or property) predicate.</div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="native_prop_map/3" href="ciaopp_ref_mansearch.html#native_prop_map/3">native_prop_map/3</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>native_prop_map(Prop,P,Vars)</tt> </span><p><span class="lpdoc-var">Prop</span> is a property <span class="lpdoc-var">P</span>(<span class="lpdoc-var">Vars</span>) representing a mapping <tt>map</tt>(<span class="lpdoc-var">Vars</span>,<span class="lpdoc-var">P</span>)</div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">REGTYPE</span><a class="lpdoc-idx-anchor" id="native_prop_term/1" href="ciaopp_ref_mansearch.html#native_prop_term/1">native_prop_term/1</a></div><div class="lpdoc-deftext">Defined as <pre class="lpdoc-codeblock">native_prop_term(Prop) :- native:native(Prop). native_prop_term(regtype(Prop)) :- cgoal(Prop). </pre><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>native_prop_term(Prop)</tt> </span><p><span class="lpdoc-var">Prop</span> identifies a native property.</p><ul class="lpdoc-itemize-minus"></ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="wam_builtin/2" href="ciaopp_ref_mansearch.html#wam_builtin/2">wam_builtin/2</a></div><div class="lpdoc-deftext">No further documentation available for this predicate.</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="hook_compact_global_prop/2" href="ciaopp_ref_mansearch.html#hook_compact_global_prop/2">hook_compact_global_prop/2</a></div><div class="lpdoc-deftext">No further documentation available for this predicate. The predicate is <em>multifile</em>.<br/></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="hook_compact_calls_prop/2" href="ciaopp_ref_mansearch.html#hook_compact_calls_prop/2">hook_compact_calls_prop/2</a></div><div class="lpdoc-deftext">No further documentation available for this predicate. The predicate is <em>multifile</em>.<br/></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="hook_native_prop/2" href="ciaopp_ref_mansearch.html#hook_native_prop/2">hook_native_prop/2</a></div><div class="lpdoc-deftext">No further documentation available for this predicate. The predicate is <em>multifile</em>.<br/></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="hook_pp_info_clause/3" href="ciaopp_ref_mansearch.html#hook_pp_info_clause/3">hook_pp_info_clause/3</a></div><div class="lpdoc-deftext">No further documentation available for this predicate. The predicate is <em>multifile</em>.<br/></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="hook_pp_info_lit/4" href="ciaopp_ref_mansearch.html#hook_pp_info_lit/4">hook_pp_info_lit/4</a></div><div class="lpdoc-deftext">No further documentation available for this predicate. The predicate is <em>multifile</em>.<br/></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="hook_legal_regtype/1" href="ciaopp_ref_mansearch.html#hook_legal_regtype/1">hook_legal_regtype/1</a></div><div class="lpdoc-deftext">No further documentation available for this predicate. The predicate is <em>multifile</em>.<br/></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="hook_insert_regtype/2" href="ciaopp_ref_mansearch.html#hook_insert_regtype/2">hook_insert_regtype/2</a></div><div class="lpdoc-deftext">No further documentation available for this predicate. The predicate is <em>multifile</em>.<br/></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="hook_post_init_regtypes/0" href="ciaopp_ref_mansearch.html#hook_post_init_regtypes/0">hook_post_init_regtypes/0</a></div><div class="lpdoc-deftext">No further documentation available for this predicate. The predicate is <em>multifile</em>.<br/></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="hook_cleanup_lib_regtypes/0" href="ciaopp_ref_mansearch.html#hook_cleanup_lib_regtypes/0">hook_cleanup_lib_regtypes/0</a></div><div class="lpdoc-deftext">No further documentation available for this predicate. The predicate is <em>multifile</em>.<br/></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="hook_restore_lib_regtypes/1" href="ciaopp_ref_mansearch.html#hook_restore_lib_regtypes/1">hook_restore_lib_regtypes/1</a></div><div class="lpdoc-deftext">No further documentation available for this predicate. The predicate is <em>multifile</em>.<br/></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="hook_save_lib_regtypes/1" href="ciaopp_ref_mansearch.html#hook_save_lib_regtypes/1">hook_save_lib_regtypes/1</a></div><div class="lpdoc-deftext">No further documentation available for this predicate. 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">REGTYPE</span><a class="lpdoc-idx-anchor" id="native/1" href="ciaopp_ref_mansearch.html#native/1">native/1</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>native(Prop)</tt> </span><p><span class="lpdoc-var">Prop</span> is (the internal representation of) a native property: one that CiaoPP knows natively how to manipulate. <pre class="lpdoc-codeblock">native(covered(V,L)) :- var(V), list(var,L). native(free(L)) :- vlist(L). native(ground(L)) :- vlist(L). native(indep(L)) :- list(list(var),L). native(instance(V,T)) :- var(V), nonvar(T). native(linear(L)) :- vlist(L). native(not_free(L)) :- vlist(L). native(not_ground(L)) :- vlist(L). native(sharing(L)) :- list(list(var),L). native(sharing(Xs,Xss)) :- list(var,Xs), list(list(var),Xss). native(det). native(semidet). native(multi). native(nondet). native(covered). native(fails). native(is_det). native(mut_exclusive). native(non_det). native(not_covered). native(not_fails). native(not_mut_exclusive). native(sideff(X)) :- member(X,[pure,soft,hard]). native(steps(C)) :- cost_expression(C). native(steps_lb(C)) :- cost_expression(C). native(steps_ub(C)) :- cost_expression(C). native(steps_o(C)) :- cost_expression(C). native(cost(C)) :- cost_expression(C). native(terminates). native(size(C)) :- cost_expression(C). native(size(A,B)) :- var(A), cost_expression(B). native(size_lb(C)) :- cost_expression(C). native(size_ub(C)) :- cost_expression(C). native(size_o(C)) :- cost_expression(C). native(rsize(A,_B)) :- var(A). native(cardinality(_N,_M)). native(costb(_R,_N,_M)). native(X) :- native(X,X). </pre></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">REGTYPE</span><a class="lpdoc-idx-anchor" id="vlist/1" href="ciaopp_ref_mansearch.html#vlist/1">vlist/1</a></div><div class="lpdoc-deftext"><pre class="lpdoc-codeblock">vlist(L) :- var(L). vlist(L) :- list(var,L). </pre></div></div><p> </div><div id="Documentation on imports"><h2>Documentation on imports</h2>This module has the following direct dependencies:<ul class="lpdoc-itemize-minus"><li><em>System library modules:</em><br/><a class="lpdoc-idx-anchor" id="15" href="ciaopp_ref_mansearch.html#native_props"><tt>native_props</tt></a>, <a class="lpdoc-idx-anchor" id="16" href="ciaopp_ref_mansearch.html#lists"><tt>lists</tt></a>. <li><em>Internal (engine) modules:</em><br/><a class="lpdoc-idx-anchor" id="17" href="ciaopp_ref_mansearch.html#term_basic"><tt>term_basic</tt></a>, <a class="lpdoc-idx-anchor" id="18" href="ciaopp_ref_mansearch.html#arithmetic"><tt>arithmetic</tt></a>, <a class="lpdoc-idx-anchor" id="19" href="ciaopp_ref_mansearch.html#atomic_basic"><tt>atomic_basic</tt></a>, <a class="lpdoc-idx-anchor" id="20" href="ciaopp_ref_mansearch.html#basiccontrol"><tt>basiccontrol</tt></a>, <a class="lpdoc-idx-anchor" id="21" href="ciaopp_ref_mansearch.html#exceptions"><tt>exceptions</tt></a>, <a class="lpdoc-idx-anchor" id="22" href="ciaopp_ref_mansearch.html#term_compare"><tt>term_compare</tt></a>, <a class="lpdoc-idx-anchor" id="23" href="ciaopp_ref_mansearch.html#term_typing"><tt>term_typing</tt></a>, <a class="lpdoc-idx-anchor" id="24" href="ciaopp_ref_mansearch.html#debugger_support"><tt>debugger_support</tt></a>, <a class="lpdoc-idx-anchor" id="25" href="basic_props.html"><tt>basic_props</tt></a>, <a class="lpdoc-idx-anchor" id="26" href="ciaopp_ref_mansearch.html#hiord_rt"><tt>hiord_rt</tt></a>, <a class="lpdoc-idx-anchor" id="27" href="ciaopp_ref_mansearch.html#runtime_control"><tt>runtime_control</tt></a>. <li><em>Packages:</em><br/><a class="lpdoc-idx-anchor" id="28" href="ciaopp_ref_mansearch.html#prelude"><tt>prelude</tt></a>, <a class="lpdoc-idx-anchor" id="29" href="ciaopp_ref_mansearch.html#initial"><tt>initial</tt></a>, <a class="lpdoc-idx-anchor" id="30" href="ciaopp_ref_mansearch.html#condcomp"><tt>condcomp</tt></a>, <a class="lpdoc-idx-anchor" id="31" href="assertions_doc.html"><tt>assertions</tt></a>, <a class="lpdoc-idx-anchor" id="32" href="ciaopp_ref_mansearch.html#assertions/assertions_basic"><tt>assertions/assertions_basic</tt></a>, <a class="lpdoc-idx-anchor" id="33" href="regtypes_doc.html"><tt>regtypes</tt></a>, <a class="lpdoc-idx-anchor" id="34" href="ciaopp_ref_mansearch.html#hiord"><tt>hiord</tt></a>, <a class="lpdoc-idx-anchor" id="35" href="ciaopp_ref_mansearch.html#nortchecks"><tt>nortchecks</tt></a>, <a class="lpdoc-idx-anchor" id="36" href="ciaopp_ref_mansearch.html#nativeprops"><tt>nativeprops</tt></a>. </ul></div></div><div class="lpdoc-footer">Generated with LPdoc using Ciao</div></div><div class="lpdoc-clearer"></div></div></body></html>