@ciao-lang/ts-ciao-interface
Version:
Simple Ciao interface for node.
138 lines • 36.5 kB
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>Term output — The Ciao System v1.22</title></head><body><div class="lpdoc-page fixleftbar"><a href="#" id="sidebar-toggle-button" class="lpdoc-navbutton"><span id="sidebar-button-arrow">☰</span></a><div id="sidebar" class="lpdoc-sidebar"><div style="height: 40px; margin-left: auto; margin-right: auto"><img src="ciao-logo_autofig.png" width=auto height=100%></div><div class="lpdoc-nav"><span class="lpdoc-on-right"><a class="lpdoc-navbutton" href="StdLibs.html">↑</a><a class="lpdoc-navbutton" href="read_from_string.html">←</a><a class="lpdoc-navbutton" href="operators.html">→</a><a class="lpdoc-navbutton" href="ciaosearch.html">🔍</a></span><span><a href="ciaofulltoc.html">TOC</a></span></div><hr></hr><ul class="lpdoc-itemize-sectpath"><li><a href="ciao.html">The Ciao System</a> »<br/> </li><li><a href="StdLibs.html">PART VII - Standard libraries</a> »<br/> </li><li><a href=""><strong>Term output</strong></a></li></ul><hr></hr><em>ON THIS PAGE</em><ul><li><a href="#Usage and interface">Usage and interface</a></li><li><a href="#Documentation on exports">Documentation on exports</a></li><li><a href="#Documentation on multifiles">Documentation on multifiles</a></li><li><a href="#Documentation on imports">Documentation on imports</a></li></ul></div><div class="lpdoc-main"><div id=""><h1>Term output</h1><a class="lpdoc-idx-anchor" href="ciaosearch.html#write"></a>
<strong>Author(s):</strong> <a class="lpdoc-idx-anchor" id="Richard A. O'Keefe" href="ciaosearch.html#Richard A. O'Keefe">Richard A. O'Keefe (original version)</a>, <a class="lpdoc-idx-anchor" id="Mats Carlsson" href="ciaosearch.html#Mats Carlsson">Mats Carlsson (changes)</a>, <a class="lpdoc-idx-anchor" id="Daniel Cabeza" href="ciaosearch.html#Daniel Cabeza">Daniel Cabeza (changes)</a>, <a class="lpdoc-idx-anchor" id="Manuel Hermenegildo" href="ciaosearch.html#Manuel Hermenegildo">Manuel Hermenegildo (changes)</a>, <a class="lpdoc-idx-anchor" id="Manuel Carro" href="ciaosearch.html#Manuel Carro">Manuel Carro (changes)</a>.<p>
This library provides different predicates for term output, additional to the kernel predicates <a class="lpdoc-idx-anchor" id="0" href="io_basic.html#display/1"><tt>display/1</tt></a>-<a class="lpdoc-idx-anchor" id="1" href="iso_incomplete.html#display/2"><tt>display/2</tt></a> and <tt>displayq/1</tt>-<tt>displayq/2</tt>. All the predicates defined in ISO-Prolog are included, plus other traditionally provided by Prolog Implementations. Output predicates are provided in two versions: one that uses the current output stream and another in which the stream is specified explicitly, as an additional first argument.<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(write)).</tt><li><strong>Exports:</strong><br/><ul class="lpdoc-itemize-minus"><li><em>Predicates:</em><br/><a class="lpdoc-idx-anchor" id="2" href="iso_incomplete.html#write_term/3"><tt>write_term/3</tt></a>, <a class="lpdoc-idx-anchor" id="3" href="#write_term/2"><tt>write_term/2</tt></a>, <a class="lpdoc-idx-anchor" id="4" href="iso_incomplete.html#write/2"><tt>write/2</tt></a>, <a class="lpdoc-idx-anchor" id="5" href="#write/1"><tt>write/1</tt></a>, <a class="lpdoc-idx-anchor" id="6" href="iso_incomplete.html#writeq/2"><tt>writeq/2</tt></a>, <a class="lpdoc-idx-anchor" id="7" href="#writeq/1"><tt>writeq/1</tt></a>, <a class="lpdoc-idx-anchor" id="8" href="iso_incomplete.html#write_canonical/2"><tt>write_canonical/2</tt></a>, <a class="lpdoc-idx-anchor" id="9" href="#write_canonical/1"><tt>write_canonical/1</tt></a>, <a class="lpdoc-idx-anchor" id="10" href="iso_incomplete.html#print/2"><tt>print/2</tt></a>, <a class="lpdoc-idx-anchor" id="11" href="#print/1"><tt>print/1</tt></a>, <a class="lpdoc-idx-anchor" id="12" href="iso_incomplete.html#printq/2"><tt>printq/2</tt></a>, <a class="lpdoc-idx-anchor" id="13" href="#printq/1"><tt>printq/1</tt></a>, <a class="lpdoc-idx-anchor" id="14" href="iso_incomplete.html#portray_clause/2"><tt>portray_clause/2</tt></a>, <a class="lpdoc-idx-anchor" id="15" href="#portray_clause/1"><tt>portray_clause/1</tt></a>, <a class="lpdoc-idx-anchor" id="16" href="#numbervars/3"><tt>numbervars/3</tt></a>, <a class="lpdoc-idx-anchor" id="17" href="#prettyvars/1"><tt>prettyvars/1</tt></a>, <a class="lpdoc-idx-anchor" id="18" href="#printable_char/1"><tt>printable_char/1</tt></a>, <a class="lpdoc-idx-anchor" id="19" href="#write_attribute/1"><tt>write_attribute/1</tt></a>.
<li><em>Properties:</em><br/><a class="lpdoc-idx-anchor" id="20" href="#write_option/1"><tt>write_option/1</tt></a>.
<li><em>Multifiles:</em><br/><a class="lpdoc-idx-anchor" id="21" href="tokenize.html#define_flag/3"><tt>define_flag/3</tt></a>, <a class="lpdoc-idx-anchor" id="22" href="#portray_attribute/2"><tt>portray_attribute/2</tt></a>, <a class="lpdoc-idx-anchor" id="23" href="#portray/1"><tt>portray/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="write_term/3" href="ciaosearch.html#write_term/3">write_term/3</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><span class="lpdoc-on-right"><span class="lpdoc-iso">ISO</span></span><span><tt>write_term(Stream,Term,OptList)</tt></span>
</span><p>Outputs the term <span class="lpdoc-var">Term</span> to the stream <span class="lpdoc-var">Stream</span>, with the list of write-options <span class="lpdoc-var">OptList</span>. See <a class="lpdoc-idx-anchor" id="24" href="#write_option/1"><tt>write_option/1</tt></a> type for default options.</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="25" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">OptList</span> is currently a term which is not a free variable.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="26" href="stream_basic.html#stream/1"><tt>stream_basic:stream/1</tt></a>)</span><span><span class="lpdoc-var">Stream</span> is an open stream.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="27" href="basic_props.html#term/1"><tt>basic_props:term/1</tt></a>)</span><span><span class="lpdoc-var">Term</span> is any term.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="28" href="basic_props.html#list/2"><tt>basic_props:list/2</tt></a>)</span><span><span class="lpdoc-var">OptList</span> is a list of <span class="lpdoc-var">write_option</span>s.
</span>
<li><em>The following properties should hold globally:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="29" href="basic_props.html#not_further_inst/2"><tt>basic_props:not_further_inst/2</tt></a>)</span><span><span class="lpdoc-var">Stream</span> is not further instantiated.
</span>
</ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="write_term/2" href="ciaosearch.html#write_term/2">write_term/2</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><span class="lpdoc-on-right"><span class="lpdoc-iso">ISO</span></span><span><tt>write_term(Term,OptList)</tt></span>
</span><p>Behaves like <tt>current_output(S), write_term(S,Term,OptList)</tt>.</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="30" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">OptList</span> is currently a term which is not a free variable.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="31" href="basic_props.html#term/1"><tt>basic_props:term/1</tt></a>)</span><span><span class="lpdoc-var">Term</span> is any term.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="32" href="basic_props.html#list/2"><tt>basic_props:list/2</tt></a>)</span><span><span class="lpdoc-var">OptList</span> is a list of <span class="lpdoc-var">write_option</span>s.
</span>
</ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PROPERTY</span><a class="lpdoc-idx-anchor" id="write_option/1" href="ciaosearch.html#write_option/1">write_option/1</a></div><div class="lpdoc-deftext"><span class="lpdoc-var">Opt</span> is a valid write option which affects the predicate <tt>write_term/3</tt> and similar ones. Possible write_options are: <ul> <li><strong>quoted(</strong><em>bool</em><strong>):</strong> If <em>bool</em> is <tt>true</tt>, atoms and functors that can't be read back by <a class="lpdoc-idx-anchor" id="33" href="iso_incomplete.html#read_term/3"><tt>read_term/3</tt></a> are quoted, if it is <tt>false</tt>, each atom and functor is written as its name. Default value is <tt>false</tt>.<p><li><strong>ignore_ops(</strong><em>flag</em><strong>):</strong> If <em>flag</em> is <tt>true</tt>, each compound term is output in functional notation, if it is <tt>ops</tt>, curly bracketed notation and list notation is enabled when outputing compound terms, if it is <tt>false</tt>, also operator notation is enabled when outputing compound terms. Default value is <tt>false</tt>.<p><li><strong>numbervars(</strong><em>bool</em><strong>):</strong> If <em>bool</em> is <tt>true</tt>, a term of the form <tt>'$VAR'(N)</tt> where <tt>N</tt> is an integer, is output as a variable name consisting of a capital letter possibly followed by an integer, a term of the form <tt>'$VAR'(Atom)</tt> where <tt>Atom</tt> is an atom, as this atom (without quotes), and a term of the form <tt>'$VAR'(String)</tt> where <tt>String</tt> is a character string, as the atom corresponding to this character string. See predicates <tt>numbervars/3</tt> and <tt>prettyvars/1</tt>. If <em>bool</em> is <tt>false</tt> this cases are not treated in any special way. Default value is <tt>false</tt>.<p><li><strong>portrayed(</strong><em>bool</em><strong>):</strong> If <em>bool</em> is <tt>true</tt>, then call multifile predicates <a class="lpdoc-idx-anchor" id="34" href="#portray/1"><tt>portray/1</tt></a> and <a class="lpdoc-idx-anchor" id="35" href="#portray_attribute/2"><tt>portray_attribute/2</tt></a>, to provide the user handlers for pretty printing some terms. <tt>portray_attribute/2</tt> is called whenever an attributed variable is to be printed, <tt>portray/1</tt> is called whenever a non-variable term is to be printed. If either call succeeds, then it is assumed that the term has been output, else it is printed as usual. If <em>bool</em> is <tt>false</tt>, these predicates are not called. Default value is <tt>false</tt>. This option is set by the toplevel when writing the final values of variables, and by the debugging package when writing the goals in the tracing messages. Thus you can vary the forms of these messages if you wish.<p><li><strong>max_depth(</strong><em>depth</em><strong>):</strong> <em>depth</em> is a positive integer or cero. If it is positive, it denotes the depth limit on printing compound terms. If it is cero, there is no limit. Default value is <tt>0</tt> (no limit).<p><li><strong>priority(</strong><em>prio</em><strong>):</strong> <em>prio</em> is an integer between 1 and 1200. If the term to be printed has higher priority than <em>prio</em>, it will be printed parenthesized. Default value is 1200 (no term parenthesized).<p></ul>.<p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>write_option(Opt)</tt>
</span><p><span class="lpdoc-var">Opt</span> is a valid write option.</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="write/2" href="ciaosearch.html#write/2">write/2</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><span class="lpdoc-on-right"><span class="lpdoc-iso">ISO</span></span><span><tt>write(Stream,Term)</tt></span>
</span><p>Behaves like <tt>write_term(Stream, Term, [numbervars(true)])</tt>.</p><ul class="lpdoc-itemize-minus"><li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="36" href="stream_basic.html#stream/1"><tt>stream_basic:stream/1</tt></a>)</span><span><span class="lpdoc-var">Stream</span> is an open stream.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="37" href="basic_props.html#term/1"><tt>basic_props:term/1</tt></a>)</span><span><span class="lpdoc-var">Term</span> is any term.
</span>
<li><em>The following properties hold globally:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="38" href="basic_props.html#not_further_inst/2"><tt>basic_props:not_further_inst/2</tt></a>)</span><span><span class="lpdoc-var">Stream</span> is not further instantiated.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="39" href="native_props_nfdet_doc.html#is_det/1"><tt>native_props:is_det/1</tt></a>)</span><span>All calls of the form <span class="lpdoc-var">write(Stream,Term)</span> are deterministic.
</span>
</ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="write/1" href="ciaosearch.html#write/1">write/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><span class="lpdoc-on-right"><span class="lpdoc-iso">ISO</span></span><span><tt>write(Term)</tt></span>
</span><p>Behaves like <tt>current_output(S), write(S,Term)</tt>.</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="40" href="basic_props.html#term/1"><tt>basic_props:term/1</tt></a>)</span><span><span class="lpdoc-var">Term</span> is any term.
</span>
<li><em>The following properties hold globally:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="41" href="native_props_nfdet_doc.html#is_det/1"><tt>native_props:is_det/1</tt></a>)</span><span>All calls of the form <span class="lpdoc-var">write(Term)</span> are deterministic.
</span>
</ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="writeq/2" href="ciaosearch.html#writeq/2">writeq/2</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><span class="lpdoc-on-right"><span class="lpdoc-iso">ISO</span></span><span><tt>writeq(Stream,Term)</tt></span>
</span><p>Behaves like <tt>write_term(Stream, Term, [quoted(true), numbervars(true)])</tt>.</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="stream_basic.html#stream/1"><tt>stream_basic:stream/1</tt></a>)</span><span><span class="lpdoc-var">Stream</span> is an open stream.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="43" href="basic_props.html#term/1"><tt>basic_props:term/1</tt></a>)</span><span><span class="lpdoc-var">Term</span> is any term.
</span>
<li><em>The following properties hold globally:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="44" href="basic_props.html#not_further_inst/2"><tt>basic_props:not_further_inst/2</tt></a>)</span><span><span class="lpdoc-var">Stream</span> is not further instantiated.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="45" href="native_props_nfdet_doc.html#is_det/1"><tt>native_props:is_det/1</tt></a>)</span><span>All calls of the form <span class="lpdoc-var">writeq(Stream,Term)</span> are deterministic.
</span>
</ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="writeq/1" href="ciaosearch.html#writeq/1">writeq/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><span class="lpdoc-on-right"><span class="lpdoc-iso">ISO</span></span><span><tt>writeq(Term)</tt></span>
</span><p>Behaves like <tt>current_output(S), writeq(S,Term)</tt>.</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="46" href="basic_props.html#term/1"><tt>basic_props:term/1</tt></a>)</span><span><span class="lpdoc-var">Term</span> is any term.
</span>
<li><em>The following properties hold globally:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="47" href="native_props_nfdet_doc.html#is_det/1"><tt>native_props:is_det/1</tt></a>)</span><span>All calls of the form <span class="lpdoc-var">writeq(Term)</span> are deterministic.
</span>
</ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="write_canonical/2" href="ciaosearch.html#write_canonical/2">write_canonical/2</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><span class="lpdoc-on-right"><span class="lpdoc-iso">ISO</span></span><span><tt>write_canonical(Stream,Term)</tt></span>
</span><p>Behaves like <tt>write_term(Stream, Term, [quoted(true), ignore_ops(true)])</tt>. The output of this predicate can always be parsed by <a class="lpdoc-idx-anchor" id="48" href="read.html#read_term/2"><tt>read_term/2</tt></a> even if the term contains special characters or if operator declarations have changed.</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="49" href="stream_basic.html#stream/1"><tt>stream_basic:stream/1</tt></a>)</span><span><span class="lpdoc-var">Stream</span> is an open stream.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="50" href="basic_props.html#term/1"><tt>basic_props:term/1</tt></a>)</span><span><span class="lpdoc-var">Term</span> is any term.
</span>
<li><em>The following properties should hold globally:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="51" href="basic_props.html#not_further_inst/2"><tt>basic_props:not_further_inst/2</tt></a>)</span><span><span class="lpdoc-var">Stream</span> is not further instantiated.
</span>
</ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="write_canonical/1" href="ciaosearch.html#write_canonical/1">write_canonical/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><span class="lpdoc-on-right"><span class="lpdoc-iso">ISO</span></span><span><tt>write_canonical(Term)</tt></span>
</span><p>Behaves like <tt>current_output(S), write_canonical(S,Term)</tt>.</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="52" href="basic_props.html#term/1"><tt>basic_props:term/1</tt></a>)</span><span><span class="lpdoc-var">Term</span> is any term.
</span>
</ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="print/2" href="ciaosearch.html#print/2">print/2</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>print(Stream,Term)</tt>
</span><p>Behaves like <tt>write_term(Stream, Term, [numbervars(true), portrayed(true)])</tt>.</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="53" href="stream_basic.html#stream/1"><tt>stream_basic:stream/1</tt></a>)</span><span><span class="lpdoc-var">Stream</span> is an open stream.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="54" href="basic_props.html#term/1"><tt>basic_props:term/1</tt></a>)</span><span><span class="lpdoc-var">Term</span> is any term.
</span>
<li><em>The following properties should hold globally:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="55" href="basic_props.html#not_further_inst/2"><tt>basic_props:not_further_inst/2</tt></a>)</span><span><span class="lpdoc-var">Stream</span> is not further instantiated.
</span>
</ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="print/1" href="ciaosearch.html#print/1">print/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>print(Term)</tt>
</span><p>Behaves like <tt>current_output(S), print(S,Term)</tt>.</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="56" href="basic_props.html#term/1"><tt>basic_props:term/1</tt></a>)</span><span><span class="lpdoc-var">Term</span> is any term.
</span>
</ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="printq/2" href="ciaosearch.html#printq/2">printq/2</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>printq(Stream,Term)</tt>
</span><p>Behaves like <tt>write_term(Stream, Term, [quoted(true), numbervars(true), portrayed(true)])</tt>.</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="57" href="stream_basic.html#stream/1"><tt>stream_basic:stream/1</tt></a>)</span><span><span class="lpdoc-var">Stream</span> is an open stream.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="58" href="basic_props.html#term/1"><tt>basic_props:term/1</tt></a>)</span><span><span class="lpdoc-var">Term</span> is any term.
</span>
<li><em>The following properties should hold globally:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="59" href="basic_props.html#not_further_inst/2"><tt>basic_props:not_further_inst/2</tt></a>)</span><span><span class="lpdoc-var">Stream</span> is not further instantiated.
</span>
</ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="printq/1" href="ciaosearch.html#printq/1">printq/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>printq(Term)</tt>
</span><p>Behaves like <tt>current_output(S), printq(S,Term)</tt>.</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="60" href="basic_props.html#term/1"><tt>basic_props:term/1</tt></a>)</span><span><span class="lpdoc-var">Term</span> is any term.
</span>
</ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="portray_clause/2" href="ciaosearch.html#portray_clause/2">portray_clause/2</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>portray_clause(Stream,Clause)</tt>
</span><p>Outputs the clause <span class="lpdoc-var">Clause</span> onto <span class="lpdoc-var">Stream</span>, pretty printing its variables and using indentation, including a period at the end. This predicate is used by <tt>listing/0</tt>.</p><ul class="lpdoc-itemize-minus"><li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="61" href="stream_basic.html#stream/1"><tt>stream_basic:stream/1</tt></a>)</span><span><span class="lpdoc-var">Stream</span> is an open stream.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="62" href="basic_props.html#term/1"><tt>basic_props:term/1</tt></a>)</span><span><span class="lpdoc-var">Clause</span> is any term.
</span>
<li><em>The following properties should hold globally:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="63" href="basic_props.html#not_further_inst/2"><tt>basic_props:not_further_inst/2</tt></a>)</span><span><span class="lpdoc-var">Stream</span> is not further instantiated.
</span>
</ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="portray_clause/1" href="ciaosearch.html#portray_clause/1">portray_clause/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>portray_clause(Clause)</tt>
</span><p>Behaves like <tt>current_output(S), portray_clause(S,Term)</tt>.</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="64" href="basic_props.html#term/1"><tt>basic_props:term/1</tt></a>)</span><span><span class="lpdoc-var">Clause</span> is any term.
</span>
</ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="numbervars/3" href="ciaosearch.html#numbervars/3">numbervars/3</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>numbervars(Term,N,M)</tt>
</span><p>Unifies each of the variables in term <span class="lpdoc-var">Term</span> with a term of the form <tt>'$VAR'(I)</tt> where <tt>I</tt> is an integer from <span class="lpdoc-var">N</span> onwards. <span class="lpdoc-var">M</span> is unified with the last integer used plus 1. If the resulting term is output with a write option <tt>numbervars(true)</tt>, in the place of the variables in the original term will be printed a variable name consisting of a capital letter possibly followed by an integer. When <span class="lpdoc-var">N</span> is 0 you will get the variable names A, B, ..., Z, A1, B1, etc.</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="65" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">N</span> is currently a term which is not a free variable.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="66" href="basic_props.html#term/1"><tt>basic_props:term/1</tt></a>)</span><span><span class="lpdoc-var">Term</span> is any term.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="67" href="basic_props.html#int/1"><tt>basic_props:int/1</tt></a>)</span><span><span class="lpdoc-var">N</span> is an integer.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="68" href="basic_props.html#term/1"><tt>basic_props:term/1</tt></a>)</span><span><span class="lpdoc-var">M</span> is any term.
</span>
<li><em>The following properties should hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="69" href="basic_props.html#term/1"><tt>basic_props:term/1</tt></a>)</span><span><span class="lpdoc-var">Term</span> is any term.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="70" href="basic_props.html#int/1"><tt>basic_props:int/1</tt></a>)</span><span><span class="lpdoc-var">N</span> is an integer.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="71" href="basic_props.html#int/1"><tt>basic_props:int/1</tt></a>)</span><span><span class="lpdoc-var">M</span> is an integer.
</span>
</ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="prettyvars/1" href="ciaosearch.html#prettyvars/1">prettyvars/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>prettyvars(Term)</tt>
</span><p>Similar to <tt>numbervars(Term,0,_)</tt>, except that singleton variables in <span class="lpdoc-var">Term</span> are unified with <tt>'$VAR'('_')</tt>, so that when the resulting term is output with a write option <tt>numbervars(true)</tt>, in the place of singleton variables <tt>_</tt> is written. This predicate is used by <a class="lpdoc-idx-anchor" id="72" href="iso_incomplete.html#portray_clause/2"><tt>portray_clause/2</tt></a>.</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="73" href="basic_props.html#term/1"><tt>basic_props:term/1</tt></a>)</span><span><span class="lpdoc-var">Term</span> is any term.
</span>
</ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="printable_char/1" href="ciaosearch.html#printable_char/1">printable_char/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>printable_char(Char)</tt>
</span><p><span class="lpdoc-var">Char</span> is the code of a character which can be printed.</p><ul class="lpdoc-itemize-minus"><li><em>The following properties should hold at call time:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="74" href="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">Char</span> is currently a term which is not a free variable.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="75" href="basic_props.html#character_code/1"><tt>basic_props:character_code/1</tt></a>)</span><span><span class="lpdoc-var">Char</span> is an integer which is a character code.
</span>
</ul></div></div><p>
<div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="write_attribute/1" href="ciaosearch.html#write_attribute/1">write_attribute/1</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="define_flag/3" href="ciaosearch.html#define_flag/3">define_flag/3</a></div><div class="lpdoc-deftext">Defines flags as follows: <pre class="lpdoc-codeblock">define_flag(write_strings,[on,off],off).
</pre> (See <a href="runtime_control.html">Runtime system control and flags</a>).<p>If flag is <tt>on</tt>, lists which may be written as strings are.<p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>define_flag(Flag,FlagValues,Default)</tt>
</span><p></p><ul class="lpdoc-itemize-minus"><li><em>The following properties hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="76" href="basic_props.html#atm/1"><tt>basic_props:atm/1</tt></a>)</span><span><span class="lpdoc-var">Flag</span> is an atom.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="77" href="basic_props.html#flag_values/1"><tt>basic_props:flag_values/1</tt></a>)</span><span>Define the valid flag values
</span>
</ul>
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="portray_attribute/2" href="ciaosearch.html#portray_attribute/2">portray_attribute/2</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>portray_attribute(Attr,Var)</tt>
</span><p><em>A user defined predicate.</em> When an attributed variable <span class="lpdoc-var">Var</span> is about to be printed, this predicate receives the variable and its attribute <span class="lpdoc-var">Attr</span>. The predicate should either print something based on <span class="lpdoc-var">Attr</span> or <span class="lpdoc-var">Var</span>, or do nothing and fail. In the latter case, the default printer (<a class="lpdoc-idx-anchor" id="78" href="#write/1"><tt>write/1</tt></a>) will print the attributed variable like an unbound variable, e.g. <tt>_673</tt>.</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="term_typing.html#nonvar/1"><tt>term_typing:nonvar/1</tt></a>)</span><span><span class="lpdoc-var">Attr</span> is currently a term which is not a free variable.
</span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="80" href="term_typing.html#var/1"><tt>term_typing:var/1</tt></a>)</span><span><span class="lpdoc-var">Var</span> is a free variable.
</span>
</ul>
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="portray/1" href="ciaosearch.html#portray/1">portray/1</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>portray(T)</tt>
</span><p><em>A user defined predicate.</em> This should either print the <span class="lpdoc-var">Term</span> and succeed, or do nothing and fail. In the latter case, the default printer (<tt>write/1</tt>) will print the <span class="lpdoc-var">Term</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>basic_props:term/1</tt></a>)</span><span><span class="lpdoc-var">T</span> is any term.
</span>
<li><em>The following properties hold upon exit:</em><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="82" href="basic_props.html#term/1"><tt>basic_props:term/1</tt></a>)</span><span><span class="lpdoc-var">T</span> is any term.
</span>
</ul>
The predicate is <em>multifile</em>.<br/></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="83" href="ciaosearch.html#native_props"><tt>native_props</tt></a>, <a class="lpdoc-idx-anchor" id="84" href="operators.html"><tt>operators</tt></a>, <a class="lpdoc-idx-anchor" id="85" href="sort.html"><tt>sort</tt></a>.
<li><em>Packages:</em><br/><a class="lpdoc-idx-anchor" id="86" href="ciaosearch.html#prelude"><tt>prelude</tt></a>, <a class="lpdoc-idx-anchor" id="87" href="ciaosearch.html#initial"><tt>initial</tt></a>, <a class="lpdoc-idx-anchor" id="88" href="condcomp_doc.html"><tt>condcomp</tt></a>, <a class="lpdoc-idx-anchor" id="89" href="assertions_doc.html"><tt>assertions</tt></a>, <a class="lpdoc-idx-anchor" id="90" href="ciaosearch.html#assertions/assertions_basic"><tt>assertions/assertions_basic</tt></a>, <a class="lpdoc-idx-anchor" id="91" href="ciaosearch.html#nortchecks"><tt>nortchecks</tt></a>, <a class="lpdoc-idx-anchor" id="92" href="ciaosearch.html#nativeprops"><tt>nativeprops</tt></a>, <a class="lpdoc-idx-anchor" id="93" href="isomodes_doc.html"><tt>isomodes</tt></a>, <a class="lpdoc-idx-anchor" id="94" href="ciaosearch.html#define_flag"><tt>define_flag</tt></a>.
</ul></div></div><div class="lpdoc-footer">Generated with LPdoc using Ciao</div></div><div class="lpdoc-clearer"></div></div></body></html>