UNPKG

@ciao-lang/ts-ciao-interface

Version:

Simple Ciao interface for node.

182 lines 40 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>program_keys (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="native.html">&#x2190;</a><a class="lpdoc-navbutton" href="tr_syntax.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>program_keys (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 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>program_keys (library)</h1><a class="lpdoc-idx-anchor" href="ciaopp_ref_mansearch.html#program_keys"></a> This module handles the format of the structures used to represent the program. It is a list of clauses, where each clause is identified by a key, and the clause body is a conjunction of literals, where each literal is also identified by a key.<p>When creating a new clause for a predicate <tt>H</tt> in the program, the following goal will give you a clause in the correct format: <pre class="lpdoc-codeblock">clause_key(H,ClId), rewrite_source_clause(clause(H,Body),ClId,Clause), </pre> <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/program_keys)).</tt><li><strong>Exports:</strong><br/><ul class="lpdoc-itemize-minus"><li><em>Predicates:</em><br/><a class="lpdoc-idx-anchor" id="0" href="#cleanup_program_keys/0"><tt>cleanup_program_keys/0</tt></a>, <a class="lpdoc-idx-anchor" id="1" href="#clause_key/2"><tt>clause_key/2</tt></a>, <a class="lpdoc-idx-anchor" id="2" href="#clauses_keys/2"><tt>clauses_keys/2</tt></a>, <a class="lpdoc-idx-anchor" id="3" href="#clause_number/2"><tt>clause_number/2</tt></a>, <a class="lpdoc-idx-anchor" id="4" href="#first_key/2"><tt>first_key/2</tt></a>, <a class="lpdoc-idx-anchor" id="5" href="#last_clause/1"><tt>last_clause/1</tt></a>, <a class="lpdoc-idx-anchor" id="6" href="#make_atom/2"><tt>make_atom/2</tt></a>, <a class="lpdoc-idx-anchor" id="7" href="#inverse_rewrite_source_program_cl/2"><tt>inverse_rewrite_source_program_cl/2</tt></a>, <a class="lpdoc-idx-anchor" id="8" href="#inverse_rewrite_source_body/2"><tt>inverse_rewrite_source_body/2</tt></a>, <a class="lpdoc-idx-anchor" id="9" href="#rewrite_source_all_clauses/2"><tt>rewrite_source_all_clauses/2</tt></a>, <a class="lpdoc-idx-anchor" id="10" href="#rewrite_source_clause/3"><tt>rewrite_source_clause/3</tt></a>, <a class="lpdoc-idx-anchor" id="11" href="#decode_litkey/5"><tt>decode_litkey/5</tt></a>, <a class="lpdoc-idx-anchor" id="12" href="#decode_clkey/4"><tt>decode_clkey/4</tt></a>, <a class="lpdoc-idx-anchor" id="13" href="#decode_entrykey/4"><tt>decode_entrykey/4</tt></a>, <a class="lpdoc-idx-anchor" id="14" href="#decode_predkey/3"><tt>decode_predkey/3</tt></a>, <a class="lpdoc-idx-anchor" id="15" href="#is_clkey/1"><tt>is_clkey/1</tt></a>, <a class="lpdoc-idx-anchor" id="16" href="#is_litkey/1"><tt>is_litkey/1</tt></a>, <a class="lpdoc-idx-anchor" id="17" href="#is_entrykey/1"><tt>is_entrykey/1</tt></a>, <a class="lpdoc-idx-anchor" id="18" href="#is_directive/3"><tt>is_directive/3</tt></a>, <a class="lpdoc-idx-anchor" id="19" href="#is_clause/4"><tt>is_clause/4</tt></a>, <a class="lpdoc-idx-anchor" id="20" href="#orig_clause_id/2"><tt>orig_clause_id/2</tt></a>, <a class="lpdoc-idx-anchor" id="21" href="#lit_ppkey/3"><tt>lit_ppkey/3</tt></a>, <a class="lpdoc-idx-anchor" id="22" href="#clid_of_atomid/2"><tt>clid_of_atomid/2</tt></a>, <a class="lpdoc-idx-anchor" id="23" href="#counter/3"><tt>counter/3</tt></a>, <a class="lpdoc-idx-anchor" id="24" href="#get_predkey/3"><tt>get_predkey/3</tt></a>, <a class="lpdoc-idx-anchor" id="25" href="#get_predkeys/2"><tt>get_predkeys/2</tt></a>, <a class="lpdoc-idx-anchor" id="26" href="#predkey_from_sg/2"><tt>predkey_from_sg/2</tt></a>, <a class="lpdoc-idx-anchor" id="27" href="#get_clkey/4"><tt>get_clkey/4</tt></a>, <a class="lpdoc-idx-anchor" id="28" href="#get_litkey/5"><tt>get_litkey/5</tt></a>. <li><em>Properties:</em><br/><a class="lpdoc-idx-anchor" id="29" href="#clausebody/1"><tt>clausebody/1</tt></a>. <li><em>Regular Types:</em><br/><a class="lpdoc-idx-anchor" id="30" href="#clause/1"><tt>clause/1</tt></a>, <a class="lpdoc-idx-anchor" id="31" href="#literal_ppkey/1"><tt>literal_ppkey/1</tt></a>, <a class="lpdoc-idx-anchor" id="32" href="#litkey/1"><tt>litkey/1</tt></a>, <a class="lpdoc-idx-anchor" id="33" href="#clkey/1"><tt>clkey/1</tt></a>, <a class="lpdoc-idx-anchor" id="34" href="#predkey/1"><tt>predkey/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="cleanup_program_keys/0" href="ciaopp_ref_mansearch.html#cleanup_program_keys/0">cleanup_program_keys/0</a></div><div class="lpdoc-deftext">Cleanups internal database.</div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="clause_key/2" href="ciaopp_ref_mansearch.html#clause_key/2">clause_key/2</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>clause_key(H,ClId)</tt> </span><p><span class="lpdoc-var">ClId</span> is the clause key that an additional clause of predicate <span class="lpdoc-var">H</span> should have.</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="35" href="#head/1"><tt>head/1</tt></a>)</span><span><span class="lpdoc-var">H</span> is a clause head identifier. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="36" href="ciaopp_ref_mansearch.html#var/1"><tt>var/1</tt></a>)</span><span><span class="lpdoc-var">ClId</span> is a free variable. </span> <li><em>The following properties should hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="37" href="#clkey/1"><tt>clkey/1</tt></a>)</span><span><span class="lpdoc-var">ClId</span> is an atom that uniquely identifies a program clause. </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="clauses_keys/2" href="ciaopp_ref_mansearch.html#clauses_keys/2">clauses_keys/2</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>clauses_keys(H,ClIds)</tt> </span><p><span class="lpdoc-var">ClIds</span> are the clause keys of all clauses already known for predicate <span class="lpdoc-var">H</span>.</p><ul class="lpdoc-itemize-minus"><li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="38" href="basic_props.html#cgoal/1"><tt>cgoal/1</tt></a>)</span><span><span class="lpdoc-var">H</span> is a term which represents a goal, i.e., an atom or a structure. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="39" href="ciaopp_ref_mansearch.html#var/1"><tt>var/1</tt></a>)</span><span><span class="lpdoc-var">ClIds</span> is a free variable. </span> <li><em>The following properties should hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="40" href="basic_props.html#cgoal/1"><tt>cgoal/1</tt></a>)</span><span><span class="lpdoc-var">H</span> is a term which represents a goal, i.e., an atom or a structure. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="41" href="basic_props.html#list/2"><tt>list/2</tt></a>)</span><span><span class="lpdoc-var">ClIds</span> is a list of <span class="lpdoc-var">clkey</span>s. </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="clause_number/2" href="ciaopp_ref_mansearch.html#clause_number/2">clause_number/2</a></div><div class="lpdoc-deftext">No further documentation available for this predicate.</div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="first_key/2" href="ciaopp_ref_mansearch.html#first_key/2">first_key/2</a></div><div class="lpdoc-deftext">No further documentation available for this predicate.</div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="last_clause/1" href="ciaopp_ref_mansearch.html#last_clause/1">last_clause/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>last_clause(ClId)</tt> </span><p><span class="lpdoc-var">ClId</span> is the clause key of the last known clause of the predicate to which it corresponds.</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="42" href="#clkey/1"><tt>clkey/1</tt></a>)</span><span><span class="lpdoc-var">ClId</span> is an atom that uniquely identifies a program clause. </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="make_atom/2" href="ciaopp_ref_mansearch.html#make_atom/2">make_atom/2</a></div><div class="lpdoc-deftext">No further documentation available for this predicate.</div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="inverse_rewrite_source_program_cl/2" href="ciaopp_ref_mansearch.html#inverse_rewrite_source_program_cl/2">inverse_rewrite_source_program_cl/2</a></div><div class="lpdoc-deftext">No further documentation available for this predicate.</div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="inverse_rewrite_source_body/2" href="ciaopp_ref_mansearch.html#inverse_rewrite_source_body/2">inverse_rewrite_source_body/2</a></div><div class="lpdoc-deftext">No further documentation available for this predicate.</div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="rewrite_source_all_clauses/2" href="ciaopp_ref_mansearch.html#rewrite_source_all_clauses/2">rewrite_source_all_clauses/2</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>rewrite_source_all_clauses(Clauses,NewClauses)</tt> </span><p><span class="lpdoc-var">NewClauses</span> is the result of applying the format transformation to the list of clauses <span class="lpdoc-var">Clauses</span>.</div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="rewrite_source_clause/3" href="ciaopp_ref_mansearch.html#rewrite_source_clause/3">rewrite_source_clause/3</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>rewrite_source_clause(Clause0,ClId,Clause)</tt> </span><p><span class="lpdoc-var">Clause</span> is an structure representing the clause <span class="lpdoc-var">Clause0</span> identified by <span class="lpdoc-var">ClId</span> (does nothing for directives).</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="44" href="#clause/1"><tt>clause/1</tt></a>)</span><span><a class="lpdoc-idx-anchor" id="43" href="ciaopp_ref_mansearch.html#clause(Clause0)"><tt>clause(Clause0)</tt></a> </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="45" href="#clkey/1"><tt>clkey/1</tt></a>)</span><span><span class="lpdoc-var">ClId</span> is an atom that uniquely identifies a program clause. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="46" href="ciaopp_ref_mansearch.html#var/1"><tt>var/1</tt></a>)</span><span><span class="lpdoc-var">Clause</span> is a free variable. </span> <li><em>The following properties should hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="48" href="#clause/1"><tt>clause/1</tt></a>)</span><span><a class="lpdoc-idx-anchor" id="47" href="ciaopp_ref_mansearch.html#clause(Clause0)"><tt>clause(Clause0)</tt></a> </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="49" href="#clkey/1"><tt>clkey/1</tt></a>)</span><span><span class="lpdoc-var">ClId</span> is an atom that uniquely identifies a program clause. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="51" href="#clause/1"><tt>clause/1</tt></a>)</span><span><a class="lpdoc-idx-anchor" id="50" href="ciaopp_ref_mansearch.html#clause(Clause)"><tt>clause(Clause)</tt></a> </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="decode_litkey/5" href="ciaopp_ref_mansearch.html#decode_litkey/5">decode_litkey/5</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>decode_litkey(AtId,F,A,C,G)</tt> </span><p><span class="lpdoc-var">AtId</span> identifies the <span class="lpdoc-var">G</span>th literal of the body of the <span class="lpdoc-var">C</span>th clause of predicate <span class="lpdoc-var">F</span>/<span class="lpdoc-var">A</span>.</p><ul class="lpdoc-itemize-minus"><li><em>Call and exit should be compatible with:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="52" href="#litkey/1"><tt>litkey/1</tt></a>)</span><span><span class="lpdoc-var">AtId</span> is an atom that uniquely identifies a program point of a program clause body literal. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="53" href="basic_props.html#atm/1"><tt>atm/1</tt></a>)</span><span><span class="lpdoc-var">F</span> is an atom. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="54" href="basic_props.html#num/1"><tt>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="55" href="basic_props.html#num/1"><tt>num/1</tt></a>)</span><span><span class="lpdoc-var">C</span> is a number. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="56" href="basic_props.html#num/1"><tt>num/1</tt></a>)</span><span><span class="lpdoc-var">G</span> is a number. </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="decode_clkey/4" href="ciaopp_ref_mansearch.html#decode_clkey/4">decode_clkey/4</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>decode_clkey(ClId,F,A,C)</tt> </span><p><span class="lpdoc-var">ClId</span> identifies the <span class="lpdoc-var">C</span>th clause of predicate <span class="lpdoc-var">F</span>/<span class="lpdoc-var">A</span>.</p><ul class="lpdoc-itemize-minus"><li><em>Call and exit should be compatible with:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="57" href="#clkey/1"><tt>clkey/1</tt></a>)</span><span><span class="lpdoc-var">ClId</span> is an atom that uniquely identifies a program clause. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="58" href="basic_props.html#atm/1"><tt>atm/1</tt></a>)</span><span><span class="lpdoc-var">F</span> is an atom. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="59" href="basic_props.html#num/1"><tt>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="60" href="basic_props.html#num/1"><tt>num/1</tt></a>)</span><span><span class="lpdoc-var">C</span> is a number. </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="decode_entrykey/4" href="ciaopp_ref_mansearch.html#decode_entrykey/4">decode_entrykey/4</a></div><div class="lpdoc-deftext">No further documentation available for this predicate.</div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="decode_predkey/3" href="ciaopp_ref_mansearch.html#decode_predkey/3">decode_predkey/3</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>decode_predkey(PredId,F,A)</tt> </span><p><span class="lpdoc-var">PredId</span> identifies the predicate <span class="lpdoc-var">F</span>/<span class="lpdoc-var">A</span>.</p><ul class="lpdoc-itemize-minus"><li><em>Call and exit should be compatible with:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="61" href="#predkey/1"><tt>predkey/1</tt></a>)</span><span><span class="lpdoc-var">PredId</span> is an atom that uniquely identifies a program predicate. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="62" href="basic_props.html#atm/1"><tt>atm/1</tt></a>)</span><span><span class="lpdoc-var">F</span> is an atom. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="63" href="basic_props.html#num/1"><tt>num/1</tt></a>)</span><span><span class="lpdoc-var">A</span> is a number. </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="is_clkey/1" href="ciaopp_ref_mansearch.html#is_clkey/1">is_clkey/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>is_clkey(Id)</tt> </span><p>Succeeds if <span class="lpdoc-var">Id</span> is a valid clause identifier. The predicate name must not contain &apos;/&apos; characters.</p><ul class="lpdoc-itemize-minus"><li><em>Call and exit should be compatible with:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="64" href="basic_props.html#atm/1"><tt>atm/1</tt></a>)</span><span><span class="lpdoc-var">Id</span> is an atom. </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="is_litkey/1" href="ciaopp_ref_mansearch.html#is_litkey/1">is_litkey/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>is_litkey(Id)</tt> </span><p>Succeeds if <span class="lpdoc-var">Id</span> is a valid atom identifier. The predicate name must not contain &apos;/&apos; characters.</p><ul class="lpdoc-itemize-minus"><li><em>Call and exit should be compatible with:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="65" href="basic_props.html#atm/1"><tt>atm/1</tt></a>)</span><span><span class="lpdoc-var">Id</span> is an atom. </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="is_entrykey/1" href="ciaopp_ref_mansearch.html#is_entrykey/1">is_entrykey/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>is_entrykey(Id)</tt> </span><p>Succeeds if <span class="lpdoc-var">Id</span> is a valid <em>entry point</em> identifier (predkey for exported predicates, clkey for entry assertions)</p><ul class="lpdoc-itemize-minus"><li><em>Call and exit should be compatible with:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="66" href="basic_props.html#atm/1"><tt>atm/1</tt></a>)</span><span><span class="lpdoc-var">Id</span> is an atom. </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="is_directive/3" href="ciaopp_ref_mansearch.html#is_directive/3">is_directive/3</a></div><div class="lpdoc-deftext">No further documentation available for this predicate.</div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="is_clause/4" href="ciaopp_ref_mansearch.html#is_clause/4">is_clause/4</a></div><div class="lpdoc-deftext">No further documentation available for this predicate.</div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="orig_clause_id/2" href="ciaopp_ref_mansearch.html#orig_clause_id/2">orig_clause_id/2</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>orig_clause_id(ClId,Orig_ClId)</tt> </span><p><span class="lpdoc-var">Orig_ClId</span> is the clause identifier resulting from replacing the name of a newly generated predicate with the name of its corresponding predicate in the original program. </div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="lit_ppkey/3" href="ciaopp_ref_mansearch.html#lit_ppkey/3">lit_ppkey/3</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><p></p><ul class="lpdoc-itemize-minus"><li><em>Call and exit should be compatible with:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="68" href="#literal_ppkey/1"><tt>literal_ppkey/1</tt></a>)</span><span><a class="lpdoc-idx-anchor" id="67" href="ciaopp_ref_mansearch.html#literal_ppkey(Arg1)"><tt>literal_ppkey(Arg1)</tt></a> </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="69" href="basic_props.html#cgoal/1"><tt>cgoal/1</tt></a>)</span><span><span class="lpdoc-var">Arg2</span> is a term which represents a goal, i.e., an atom or a structure. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="70" href="#litkey/1"><tt>litkey/1</tt></a>)</span><span><span class="lpdoc-var">Arg3</span> is an atom that uniquely identifies a program point of a program clause body literal. </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="clid_of_atomid/2" href="ciaopp_ref_mansearch.html#clid_of_atomid/2">clid_of_atomid/2</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>clid_of_atomid(AtomId,ClId)</tt> </span><p>Returns in <span class="lpdoc-var">ClId</span> the clause identifier corresponding to <span class="lpdoc-var">AtomId</span> goal identifier.</p><ul class="lpdoc-itemize-minus"><li><em>Call and exit should be compatible with:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="71" href="basic_props.html#atm/1"><tt>atm/1</tt></a>)</span><span><span class="lpdoc-var">AtomId</span> is an atom. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="72" href="basic_props.html#atm/1"><tt>atm/1</tt></a>)</span><span><span class="lpdoc-var">ClId</span> is an atom. </span> <li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="73" href="ciaopp_ref_mansearch.html#nonvar/1"><tt>nonvar/1</tt></a>)</span><span><span class="lpdoc-var">AtomId</span> is currently a term which is not a free variable. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="74" href="ciaopp_ref_mansearch.html#var/1"><tt>var/1</tt></a>)</span><span><span class="lpdoc-var">ClId</span> is a free variable. </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">REGTYPE</span><a class="lpdoc-idx-anchor" id="clause/1" href="ciaopp_ref_mansearch.html#clause/1">clause/1</a></div><div class="lpdoc-deftext">Defined as: <pre class="lpdoc-codeblock">clause(clause(Head,Body):Clid) :- cgoal(Head), clausebody(Body), clkey(Clid). clause(directive(Body):Clid) :- clausebody(Body), drid(Clid). </pre></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="clausebody/1" href="ciaopp_ref_mansearch.html#clausebody/1">clausebody/1</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>clausebody(Body)</tt> </span><p><span class="lpdoc-var">Body</span> is a conjunction of simple goals; if a goal is a meta-predicate, its meta-arguments are terms of the form <tt>&apos;$&apos;(Term,Body,Type)</tt>, where <tt>Term</tt> is the original goal term, <tt>Type</tt> the type of meta-term as in the meta_predicate directive, and, if <tt>Type</tt> corresponds to an executable form of meta-term, <tt>Body</tt> is the <tt>clausebody</tt> that corresponds to <tt>Term</tt>. <pre class="lpdoc-codeblock">clausebody(L) :- literal_ppkey(L). clausebody((L,B)) :- literal_ppkey(L), clausebody(B). </pre></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">REGTYPE</span><a class="lpdoc-idx-anchor" id="literal_ppkey/1" href="ciaopp_ref_mansearch.html#literal_ppkey/1">literal_ppkey/1</a></div><div class="lpdoc-deftext">A regular type, defined as follows:<pre class="lpdoc-codeblock">literal_ppkey(Lit:PPKey) :- cgoal(Lit), litkey(PPKey). literal_ppkey(builtin(B):noinfo) :- cgoal(B). literal_ppkey(!). </pre> </div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">REGTYPE</span><a class="lpdoc-idx-anchor" id="litkey/1" href="ciaopp_ref_mansearch.html#litkey/1">litkey/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>litkey(Key)</tt> </span><p><span class="lpdoc-var">Key</span> is an atom that uniquely identifies a program point of a program clause body literal.</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="clkey/1" href="ciaopp_ref_mansearch.html#clkey/1">clkey/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>clkey(Id)</tt> </span><p><span class="lpdoc-var">Id</span> is an atom that uniquely identifies a program clause.</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="predkey/1" href="ciaopp_ref_mansearch.html#predkey/1">predkey/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>predkey(Id)</tt> </span><p><span class="lpdoc-var">Id</span> is an atom that uniquely identifies a program predicate.</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="counter/3" href="ciaopp_ref_mansearch.html#counter/3">counter/3</a></div><div class="lpdoc-deftext">No further documentation available for this predicate. The predicate is of type <em>data</em>.<br/></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="get_predkey/3" href="ciaopp_ref_mansearch.html#get_predkey/3">get_predkey/3</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>get_predkey(F,A,Key)</tt> </span><p><span class="lpdoc-var">Key</span> is the key corresponding to predicate <span class="lpdoc-var">F</span>/<span class="lpdoc-var">A</span></p><ul class="lpdoc-itemize-minus"><li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="75" href="basic_props.html#atm/1"><tt>atm/1</tt></a>)</span><span><span class="lpdoc-var">F</span> is an atom. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="76" href="basic_props.html#atm/1"><tt>atm/1</tt></a>)</span><span><span class="lpdoc-var">A</span> is an atom. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="77" href="ciaopp_ref_mansearch.html#var/1"><tt>var/1</tt></a>)</span><span><span class="lpdoc-var">Key</span> is a free variable. </span> <li><em>The following properties should hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="78" href="#predkey/1"><tt>predkey/1</tt></a>)</span><span><span class="lpdoc-var">Key</span> is an atom that uniquely identifies a program predicate. </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="get_predkeys/2" href="ciaopp_ref_mansearch.html#get_predkeys/2">get_predkeys/2</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>get_predkeys(Preds,Keys)</tt> </span><p><span class="lpdoc-var">Keys</span> is the list of atoms obtained from <span class="lpdoc-var">Preds</span>.</p><ul class="lpdoc-itemize-minus"><li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="79" href="basic_props.html#list/1"><tt>list/1</tt></a>)</span><span><span class="lpdoc-var">Preds</span> is a list. </span> <li><em>The following properties should hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="80" href="basic_props.html#list/2"><tt>list/2</tt></a>)</span><span><span class="lpdoc-var">Keys</span> is a list of <span class="lpdoc-var">predkey</span>s. </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="predkey_from_sg/2" href="ciaopp_ref_mansearch.html#predkey_from_sg/2">predkey_from_sg/2</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>predkey_from_sg(Sg,Key)</tt> </span><p><span class="lpdoc-var">Key</span> is the key corresponding to functor <span class="lpdoc-var">Sg</span></p><ul class="lpdoc-itemize-minus"><li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="81" href="basic_props.html#term/1"><tt>term/1</tt></a>)</span><span><span class="lpdoc-var">Sg</span> is any term. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="82" href="ciaopp_ref_mansearch.html#var/1"><tt>var/1</tt></a>)</span><span><span class="lpdoc-var">Key</span> is a free variable. </span> <li><em>The following properties should hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="83" href="#predkey/1"><tt>predkey/1</tt></a>)</span><span><span class="lpdoc-var">Key</span> is an atom that uniquely identifies a program predicate. </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="get_clkey/4" href="ciaopp_ref_mansearch.html#get_clkey/4">get_clkey/4</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>get_clkey(F,A,Cl,ClKey)</tt> </span><p><span class="lpdoc-var">ClKey</span> is the key corresponding to clause <span class="lpdoc-var">F</span>/<span class="lpdoc-var">A</span>/<span class="lpdoc-var">Cl</span></p><ul class="lpdoc-itemize-minus"><li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="84" href="basic_props.html#atm/1"><tt>atm/1</tt></a>)</span><span><span class="lpdoc-var">F</span> is an atom. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="85" href="basic_props.html#atm/1"><tt>atm/1</tt></a>)</span><span><span class="lpdoc-var">A</span> is an atom. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="86" href="basic_props.html#atm/1"><tt>atm/1</tt></a>)</span><span><span class="lpdoc-var">Cl</span> is an atom. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="87" href="ciaopp_ref_mansearch.html#var/1"><tt>var/1</tt></a>)</span><span><span class="lpdoc-var">ClKey</span> is a free variable. </span> <li><em>The following properties should hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="88" href="#clkey/1"><tt>clkey/1</tt></a>)</span><span><span class="lpdoc-var">ClKey</span> is an atom that uniquely identifies a program clause. </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="get_litkey/5" href="ciaopp_ref_mansearch.html#get_litkey/5">get_litkey/5</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>get_litkey(F,A,Cl,Lit,ClKey)</tt> </span><p><span class="lpdoc-var">ClKey</span> is the key corresponding to clause <span class="lpdoc-var">F</span>/<span class="lpdoc-var">A</span>/<span class="lpdoc-var">Cl</span>/<span class="lpdoc-var">Lit</span></p><ul class="lpdoc-itemize-minus"><li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="89" href="basic_props.html#atm/1"><tt>atm/1</tt></a>)</span><span><span class="lpdoc-var">F</span> is an atom. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="90" href="basic_props.html#atm/1"><tt>atm/1</tt></a>)</span><span><span class="lpdoc-var">A</span> is an atom. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="91" href="basic_props.html#atm/1"><tt>atm/1</tt></a>)</span><span><span class="lpdoc-var">Cl</span> is an atom. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="92" href="basic_props.html#atm/1"><tt>atm/1</tt></a>)</span><span><span class="lpdoc-var">Lit</span> is an atom. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="93" href="ciaopp_ref_mansearch.html#var/1"><tt>var/1</tt></a>)</span><span><span class="lpdoc-var">ClKey</span> is a free variable. </span> <li><em>The following properties should hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="94" href="#litkey/1"><tt>litkey/1</tt></a>)</span><span><span class="lpdoc-var">ClKey</span> is an atom that uniquely identifies a program point of a program clause body literal. </span> </ul></div></div><p> </div><div id="Documentation on internals"><h2>Documentation on internals</h2><div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="body/1" href="ciaopp_ref_mansearch.html#body/1">body/1</a></div><div class="lpdoc-deftext"><span class="lpdoc-usage-decl"><tt>body(Body)</tt> </span><p><span class="lpdoc-var">Body</span> is a conjunction of simple goals: <pre class="lpdoc-codeblock">body((G,B)) :- cgoal(G), body(B). body(G) :- cgoal(G). </pre></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">REGTYPE</span><a class="lpdoc-idx-anchor" id="drid/1" href="ciaopp_ref_mansearch.html#drid/1">drid/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>drid(Id)</tt> </span><p><span class="lpdoc-var">Id</span> is a number that uniquely identifies a program directive.</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="head/1" href="ciaopp_ref_mansearch.html#head/1">head/1</a></div><div class="lpdoc-deftext">Defined as <pre class="lpdoc-codeblock">head(0). head(1). head(X) :- cgoal(X). </pre><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>head(Head)</tt> </span><p><span class="lpdoc-var">Head</span> is a clause head identifier.</p><ul class="lpdoc-itemize-minus"></ul></div></div><p> </div><div id="Documentation on imports"><h2>Documentation on imports</h2>This module has the following direct dependencies:<ul class="lpdoc-itemize-minus"><li><em>System library modules:</em><br/><a class="lpdoc-idx-anchor" id="95" href="ciaopp_ref_mansearch.html#datafacts_rt"><tt>datafacts_rt</tt></a>, <a class="lpdoc-idx-anchor" id="96" href="ciaopp_ref_mansearch.html#lists"><tt>lists</tt></a>, <a class="lpdoc-idx-anchor" id="97" href="ciaopp_ref_mansearch.html#prednames"><tt>prednames</tt></a>, <a class="lpdoc-idx-anchor" id="98" href="ciaopp_ref_mansearch.html#p_unit_basic"><tt>p_unit_basic</tt></a>. <li><em>Internal (engine) modules:</em><br/><a class="lpdoc-idx-anchor" id="99" href="ciaopp_ref_mansearch.html#term_basic"><tt>term_basic</tt></a>, <a class="lpdoc-idx-anchor" id="100" href="ciaopp_ref_mansearch.html#arithmetic"><tt>arithmetic</tt></a>, <a class="lpdoc-idx-anchor" id="101" href="ciaopp_ref_mansearch.html#atomic_basic"><tt>atomic_basic</tt></a>, <a class="lpdoc-idx-anchor" id="102" href="ciaopp_ref_mansearch.html#basiccontrol"><tt>basiccontrol</tt></a>, <a class="lpdoc-idx-anchor" id="103" href="ciaopp_ref_mansearch.html#exceptions"><tt>exceptions</tt></a>, <a class="lpdoc-idx-anchor" id="104" href="ciaopp_ref_mansearch.html#term_compare"><tt>term_compare</tt></a>, <a class="lpdoc-idx-anchor" id="105" href="ciaopp_ref_mansearch.html#term_typing"><tt>term_typing</tt></a>, <a class="lpdoc-idx-anchor" id="106" href="ciaopp_ref_mansearch.html#debugger_support"><tt>debugger_support</tt></a>, <a class="lpdoc-idx-anchor" id="107" href="basic_props.html"><tt>basic_props</tt></a>, <a class="lpdoc-idx-anchor" id="108" href="ciaopp_ref_mansearch.html#hiord_rt"><tt>hiord_rt</tt></a>, <a class="lpdoc-idx-anchor" id="109" href="ciaopp_ref_mansearch.html#messages_basic"><tt>messages_basic</tt></a>. <li><em>Packages:</em><br/><a class="lpdoc-idx-anchor" id="110" href="ciaopp_ref_mansearch.html#prelude"><tt>prelude</tt></a>, <a class="lpdoc-idx-anchor" id="111" href="ciaopp_ref_mansearch.html#initial"><tt>initial</tt></a>, <a class="lpdoc-idx-anchor" id="112" href="ciaopp_ref_mansearch.html#condcomp"><tt>condcomp</tt></a>, <a class="lpdoc-idx-anchor" id="113" href="assertions_doc.html"><tt>assertions</tt></a>, <a class="lpdoc-idx-anchor" id="114" href="ciaopp_ref_mansearch.html#assertions/assertions_basic"><tt>assertions/assertions_basic</tt></a>, <a class="lpdoc-idx-anchor" id="115" href="ciaopp_ref_mansearch.html#basicmodes"><tt>basicmodes</tt></a>, <a class="lpdoc-idx-anchor" id="116" href="regtypes_doc.html"><tt>regtypes</tt></a>, <a class="lpdoc-idx-anchor" id="117" href="ciaopp_ref_mansearch.html#datafacts"><tt>datafacts</tt></a>. </ul></div></div><div class="lpdoc-footer">Generated with LPdoc using Ciao</div></div><div class="lpdoc-clearer"></div></div></body></html>