@ciao-lang/ts-ciao-interface
Version:
Simple Ciao interface for node.
3 lines • 8.8 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>PART IV - CiaoPP Internals — 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">☰</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="ciaopp_ref_man.html">↑</a><a class="lpdoc-navbutton" href="domains.html">←</a><a class="lpdoc-navbutton" href="frontend_driver.html">→</a><a class="lpdoc-navbutton" href="ciaopp_ref_mansearch.html">🔍</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> »<br/> </li><li><a href=""><strong>PART IV - CiaoPP Internals</strong></a> ▾<ul><li><a href="frontend_driver.html">Frontend driver (monolithic)</a></li><li><a href="analyze_driver.html">Analyze driver (monolithic)</a></li><li><a href="transform_driver.html">Transform driver (monolithic)</a></li><li><a href="intermod.html">Modular driver</a></li><li><a href="preprocess_flags.html">Preprocessing Flags</a></li><li><a href="Debug_plai.html">Debugging PLAI analyses</a></li><li><a href="incanal.html">Incremental analysis (high level)</a></li><li><a href="Punit.html">The Preprocessing Unit Component</a></li><li><a href="Infer1.html">The Global Information Server</a></li><li><a href="Plai1.html">The Abstract Interpretation Component -PLAI</a></li><li><a href="DebugFixp.html">Debugging the fixpoint operations</a></li><li><a href="ciaopp_batch.html">Batch analysis client</a></li></ul></li></ul><hr></hr><em>ON THIS PAGE</em><ul><li><a href="#How to use CiaoPP in your own preprocessor">How to use CiaoPP in your own preprocessor</a></li><li><a href="#Other information">Other information</a></li><li><a href="#Basic structure of the code">Basic structure of the code</a></li></ul></div><div class="lpdoc-main"><div id=""><h1>PART IV - CiaoPP Internals</h1>
CiaoPP is provided as a module that can be either loaded in the shell or imported into a user program module. There are predicates that activate each option, a predicate to load the file to be processed, and predicates to perform the action of each task of CiaoPP.<p>This document describes the structure of the code of CiaoPP, its components (each performing a task), and their functionality, from the point of view of the implementor, not of the user.<p><div id="How to use CiaoPP in your own preprocessor"><h2>How to use CiaoPP in your own preprocessor</h2> <p>If you implement a program for preprocessing Ciao programs, you can take advantage of the facilities provided by CiaoPP. The basic facilities are described in the following three chapters. In particular, the chapter on module <a class="lpdoc-idx-anchor" id="0" href="ciaopp_ref_mansearch.html#driver"><tt>driver</tt></a> explains how to integrate your tool and CiaoPP to make them work together.<p>One particularly useful feature of CiaoPP is that it provides for the correct reading of an input program to be preprocessed (this is more tricky than it seems, because of all of the language features that the program might be using). Once a program is read in by CiaoPP, your tool can process it as plain Prolog. The chapter on module <a class="lpdoc-idx-anchor" id="1" href="p_unit.html"><tt>p_unit</tt></a> explains how a program is (correctly) read in, and provides an interface so that you can retrieve information about that program.<p>Depending on the kind of preprocessing you want to do, you may want to use other parts of CiaoPP. If your program is doing program transformations, then the chapters on <a class="lpdoc-idx-anchor" id="2" href="program_keys.html"><tt>program_keys</tt></a> and <a class="lpdoc-idx-anchor" id="3" href="tr_syntax.html"><tt>tr_syntax</tt></a> might be helpful. If you want to use analysis information to help the transformations, then the chapter on <a class="lpdoc-idx-anchor" id="4" href="infer.html"><tt>infer</tt></a> is the one to read. If your program is a program analyzer based on abstract interpretation, then have a look at the chapters on <a class="lpdoc-idx-anchor" id="5" href="plai.html"><tt>plai</tt></a> and <a class="lpdoc-idx-anchor" id="6" href="domains.html"><tt>domains</tt></a>. Program analyses not based on abstract interpretation (and other possible tools) may be a bit harder to incorporate: you might need to develop first your skills with the CiaoPP code... </div><br/><h2>Subparts</h2><ul><li><a href="frontend_driver.html">Frontend driver (monolithic)</a></li><li><a href="analyze_driver.html">Analyze driver (monolithic)</a></li><li><a href="transform_driver.html">Transform driver (monolithic)</a></li><li><a href="intermod.html">Modular driver</a></li><li><a href="preprocess_flags.html">Preprocessing Flags</a></li><li><a href="Debug_plai.html">Debugging PLAI analyses</a></li><li><a href="incanal.html">Incremental analysis (high level)</a></li><li><a href="Punit.html">The Preprocessing Unit Component</a></li><li><a href="Infer1.html">The Global Information Server</a></li><li><a href="Plai1.html">The Abstract Interpretation Component -PLAI</a></li><li><a href="DebugFixp.html">Debugging the fixpoint operations</a></li><li><a href="ciaopp_batch.html">Batch analysis client</a></li></ul><div id="Other information"><h2>Other information</h2>
The work of CiaoPP is focused on one-module-at-a-time. The file being preprocessed at a given time is called the <em>current module</em> <a class="lpdoc-idx-anchor" id="7" href="ciaopp_ref_mansearch.html#current module"></a>. If the file is of the user module, it is considered as a module which exports all its predicates.<p>The preprocessing unit is the code of the current module together with the set of assertions / properties which allows a correct and complete interpretation of the assertions present for the current module. Assertions and properties are usually cached in auxiliary files, which are called the .asr files.<p><div id="Basic structure of the code"><h2>Basic structure of the code</h2> <p>The code of CiaoPP is divided into <em>components</em>, each of which provides a particular functionality. The top-level organization of the main components is as follows:<p><img src="ciaopp_autofig.png"> <p>Each component is addressed by a particular qualifier, which makes reference to modules independent of the particular library paths. These qualifiers are defined in file <a class="lpdoc-idx-anchor" id="8" href="ciaopp_ref_mansearch.html#paths.pl"><tt>paths.pl</tt></a>. The qualifier for the top-level components is <a class="lpdoc-idx-anchor" id="9" href="ciaopp.html"><tt>ciaopp</tt></a>.<p>The component <a class="lpdoc-idx-anchor" id="10" href="p_unit.html"><tt>p_unit</tt></a> is addressed by qualifier <span class="lpdoc-var">program</span> and is in charge of processing the .asr files, gathering together the code for the preprocessing unit of the current module.<p>The component <a class="lpdoc-idx-anchor" id="11" href="tr_syntax.html"><tt>tr_syntax</tt></a> is addressed by qualifier <span class="lpdoc-var">syntax</span> and implements simple source code syntactic transformations (like removing disjunctions and the like).<p>The component <a class="lpdoc-idx-anchor" id="12" href="infer.html"><tt>infer</tt></a> is addressed by qualifier <span class="lpdoc-var">infer</span> and is in charge of serving all known semantic information on the current module, from any analysis and/or assertion.<p>The component <a class="lpdoc-idx-anchor" id="13" href="plai.html"><tt>plai</tt></a> is addressed by qualifier <span class="lpdoc-var">plai</span> and implements abstract interpretation based analysis.<p>The component <a class="lpdoc-idx-anchor" id="14" href="ciaopp_ref_mansearch.html#infernf"><tt>infernf</tt></a> is addressed by qualifier <span class="lpdoc-var">infernf</span> and implements the non-failure analysis.<p>The component <a class="lpdoc-idx-anchor" id="15" href="ciaopp_ref_mansearch.html#infercost"><tt>infercost</tt></a> is addressed by qualifier <span class="lpdoc-var">infercost</span> and implements the cost analysis.<p></div><br/></div></div><div class="lpdoc-footer">Generated with LPdoc using Ciao</div></div><div class="lpdoc-clearer"></div></div></body></html>