UNPKG

@ciao-lang/ts-ciao-interface

Version:

Simple Ciao interface for node.

46 lines 9.26 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>A simple pretty-printer for Ciao programs &mdash; 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">&#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="ExtraLibs.html">&#x2191;</a><a class="lpdoc-navbutton" href="between.html">&#x2190;</a><a class="lpdoc-navbutton" href="assrt_write.html">&#x2192;</a><a class="lpdoc-navbutton" href="ciaosearch.html">&#x1F50D;</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> &raquo;<br/> </li><li><a href="ExtraLibs.html">PART VIII - Additional libraries</a> &raquo;<br/> </li><li><a href=""><strong>A simple pretty-printer for Ciao programs</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>A simple pretty-printer for Ciao programs</h1><a class="lpdoc-idx-anchor" href="ciaosearch.html#pretty_print"></a> <strong>Author(s):</strong> <a class="lpdoc-idx-anchor" id="The Ciao Development Team" href="ciaosearch.html#The Ciao Development Team">The Ciao Development Team</a>.<p> This library module writes out to standard output a clause or a list of clauses.<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(pretty_print)).</tt><li><strong>Exports:</strong><br/><ul class="lpdoc-itemize-minus"><li><em>Predicates:</em><br/><a class="lpdoc-idx-anchor" id="0" href="#pretty_print/2"><tt>pretty_print/2</tt></a>, <a class="lpdoc-idx-anchor" id="1" href="#pretty_print/3"><tt>pretty_print/3</tt></a>, <a class="lpdoc-idx-anchor" id="2" href="#pretty_print/4"><tt>pretty_print/4</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="pretty_print/2" href="ciaosearch.html#pretty_print/2">pretty_print/2</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>pretty_print(Cls,Flags)</tt> </span><p>Prints each clause in the list <span class="lpdoc-var">Cls</span> after numbering its variables.</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="4" href="#clauses/1"><tt>pretty_print:clauses/1</tt></a>)</span><span><a class="lpdoc-idx-anchor" id="3" href="ciaosearch.html#clauses(Cls)"><tt>pretty_print:clauses(Cls)</tt></a> </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="5" href="basic_props.html#list/2"><tt>basic_props:list/2</tt></a>)</span><span><span class="lpdoc-var">Flags</span> is a list of <span class="lpdoc-var">flag</span>s. </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="pretty_print/3" href="ciaosearch.html#pretty_print/3">pretty_print/3</a></div><div class="lpdoc-deftext"><p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>pretty_print(Cls,Flags,Ds)</tt> </span><p>Prints each clause in the list <span class="lpdoc-var">Cls</span> after using the corresponding variable names dictionary in <span class="lpdoc-var">Ds</span> to name its variables.</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="#clauses/1"><tt>pretty_print:clauses/1</tt></a>)</span><span><a class="lpdoc-idx-anchor" id="6" href="ciaosearch.html#clauses(Cls)"><tt>pretty_print:clauses(Cls)</tt></a> </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="8" href="basic_props.html#list/2"><tt>basic_props:list/2</tt></a>)</span><span><span class="lpdoc-var">Flags</span> is a list of <span class="lpdoc-var">flag</span>s. </span><br/><span class="lpdoc-on-right"> (<a class="lpdoc-idx-anchor" id="9" href="vndict.html#varnamedict/1"><tt>vndict:varnamedict/1</tt></a>)</span><span><span class="lpdoc-var">Ds</span> is a dictionary of variable names. </span> </ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">PREDICATE</span><a class="lpdoc-idx-anchor" id="pretty_print/4" href="ciaosearch.html#pretty_print/4">pretty_print/4</a></div><div class="lpdoc-deftext">No further documentation available for this predicate.</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="clauses/1" href="ciaosearch.html#clauses/1">clauses/1</a></div><div class="lpdoc-deftext">A regular type, defined as follows:<pre class="lpdoc-codeblock">clauses([]). clauses([_1|_2]) :- clause(_1), clauses(_2). clauses(_1) :- clause(_1). </pre> </div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">REGTYPE</span><a class="lpdoc-idx-anchor" id="clause/1" href="ciaosearch.html#clause/1">clause/1</a></div><div class="lpdoc-deftext">A regular type, defined as follows:<pre class="lpdoc-codeblock">clause(_1) :- clterm(_1). clause((_1,_2)) :- clterm(_1), term(_2). </pre> </div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">REGTYPE</span><a class="lpdoc-idx-anchor" id="clterm/1" href="ciaosearch.html#clterm/1">clterm/1</a></div><div class="lpdoc-deftext">A regular type, defined as follows:<pre class="lpdoc-codeblock">clterm(clause(_1,_2)) :- cgoal(_1), body(_2). clterm(directive(_1)) :- body(_1). clterm((_1:-_2)) :- cgoal(_1), body(_2). clterm(_1) :- cgoal(_1). </pre> </div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">REGTYPE</span><a class="lpdoc-idx-anchor" id="body/1" href="ciaosearch.html#body/1">body/1</a></div><div class="lpdoc-deftext">A well formed body, including cge expressions and &amp;-concurrent expressions. The atomic goals may or may not have a key in the form <tt>^(goal:any)</tt>, and may or may not be module qualified, but if they are it has to be in the form <tt>^(^(moddesc:goal):any)</tt>.<p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>body(X)</tt> </span><p><span class="lpdoc-var">X</span> is a printable body.</p><ul class="lpdoc-itemize-minus"></ul></div></div><p> <div><div class="lpdoc-defname"><span class="lpdoc-predtag">REGTYPE</span><a class="lpdoc-idx-anchor" id="flag/1" href="ciaosearch.html#flag/1">flag/1</a></div><div class="lpdoc-deftext">A keyword <tt>ask/1</tt> flags whether to output <em>asks</em> or <em>whens</em> and <tt>nl/1</tt> whether to separate clauses with a blank line or not.<p><span class="lpdoc-usage-header">Usage:</span><span class="lpdoc-usage-decl"><tt>flag(X)</tt> </span><p><span class="lpdoc-var">X</span> is a flag for the pretty-printer.</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="10" href="operators.html"><tt>operators</tt></a>, <a class="lpdoc-idx-anchor" id="11" href="vndict.html"><tt>vndict</tt></a>, <a class="lpdoc-idx-anchor" id="12" href="streams.html"><tt>streams</tt></a>, <a class="lpdoc-idx-anchor" id="13" href="write.html"><tt>write</tt></a>. <li><em>Packages:</em><br/><a class="lpdoc-idx-anchor" id="14" href="ciaosearch.html#prelude"><tt>prelude</tt></a>, <a class="lpdoc-idx-anchor" id="15" href="ciaosearch.html#initial"><tt>initial</tt></a>, <a class="lpdoc-idx-anchor" id="16" href="condcomp_doc.html"><tt>condcomp</tt></a>, <a class="lpdoc-idx-anchor" id="17" href="assertions_doc.html"><tt>assertions</tt></a>, <a class="lpdoc-idx-anchor" id="18" href="ciaosearch.html#assertions/assertions_basic"><tt>assertions/assertions_basic</tt></a>, <a class="lpdoc-idx-anchor" id="19" href="regtypes_doc.html"><tt>regtypes</tt></a>, <a class="lpdoc-idx-anchor" id="20" href="fsyntax_doc.html"><tt>fsyntax</tt></a>. </ul></div></div><div class="lpdoc-footer">Generated with LPdoc using Ciao</div></div><div class="lpdoc-clearer"></div></div></body></html>