CiaoDE 1.15 1638 g0c71169 - Ciaopp
CiaoDE 1.15 1638 g0c71169 - Ciaopp
Edited by:
Francisco Bueno
Manuel Hermenegildo
Pedro López
Germán Puebla
Table of Contents
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1 How to use this manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Note . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 Installation (ciaopp) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.4 Software Requirements (ciaode) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.5 Obtaining the Sources (ciaode) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.6 Quick Installation from Source (ciaode) . . . . . . . . . . . . . . . . . . . . . . . 5
1.7 Custom Installations (ciaode) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.8 Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.9 CiaoPP interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
functor1/2 (udreexp) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.3 Documentation on multifiles (auto_interface) . . . . . . . . . . . . . . . 16
hook menu flag values/3 (pred). . . . . . . . . . . . . . . . . . . . . 16
hook menu check flag value/3 (pred) . . . . . . . . . . . . . . . . 16
hook menu flag help/3 (pred) . . . . . . . . . . . . . . . . . . . . . . 16
hook menu default option/3 (pred) . . . . . . . . . . . . . . . . . 16
2.4 Known bugs and planned improvements (auto_interface) . . . . 17
check/1 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
trust/1 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
true/1 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
false/1 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
Summary
CiaoPP is the abstract interpretation-based preprocessor of the Ciao multi-paradigm program
development environment. CiaoPP can perform a number of program debugging, analysis, and
source-to-source transformation tasks on (Ciao) Prolog programs. These tasks include:
• Inference of properties of the predicates and literals of the program, including types,
modes and other variable instantiation properties, non-failure, determinacy, bounds on
computational cost, bounds on sizes of terms in the program, etc.
• Certain kinds of static debugging and verification, finding errors before running the program.
This includes checking how programs call system library predicates and also checking the
assertions present in the program or in other modules used by the program. Such assertions
represent essentially partial specifications of the program.
• Several kinds of source to source program transformations such as program specialization,
slicing, partial evaluation of a program, program parallelization (taking granularity control
into account), inclusion of run-time tests for assertions which cannot be checked completely
at compile-time, etc.
• The abstract model of the program inferred by the analyzers is used in the system to certify
that an untrusted mobile code is safe w.r.t. the given policy (i.e., an abstraction-carrying
code approach to mobile code safety).
The information generated by analysis, the assertions in the system specifications are all writ-
ten in the same assertion language, which is in turn also used by the Ciao system documentation
generator, lpdoc.
CiaoPP is distributed under the GNU general public license.
2 The Ciao Preprocessor
Chapter 1: Introduction 3
1 Introduction
CiaoPP is the abstract interpretation-based preprocessor of the Ciao multi-paradigm program
development environment. CiaoPP can perform a number of program debugging, analysis, and
source-to-source transformation tasks on (Ciao) Prolog programs. These tasks include:
• Inference of properties of the predicates and literals of the program, including types,
modes and other variable instantiation properties, non-failure, determinacy, bounds on
computational cost, bounds on sizes of terms in the program, etc.
• Certain kinds of static debugging and verification, finding errors before running the program.
This includes checking how programs call system library predicates and also checking the
assertions present in the program or in other modules used by the program. Such assertions
represent essentially partial specifications of the program.
• Several kinds of source to source program transformations such as program specialization,
slicing, partial evaluation of a program, program parallelization (taking granularity control
into account), inclusion of run-time tests for assertions which cannot be checked completely
at compile-time, etc.
• The abstract model of the program inferred by the analyzers is used in the system to certify
that an untrusted mobile code is safe w.r.t. the given policy (i.e., an abstraction-carrying
code approach to mobile code safety).
The information generated by analysis, the assertions in the system specifications are all writ-
ten in the same assertion language, which is in turn also used by the Ciao system documentation
generator, lpdoc.
CiaoPP is distributed under the GNU general public license.
1.2 Note
We are in the process of merging all CiaoPP functionality into the 1.2 version. In the
meantime, the current distribution is marked as alpha and you may find that some functionality
documented in this manual is not available or not working properly. Please bear with us in the
meantime. Sorry for any inconvenience.
procedure for the Ciao Development Environment, including libraries and manuals, from a source
distribution. This applies primarily to Unix-type systems (Linux, Mac OS X, Solaris, SunOS,
etc.), and with some limitations to Windows (using the Cygnus Win32 development libraries).
It is recommended that you read the INSTALLATION file that comes with each component of
CiaoDE. However, in many cases it suffices to follow this summary:
Except for the first and last lines, which refer to loading or saving a menu configuration (a pre-
determined set of selected values for the different menu options), each line corresponds to an op-
tion you can select, each having several possible values. You can select either analysis (analyze)
or assertion checking (check_assertions) or certificate checking (check_certificate) or pro-
gram optimization (optimize), and you can later combine the four kinds of preprocessing. The
relevant options for the action group selected are then shown, together with the relevant flags.
A description of the values for each option will be given as it is used in the corresponding section
of this manual.
CiaoPP can help you to analyze your program, in order to infer properties of the predicates
and literals in your program (which might be useful in the subsequent steps during the same
session). You can use Cost Analysis to infer both lower and upper bounds on the computational
time cost and sizes of terms of procedures in a program. Mode Analyses obtain at compile-time
accurate variable groundness and sharing information and other variable instantiation properties.
Type Analysis infers regular types. Regular types are explained in detail in Chapter 8 [Declaring
regular types], page 63. Non-failure and Determinacy Analyses detect procedures and goals that
can be guaranteed to not fail and/or to be deterministic.
Chapter 1: Introduction 7
CiaoPP also can help to optimize your program (by means of source-to-source program trans-
formations), using program specialization, partial evaluation, program parallelization and gran-
ularity control, and other program transformations. Specialization can help to simplify your
program w.r.t. the analysis information (eliminating dead code, predicates that are guaranteed
to either succeed or fail, etc.), specialize it and then simplify it, or just specialize it, i.e., to
unfold all versions of the predicates in your program. CiaoPP can also perform automatic par-
allelization of your source program during precompilation using several annotation algorithms,
and granularity control on parallel programs, transforming the program in order to perform
run–time granularity control, i.e., deciding parallel or sequential execution of goals depending
on the estimated amount of work under them (estimated by cost analysis).
CiaoPP also helps in debugging your programs. It makes possible to perform static debugging,
i.e., finding errors at compile-time, before running the program, and also dynamic debugging,
in the sense of including run-time tests that will perform the checking for errors at run-time.
Static debugging is performed by assertion checking. This includes checking the ways in which
programs call the system library predicates and also checking the assertions present in the
program or in other modules used by the program. Such assertions essentially represent partial
specifications of the program. For dynamic checking, CiaoPP will include run-time tests for the
parts of assertions which cannot be checked completely at compile-time.
Chapter 5 [Using assertions for preprocessing programs], page 37, gives an overview on the
use of the assertion language in CiaoPP. In that chapter and the following ones, several existing
properties that can be used in assertions are described. Programmers can also define their own
properties (see the abovementioned chapters).
☛ ✟
✡ ✠
10 The Ciao Preprocessor
Chapter 2: The CiaoPP user menu interface 11
customize/0: PREDICATE
Usage:
Enter an interactive menu to select the preprocessing action (analysis / assertion checking
/ transformation / optimization / ...) to be performed by deafult and the different options
(i.e., setting the preprocessor flags).
customize/1: PREDICATE
Usage: customize(X)
Customize is used for changing the values of a set of flags. These flags are grouped
into analyze, check assertions and optimize. X should take the values: analyze, check_
assertions or optimize.
again/0: PREDICATE
Usage:
Performs the last actions done by customize_and_preprocess/1, on the last file previ-
ously analyzed, checked, or optimized
pp flag/1: PREDICATE
Valid flags:
• for the output:
• analysis_info (off, on) Whether to output the results of analysis.
• point_info (off,on) Whether to output analysis information for program points
within clauses.
• collapse_ai_vers (off, on) to output all the versions of call/success patterns
inferred by analysis or just one version (summing-up all of them).
• type_output (defined, all) to output the types inferred for predicates in terms
only of types defined by the user or including types inferred anew.
• for analysis:
• fixpoint (plai, dd, di, check_di, check_di2, check_di3, check_di4) The
kind of fixpoint computation used.
• multi_success (off, on) Whether to allow success multivariance.
• widen (off, on) Whether to perform widening.
• intermod (off, on, auto) The policy for inter-modular analysis.
• success_policy (best, first, all, top, botfirst, botbest, botall,
bottom) The policy for obtaining success information for imported predicates
during inter-modular analysis.
• entry_policy (all, top_level, force, force_assrt) The policy for obtain-
ing entry call patterns for exported predicates during inter-modular analysis.
• process_libraries (on, off, no_engine) Whether to perform the analysis of
Ciao system libraries when a modular user program is analyzed.
Chapter 3: The CiaoPP low-level programming interface 21
transform/1: PREDICATE
Usage 1: transform(Trans)
Returns on backtracking all available program transformation identifiers.
− The following properties should hold at call time:
Trans is a free variable. ( var/1)
− The following properties should hold upon exit:
Trans is a valid transformation identifier. ( transformation/1)
Usage 2: transform(Trans)
Performs transformation Trans on the current module.
− The following properties should hold at call time:
Trans is currently a term which is not a free variable. ( nonvar/1)
Trans is a valid transformation identifier. ( transformation/1)
module/1: PREDICATE
Usage 1: module(FileName)
Reads the code of FileName and its preprocessing unit, and sets it as the current module.
− The following properties should hold at call time:
FileName is currently a term which is not a free variable. ( nonvar/1)
FileName is a source name. ( sourcename/1)
Usage 2: module(FileNameList)
Reads the code of the list of file names FileNameList (and their preprocessing units), and
sets them as the current modules.
− The following properties should hold at call time:
FileNameList is currently a term which is not a free variable. ( nonvar/1)
FileNameList is a list of atms. ( list/2)
acheck/0: PREDICATE
Usage:
Checks assertions w.r.t. analysis information.
analyze/1: PREDICATE
Usage 1: analyze(Analysis)
Returns on backtracking all available analyses.
Chapter 3: The CiaoPP low-level programming interface 23
output/1: PREDICATE
Usage: output(Output)
Outputs the current module preprocessing state to a file Output.
− The following properties should hold at call time:
Output is currently a term which is not a free variable. ( nonvar/1)
24 The Ciao Preprocessor
output/0: PREDICATE
Usage:
Outputs the current Module preprocessing state to a file named Module_opt.pl, where
Module is the current module.
help/0: PREDICATE
Chapter 3: The CiaoPP low-level programming interface 25
analysis/1: PROPERTY
Analyses can be integrated in CiaoPP in an ad-hoc way (see the Internals manual), in
which the CiaoPP menu would not be aware of them. The current analyses supported in
the menu are:
• for groundness and sharing:
• gr tracks groundness in a very simple way.
• def tracks groundness dependencies, which improves the accuracy in inferring
groundness.
• share tracks sharing among (sets of) variables [MH92], which gives a very accu-
rate groundness inference, plus information on dependencies caused by unifica-
tion.
• son tracks sharing among pairs of variables, plus variables which are linear (see
[Son86]).
• shareson is a combination of the above two [CMB93], which may improve on
the accuracy of any of them alone.
• shfr tracks sharing and variables which are free (see [MH91]).
• shfrson is a combination of shfr and son.
• shfrnv augments shfr with knowledge on variables which are not free nor
ground.
• for term structure:
• depth tracks the structure of the terms bound to the program variables during
execution, up to a certain depth; the depth is fixed with the depth flag.
• path tracks sharing among variables which occur within the terms bound to the
program variables during execution; the occurrence of run-time variables within
terms is tracked up to a certain depth, fixed with the depth flag.
• aeq tracks the structure of the terms bound to the program variables during
execution plus the sharing among the run-time variables occurring in such terms,
plus freeness and linearity. The depth of terms being tracked is set with the depth
flag. Sharing can be selected between set-sharing or pair-sharing.
• for types:
Type analysis supports different degrees of precision. For example, with the flag
type\_precision with value defined, the analysis restricts the types to the finite
domain of predefined types, i.e., the types defined by the user or in libraries, without
generating new types. Another alternative is to use the normal analysis, i.e., creating
new type definitions, but having only predefined types in the output. This is handled
through the type\_output flag.
• eterms performs structural widening (see [VB02]).
Greater precision can be obtained evaluating builtins like is/2 abstractly:
eterms includes a variant which allows evaluation of the types, which is gov-
erned by the type\_eval flag.
• ptypes uses the topological clash widening operator (see [VHCL95]).
• svterms implements the rigid types domain of [JB92].
• terms uses shortening as the widening operator (see [GdW94]), in several fash-
ions, which are selected via the depth flag; depth 0 meaning the use of restricted
shortening [SG94].
26 The Ciao Preprocessor
transformation/1: PROPERTY
Transformations can be integrated in CiaoPP in an ad-hoc way (see the Internals manual),
in which the CiaoPP menu would not be aware of them. The current transformations
supported in the menu are:
• for program specialization:
• simp This transformation tries to explote analysis information in order to simplify
the program as much as possible. It includes optimizations such as abstract
executability of literals, removal of useless clauses, and unfolding of literals for
predicates which are defined by just a fact or a single clause with just one literal
in its body (a bridge). It also propagates failure backwards in a clause as long
as such propagation is safe.
• spec This transformation performs the same optimizations as simp but it also
performs multiple specialization when this improves the possibilities of optimiza-
tion. The starting point for this transformation is not a program annotated with
analysis information, as in the case above, but rather an expanded program which
corresponds to the analysis graph computed by multi-variant abstract interpre-
tation. A minimization algorithm is used in order to guarantee that the resulting
program is minimal in the sense that further collapsing versions would represent
losing opportunities for optimization.
• vers This transformation has in common with spec that it takes as starting
point the expanded program which corresponds to the analysis graph computed by
abstract interpretation. However, this transformation performs no optimizations
and does not minimize the program. As a result, it generates the expanded
program.
• for partial evaluation:
• codegen This generates the specialized program resulting from partial evaluation,
obtained by unfolding goals during analysis. The kind of unfolding performed is
governed by the comp\_rule flag, as follows:
• leftmost unfolds the leftmost clause literal;
• eval\_builtin selects for unfolding first builtins which can be evaluated;
• local\_emb tries to select first atoms which do not endanger the embedding
ordering or evaluable builtins whenever possible;
28 The Ciao Preprocessor
• jump\_builtin selects the leftmost goal but can ‘jump’ over (ignore) builtins
when they are not evaluable. A main difference with the other computation
rules is that unfolding is performed ‘in situ’, i.e., without reordering the
atoms in the clause.
• safe\_jb same as jump\_builtin with the difference that it only jumps over
a call to a builtin iff the call is safe [APG06] (i.e., it is error free, binding
insensitive and side effect free).
• bind\_ins\_jb same as safe\_jb with the difference that it only jumps
over a call to a builtin iff the call is binding insensitive and side effect free.
• no\_sideff\_jb same as bind\_ins\_jb with the difference that it only
jumps over a call to a builtin iff it is side effect free.
Unfolding is performed continuously on the already unfolded clauses, until a
condition for stopping the process is satisfied. This condition is stablished by the
local control policy, governed by the local\_control flag, as follows:
• inst allows goal instantiation but no actual unfolding is performed.
• orig returns the clauses in the original program for the corresponding pred-
icate.
• det allows unfolding while derivations are deterministic and stops them when
a non-deterministic branch is required. Note that this may not be terminat-
ing.
• det\_la same as det, but with look-ahead. It can perform a number of non-
deterministic steps in the hope that the computation will turn deterministic.
This number is determined by flag unf\_depth.
• depth always performs the same number of unfolding steps for every call
pattern. The number is determined by flag unf\_depth.
• first\_sol explores the SLD tree width-first and keeps on unfolding until
a first solution is found. It can be non-terminating.
• first\_sol\_d same as above, but allows terminating when a given depth
bound is reached without obtaining any solution. The bound is determined
by unf\_depth.
• all\_sol tries to generate all solutions by exploring the whole SLD tree.
This strategy only terminates if the SLD is finite.
• hom\_emb keeps on unfolding until the selected atom is homeomorphically
embedded in an atom previously selected for unfolding.
• hom\_emb\_anc same as before, but only takes into account previously se-
lected atoms which are ancestors of the currently selected atom.
• hom\_emb\_as same as before, but efficiently implemented by using a stack
to store ancestors.
• df\_hom\_emb\_as same as before, but traverses the SLD tree on a depth-
first fashion (all strategies above use wide-first search). This allows better
performance.
• df\_tree\_hom\_emb same as above, but does not use the efficient stack-
based implementation for ancestors.
• df\_hom\_emb same as above, but compares with all previously selected
atoms, and not only ancestors. It is like hom\_emb but with depth-first
traversal.
• global\_control In order to guarantee termination of the partial evaluation
process, it is often required to abstract away information before unfolding. This
is usually known as global control. This flag can have the following values:
Chapter 3: The CiaoPP low-level programming interface 29
• best selects the success pattern which corresponds to the best over-approximation of
the sought call pattern; if there are several non-comparable best over-approximations,
one of them is chosen randomly.
• first selects the first success pattern which corresponds to a call pattern which is an
over-approximation of the sought call pattern.
• all computes the greatest lower bound of the success patterns that correspond to
over-approximating call patterns.
• top selects Top (no information) as answer pattern for any call pattern.
• botfirst selects the first success pattern which corresponds to a call pattern which is
an under-approximation of the sought call pattern.
• botbest selects the success pattern which corresponds to the best under-approximation
of the sought call pattern; if there are several non-comparable best under-
approximations, one of them is chosen randomly.
• botall computes the least upper bound of the success patterns that correspond to
under-approximating call patterns.
• bottom selects Bottom (failure) as answer pattern for any call pattern.
• initial\_guess to obtain an initial guess for the success pattern corresponding to a call
pattern to an imported predicate when there is none that fully matches.
• botfirst selects the success pattern already computed corresponding to the first call
pattern which is an under-approximation of the given call pattern.
• botbest selects the success pattern corresponding to the call pattern which best under-
approximates the given call pattern (if there are several, non-comparable call patterns,
one of them is selected randomly).
• botall computes the least upper bound of the success patterns that correspond to
under-approximating call patterns.
• bottom selects Bottom as initial guess for any call pattern.
• entry\_policy to obtain entry call patterns for exported predicates.
• all selects all entry call patterns for the current module which have not been analyzed
yet, either from entry assertions found in the source code, or from the analysis of other
modules that import the current module.
• top\_level is only meaningful during auto inter-modular analysis, and it is set auto-
matically by CiaoPP. If the current module is the top-level module (the main module
of the modular program being analyzed), the entry policy behaves like all. In any
other case, it selects entry call patterns for the current module from the analysis of
other modules that import it, ignoring entry assertions found in the source code.
• force forces the analysis of all entries of the module (from both the module source
code and calling modules), even if they have been already analyzed.
• force\_assrt forces the analysis of all entries coming from the module source code, but
does not analyze entries relative to calling modules, even if they need to be (re)analyzed.
• process\_libraries to indicate that Ciao system libraries must also be analyzed when a
modular user program is analyzed.
• off disables the analysis of any Ciao system library.
• on enables the analysis of all Ciao system libraries.
• no\_engine enables the analysis of Ciao system libraries which are not engine libraries.
• use\_check\_assrt to indicate that check assertions for imported predicates will be used
as trust assertions. This is specially interesting when performing intermodular compile-time
checking.
• off disables the use of check assertions as trust assertions for imported predicates.
• on enables the use of check assertions as trust assertions.
32 The Ciao Preprocessor
Where:
-o OutFile after processing Filename, the resulting source
code is written to OutFile. If this option is
omitted, the output is written to a file
automatically named depending on the actions
performed.
Execution Examples:
ciaoppcl -Q myfile.pl
ciaoppcl -o myfile_checked.pl -V myfile.pl
ciaoppcl -O myfile.pl
ciaoppcl -A myfile.pl -ftypes=terms -f modes=pd
ciaoppcl -T
☛ ✟
✡ ✠
36 The Ciao Preprocessor
Chapter 5: Using assertions for preprocessing programs 37
5.1 Assertions
Predicate assertions can be used to declare properties of the execution states at the time of
calling a predicate and upon predicate success. Also, properties of the computation of the calls
to a predicate can be declared.
Assertions may be qualified by keywords check or trust. Assertions qualified with the
former—or not qualifed—are known as check assertions; those qualified with the latter are known
as trust assertions. Check assertions state the programmer’s intention about the program and
are used by the debugger to check for program inconsistencies. On the contrary, trust assertions
are “trusted” by CiaoPP tools.
☛ ✟
• The specification of a program is made of all check assertions for the program predicates.
✡ ✠
5.2 Properties
Whereas each kind of assertion indicates when, i.e., in which states or sequences of states, to
check the given properties, the properties themselves define what to check. Properties are used
to say things such as “X is a list of integers,” “Y is ground,” “p(X) does not fail,” etc. and in
Ciao they are logic predicates, in the sense that the evaluation of each property either succeeds
or fails. The failure or success of properties typically needs to be determined at the time when
the assertions in which they appear are checked. Assertions can be checked both at compile-time
by CiaoPP and at run-time by Ciao itself (after the instrumentation of the program by CiaoPP).
In this section we will concentrate exclusively on run-time checking.
A property may be a predefined predicate in the language (such as integer(X)) or con-
straint (such as X>5). Properties may include extra-logical predicates such as var(X)). Also,
expressions built using conjunctions of properties,1 or, in principle, any predicate defined by the
user, using the full underlying (C)LP language. As an example, consider defining the predicate
sorted(B) and using it as a postcondition to check that a more involved sorting algorithm such
as qsort(A,B) produces correct results.
1
Although disjunctions are also supported, we restrict our attention to only conjunctions.
40 The Ciao Preprocessor
While user-defined properties allow for properties that are as general as allowed by the full
source language syntax, some limitations are useful in practice. Essentially, the behaviour of
the program should not change in a fundamental way depending on whether the run-time tests
are being performed or not. For example, turning on run-time checking should not introduce
non-termination in a program which terminates without run-time checking. To this end, it is
required that the user ensure that the execution of properties terminate for any possible initial
state. Also, checking a property should not change the answers computed by the program or
produce unexpected side-effects. Regarding computed answers, in principle properties are not
allowed to further instantiate their arguments or add new constraints. Regarding side-effects,
it is required that the code defining the property does not perform input/output, add/delete
clauses, etc. which may interfere with the program behaviour. It is the user’s responsibility to
only use predicates meeting these conditions as properties. The user is required to identify in a
special way the predicates which he or she has determined to be legal properties. This is done
by means of a declaration of the form
:- prop Spec.
where Spec is a predicate specification in the form PredName/Arity.
Given the classes of assertions presented previously, there are two fundamental classes of
properties. The properties used in the Cond of calls assertions, Postcond of success assertions,
and Precond of success and comp assertions refer to a particular execution state and we refer
to them as properties of execution states. The properties used in the Comp-prop part of comp
assertions refer to a sequence of states and we refer to them as properties of computations.
Basic properties, including instantiation and compatibility state properties, types, and prop-
erties of computations (all discussed in Chapter 8 [Declaring regular types], page 63) are docu-
mented in Chapter 9 [Basic data types and properties], page 69.
Additional entry points also occur when there are predicates defined in the preprocessing unit
which can be dynamically modified. In this case the code dynamically added can contain new
predicate calls. These calls should be declared also as entry points.
Note that all entry points to the preprocessing unit should be declared: entry points including
query calls that the user may issue to the program, or another part of the program can issue to
the unit, but also dynamic calls: goals that may be run within the unit which do not appear
explicitely in the unit text, i.e., from meta-predicates or from dynamic clauses which may be
asserted during execution. In all cases, entry declarations are used to declare entry points.2
Third, the unit code may call predicates defined in other parts of the program. The code
defining such predicates is termed foreign code, since it is foreign to the preprocessing unit. It is
important that CiaoPP knows information about how calls to foreign code will succeed (if they
succeed), in order to improve its accuracy. This can be done using trust declarations.
Also, trust declarations can be used to provide the preprocessor with extra information. They
can be used to describe calls to predicates defined within the preprocessing unit, in addition to
those describing foreign code. This can improve the information available to the preprocessor
and thus help it in its task. Trust declarations state properties that the programmer knows to
hold of the program.
The builtin predicates is one particular case of predicates the definitions of which are never
contained in the program itself. Therefore, preprocessing units never contain code to define the
builtins that they use. However, the Ciao Program Precompiler makes no assumptions on the
underlying language (except that it is constraint logic programming). Thus, all information on
the behaviour of the language builtins should be made available to it by means of assertions
(although this does not concern the application programmer who is going to preprocess a unit,
rather it concerns the system programmer when installing the Ciao Program Precompiler ).
The rest of this document summarizes how assertions can be used to declare the preprocessing
unit interactions. It shows the use of entry and trust declarations in preprocessing programs
with CiaoPP.3
☛ ✟
• Dynamic predicates which are called must be declared by using a dynamic declaration.
✡ ✠
Of course, the preprocessor cannot know of the effect that dynamic clauses added to the
definition of a predicate may cause in the execution of that predicate. However, this effect can
be described to the preprocessor by adding trust declarations for the dynamic predicates.
☛ ✟
• The effect of calls to predicates which are dynamically modified may be declared by using
trust declarations for such predicates.
✡ ✠
p(X,Y):- q(X,Y,Z).
q(X,Y,Z):- X = f(Y,Z), Y + Z = 3.
Assume that p/2 is the only entry point. If you include the following declaration:
:- entry p/2.
or, equivalently,
:- entry p(X,Y).
the code will be preprocessed as if goal p(X,Y) was called with the most general call pattern
(i.e., as if X and Y may have any two values, or no value at all—the variables being free).
However, if you know that p/2 will always be called with the first argument uniquely defined
and the second unconstrained, you can then provide more accurate information by introducing
one of the following declarations:
:- entry p(X,Y) : ( def(X), free(Y) ).
:- entry p(def,free).
Now assume that p/2 will always be called with the first argument bound to the compound
term f(A,B) where A is definite and B is unconstrained, and the second argument of p/2 is
unconstrained. The entry declaration for this call pattern is:
:- entry p(X,Y) : ( X=f(A,B), def(A), free(B), free(Y) ).
If both call patterns are possible, the most accurate approach is to include both entry dec-
larations in the preprocessing unit. The preprocessor will then analyze the program for each
declaration. Another alternative is to include an entry declaration which approximates both call
patterns, such as one of the following two:
:- entry p(X,Y) : free(Y).
:- entry p(X,free).
which state that Y is known to be free, but nothing is known of X (since it may or may not
be definite).
5.7 Modules
Modules provide for encapsulation of code, in such a way that (some) predicates defined
in a module can be used by other parts of the program (possibly other modules), but other
(auxiliary) predicates can not. The predicates that can be used are exported by the module
defining them and imported by the module(s) which use(s) them. Thus, modules provide for a
natural declaration of the allowed entry points to a piece of a program.
A module is identified by a module declaration at the beginning of the file defining that
module. The module declaration has the following form:
:- module(Name, [ Spec,...,Spec ] ).
where the module is named Name and it exports the predicates in the different Spec’s.
Note that such a module declaration is equivalent, for the purpose of static preprocessing, to
as many entry declarations of the form:
:- entry Spec.
as there are exported Spec’s.
Chapter 5: Using assertions for preprocessing programs 45
Let a program have a dynamic predicate dyn_calls/1 to which the program asserts clauses,
such that these clauses do only have in their bodies calls to predicates p/2 and q/3. This should
be declared with:
:- entry p/2.
:- entry q/3.
Moreover, if the programmer knows that every call to dyn_calls/1 which can appear in the
program is such that upon its execution the calls to p/2 and q/3 have all of their arguments
constrained to definite values, then the two entry declarations at the beginning of the examples
may be used.
5.9 An overview
To process programs with the Ciao Program Precompiler the following guidelines might be
useful:
1. Add
:- use_package(assertions).
to your program.
2. Declare your specification of the program using calls, success, comp, or pred assertions.
3. Use entry declarations to declare all entry points to your program.
4. The preprocessor will notify you during the session of certain program points where a meta-
call appears that may call unknown (at compile-time) predicates.
Add entry declarations for all the predicates that may be dynamically called at such program
points.
5. Use data or dynamic declarations to declare all predicates that may be dynamically modi-
fied.
6. Add entry declarations for the dynamic calls that may occur from the code that the program
may dynamically assert.
7. Optionally, you can interact with the preprocessor using trust assertions.
For example, the preprocessor will notify you during the session of certain program points
where a call appears to an unknown (at compile-time) predicate.
Add trust declarations for such predicates.
Chapter 6: The Ciao assertion package 47
pred/1: DECLARATION
This assertion provides information on a predicate. The body of the assertion (its only
argument) contains properties or comments in the formats defined by assrt_body/1.
More than one of these assertions may appear per predicate, in which case each one
represents a possible “ mode” of use ( usage) of the predicate. The exact scope of the
usage is defined by the properties given for calls in the body of each assertion (which
should thus distinguish the different usages intended). All of them together cover all
possible modes of usage.
For example, the following assertions describe (all the and the only) modes of usage of
predicate length/2 (see lists):
:- pred length(L,N) : list * var => list * integer
# "Computes the length of L.".
:- pred length(L,N) : var * integer => list * integer
Chapter 6: The Ciao assertion package 49
pred/2: DECLARATION
This assertion is similar to a pred/1 assertion but it is explicitely qualified. Non-qualified
pred/1 assertions are assumed the qualifier check.
Usage: :- AssertionStatus pred AssertionBody.
− The following properties should hold at call time:
AssertionStatus is an acceptable status for an assertion. ( assrt_status/1)
AssertionBody is an assertion body. ( assrt_body/1)
texec/1: DECLARATION
This assertion is similar to a calls/1 assertion but it is used to provide input data and
execution commands to the unit-test driver.
Usage: :- texec AssertionBody.
− The following properties should hold at call time:
AssertionBody is a call assertion body. ( c_assrt_body/1)
texec/2: DECLARATION
This assertion is similar to a texec/1 assertion but it is explicitely qualified with an
assertion status. Non-qualified texec/1 assertions are assumed to have check status.
Usage: :- AssertionStatus texec AssertionBody.
− The following properties should hold at call time:
AssertionStatus is an acceptable status for an assertion. ( assrt_status/1)
AssertionBody is a call assertion body. ( c_assrt_body/1)
calls/1: DECLARATION
This assertion is similar to a pred/1 assertion but it only provides information about the
calls to a predicate. If one or several calls assertions are given they are understood to
describe all possible calls to the predicate.
For example, the following assertion describes all possible calls to predicate is/2 (see
arithmetic):
:- calls is(term,arithexpression).
calls/2: DECLARATION
This assertion is similar to a calls/1 assertion but it is explicitely qualified with an
assertion status. Non-qualified calls/1 assertions are assumed to have check status.
Usage: :- AssertionStatus calls AssertionBody.
− The following properties should hold at call time:
AssertionStatus is an acceptable status for an assertion. ( assrt_status/1)
AssertionBody is a call assertion body. ( c_assrt_body/1)
success/1: DECLARATION
This assertion is similar to a pred/1 assertion but it only provides information about the
answers to a predicate. The described answers might be conditioned to a particular way
of calling the predicate.
For example, the following assertion specifies the answers of the length/2 predicate if it
is called as in the first mode of usage above (note that the previous pred assertion already
conveys such information, however it also compelled the predicate calls, while the success
assertion does not):
:- success length(L,N) : list * var => list * integer.
success/2: DECLARATION
success assertion This assertion is similar to a success/1 assertion but it is explicitely
qualified with an assertion status. The status of non-qualified success/1 assertions is
assumed to be check.
Usage: :- AssertionStatus success AssertionBody.
− The following properties should hold at call time:
AssertionStatus is an acceptable status for an assertion. ( assrt_status/1)
AssertionBody is a predicate assertion body. ( s_assrt_body/1)
test/1: DECLARATION
This assertion is similar to a success assertion but it specifies a concrete test case to be
run in order verify (partially) that the predicate is working as expected. For example, the
following test will verify that the length predicate works well for the particular list given:
:- test length(L,N) : ( L = [1,2,5,2] ) => ( N = 4 ).
test/2: DECLARATION
This assertion is similar to a test/1 assertion but it is explicitely qualified with an
assertion status. Non-qualified test/1 assertions are assumed to have check status. In
this context, check means that the test should be executed when the developer runs the
test battery.
Usage: :- AssertionStatus test AssertionBody.
− The following properties should hold at call time:
AssertionStatus is an acceptable status for an assertion. ( assrt_status/1)
AssertionBody is a predicate assertion body. ( s_assrt_body/1)
comp/1: DECLARATION
This assertion is similar to a pred/1 assertion but it only provides information about the
global execution properties of a predicate (note that such kind of information is also con-
veyed by pred assertions). The described properties might be conditioned to a particular
way of calling the predicate.
For example, the following assertion specifies that the computation of append/3 (see
lists) will not fail if it is called as described (but does not compel the predicate to be
called that way):
:- comp append(Xs,Ys,Zs) : var * var * var + not_fail.
comp/2: DECLARATION
This assertion is similar to a comp/1 assertion but it is explicitely qualified. Non-qualified
comp/1 assertions are assumed the qualifier check.
Usage: :- AssertionStatus comp AssertionBody.
− The following properties should hold at call time:
AssertionStatus is an acceptable status for an assertion. ( assrt_status/1)
AssertionBody is a comp assertion body. ( g_assrt_body/1)
prop/1: DECLARATION
This assertion is similar to a pred/1 assertion but it flags that the predicate being docu-
mented is also a “ property.”
Properties are standard predicates, but which are guaranteed to terminate for any possible
instantiation state of their argument(s), do not perform side-effects which may interfere
with the program behaviour, and do not further instantiate their arguments or add new
constraints.
Provided the above holds, properties can thus be safely used as run-time checks. The
program transformation used in ciaopp for run-time checking guarantees the third re-
quirement. It also performs some basic checks on properties which in most cases are
enough for the second requirement. However, it is the user’s responsibility to guaran-
tee termination of the properties defined. (See also Chapter 8 [Declaring regular types],
page 63 for some considerations applicable to writing properties.)
52 The Ciao Preprocessor
The set of properties is thus a strict subset of the set of predicates. Note that properties
can be used to describe characteristics of arguments in assertions and they can also be
executed (called) as any other predicates.
Usage: :- prop AssertionBody.
− The following properties should hold at call time:
AssertionBody is an assertion body. ( assrt_body/1)
prop/2: DECLARATION
This assertion is similar to a prop/1 assertion but it is explicitely qualified. Non-qualified
prop/1 assertions are assumed the qualifier check.
Usage: :- AssertionStatus prop AssertionBody.
− The following properties should hold at call time:
AssertionStatus is an acceptable status for an assertion. ( assrt_status/1)
AssertionBody is an assertion body. ( assrt_body/1)
entry/1: DECLARATION
This assertion provides information about the external calls to a predicate. It is identical
syntactically to a calls/1 assertion. However, they describe only external calls, i.e., calls
to the exported predicates of a module from outside the module, or calls to the predicates
in a non-modular file from other files (or the user).
These assertions are trusted by the compiler. As a result, if their descriptions are erroneous
they can introduce bugs in programs. Thus, entry/1 assertions should be written with
care.
An important use of these assertions is in providing information to the compiler which it
may not be able to infer from the program. The main use is in providing information on
the ways in which exported predicates of a module will be called from outside the module.
This will greatly improve the precision of the analyzer, which otherwise has to assume
that the arguments that exported predicates receive are any arbitrary term.
Usage: :- entry AssertionBody.
− The following properties should hold at call time:
AssertionBody is a call assertion body. ( c_assrt_body/1)
exit/1: DECLARATION
This type of assertion provides information about the answers that an (exported) predicate
provides for external calls. It is identical syntactically to a success/1 assertion. However,
it describes only external answers, i.e., answers to the exported predicates of a module
from outside the module, or answers to the predicates in a non-modular file from other
files (or the user). The described answers may be conditioned to a particular way of calling
the predicate. E.g.:
:- exit length(L,N) : list * var => list * integer.
exit/2: DECLARATION
exit assertion This assertion is similar to an exit/1 assertion but it is explicitely qualified
with an assertion status. Non-qualified exit/1 assertions are assumed the qualifier check.
Usage: :- AssertionStatus exit AssertionBody.
− The following properties should hold at call time:
AssertionStatus is an acceptable status for an assertion. ( assrt_status/1)
AssertionBody is a predicate assertion body. ( s_assrt_body/1)
modedef/1: DECLARATION
This assertion is used to define modes. A mode defines in a compact way a set of call
and success properties. Once defined, modes can be applied to predicate arguments in
assertions. The meaning of this application is that the call and success properties defined
by the mode hold for the argument to which the mode is applied. Thus, a mode is
conceptually a “property macro”.
The syntax of mode definitions is similar to that of pred declarations. For example, the
following set of assertions:
:- modedef +A : nonvar(A) # "A is bound upon predicate entry.".
decl/1: DECLARATION
This assertion is similar to a pred/1 assertion but it is used for declarations instead than
for predicates.
Usage: :- decl AssertionBody.
− The following properties should hold at call time:
AssertionBody is an assertion body. ( assrt_body/1)
decl/2: DECLARATION
This assertion is similar to a decl/1 assertion but it is explicitely qualified. Non-qualified
decl/1 assertions are assumed the qualifier check.
Usage: :- AssertionStatus decl AssertionBody.
− The following properties should hold at call time:
AssertionStatus is an acceptable status for an assertion. ( assrt_status/1)
AssertionBody is an assertion body. ( assrt_body/1)
54 The Ciao Preprocessor
doc/2: DECLARATION
Usage: :- doc(Pred,Comment).
Documentation . This assertion provides a text Comment for a given predicate Pred.
− The following properties should hold at call time:
Pred is a head pattern. ( head_pattern/1)
Comment is a text comment with admissible documentation commands. The usual
formatting commands that are applicable in comment strings are defined by
stringcommand/1. See the lpdoc manual for documentation on comments. (
docstring/1)
comment/2: DECLARATION
Usage: :- comment(Pred,Comment).
An alias for doc/2 (deprecated, for compatibility with older versions).
− The following properties should hold at call time:
Pred is a head pattern. ( head_pattern/1)
Comment is a text comment with admissible documentation commands. The usual
formatting commands that are applicable in comment strings are defined by
stringcommand/1. See the lpdoc manual for documentation on comments. (
docstring/1)
check/1: PREDICATE
Usage: check(PropertyConjunction)
This assertion provides information on a clause program point (position in the body of
a clause). Calls to a check/1 assertion can appear in the body of a clause in any place
where a literal can normally appear. The property defined by PropertyConjunction
should hold in all the run-time stores corresponding to that program point. See also
Chapter 11 [Run-time checking of assertions], page 101.
− The following properties should hold at call time:
PropertyConjunction is either a term or a conjunction of terms. The main functor
and arity of each of those terms corresponds to the definition of a property. The first
argument of each such term is a variable which appears as a head argument. (
property_conjunction/1)
trust/1: PREDICATE
Usage: trust(PropertyConjunction)
This assertion also provides information on a clause program point. It is identical syntac-
tically to a check/1 assertion. However, the properties stated are not taken as something
to be checked but are instead trusted by the compiler. While the compiler may in some
cases detect an inconsistency between a trust/1 assertion and the program, in all other
cases the information given in the assertion will be taken to be true. As a result, if these
assertions are erroneous they can introduce bugs in programs. Thus, trust/1 assertions
should be written with care.
An important use of these assertions is in providing information to the compiler which
it may not be able to infer from the program (either because the information is not
Chapter 6: The Ciao assertion package 55
present or because the analyzer being used is not precise enough). In particular, providing
information on external predicates which may not be accessible at the time of compiling
the module can greatly improve the precision of the analyzer. This can be easily done
with trust assertion.
− The following properties should hold at call time:
PropertyConjunction is either a term or a conjunction of terms. The main functor
and arity of each of those terms corresponds to the definition of a property. The first
argument of each such term is a variable which appears as a head argument. (
property_conjunction/1)
true/1: PREDICATE
Usage: true(PropertyConjunction)
This assertion is identical syntactically to a check/1 assertion. However, the properties
stated have been proved to hold by the analyzer. Thus, these assertions often represent
the analyzer output.
− The following properties should hold at call time:
PropertyConjunction is either a term or a conjunction of terms. The main functor
and arity of each of those terms corresponds to the definition of a property. The first
argument of each such term is a variable which appears as a head argument. (
property_conjunction/1)
false/1: PREDICATE
Usage: false(PropertyConjunction)
This assertion is identical syntactically to a check/1 assertion. However, the properties
stated have been proved not to hold by the analyzer. Thus, these assertions often represent
the analyzer output.
− The following properties should hold at call time:
PropertyConjunction is either a term or a conjunction of terms. The main functor
and arity of each of those terms corresponds to the definition of a property. The first
argument of each such term is a variable which appears as a head argument. (
property_conjunction/1)
56 The Ciao Preprocessor
Chapter 7: Types and properties related to assertions 57
Props is a (possibly empty) complex goal property. Such properties can be either a term
or a conjunction of terms. The main functor and arity of each of those terms corresponds
to the definition of a property. Such properties apply to all executions of all goals of the
predicate which comply with the assertion in which the Props appear.
The arguments of the terms in Props are implicitely augmented with a first argument
which corresponds to a goal of the predicate of the assertion in which the Props appear.
For example, the assertion
:- comp var(A) + not_further_inst(A).
has property not_further_inst/1 as goal property, and establishes that in all executions
of var(A) it should hold that not_further_inst(var(A),A).
Usage: complex_goal_property(Props)
Props is either a term or a conjunction of terms. The main functor and arity of each of
those terms corresponds to the definition of a property. A first implicit argument in such
terms identifies goals to which the properties apply.
nabody/1: PROPERTY
Usage: nabody(ABody)
ABody is a normalized assertion body.
dictionary/1: REGTYPE
Usage: dictionary(D)
D is a dictionary of variable names.
Pr : CP => AP # CO
Pr : CP => AP
Pr => AP # CO
Pr => AP
where:
• Pr is a head pattern ( head_pattern/1) which describes the predicate or property
and possibly gives some implicit call/answer information.
• CP is a (possibly empty) complex argument property ( complex_arg_property/1)
which applies to the calls to the predicate.
• AP is a (possibly empty) complex argument property ( complex_arg_property/1)
which applies to the answers to the predicate (if the predicate succeeds). These only
apply if the (possibly empty) properties given for calls in the assertion hold.
• CO is a comment string ( docstring/1). This comment only applies if the (possibly
empty) properties given for calls in the assertion hold. The usual formatting com-
mands that are applicable in comment strings can be used (see stringcommand/1).
The format of the different parts of the assertion body are given by n_assrt_body/5 and
its auxiliary types.
Usage: s_assrt_body(X)
X is a predicate assertion body.
where:
• Pr is a head pattern ( head_pattern/1) which describes the predicate or property
and possibly gives some implicit call/answer information.
• CP is a (possibly empty) complex argument property ( complex_arg_property/1)
which applies to the calls to the predicate.
• GP contains (possibly empty) complex goal property ( complex_goal_property/1)
which applies to the whole execution of a call to the predicate. These only apply if
the (possibly empty) properties given for calls in the assertion hold.
• CO is a comment string ( docstring/1). This comment only applies if the (possibly
empty) properties given for calls in the assertion hold. The usual formatting com-
mands that are applicable in comment strings can be used (see stringcommand/1).
The format of the different parts of the assertion body are given by n_assrt_body/5 and
its auxiliary types.
Usage: g_assrt_body(X)
X is a comp assertion body.
62 The Ciao Preprocessor
predfunctor/1: REGTYPE
Usage: predfunctor(X)
X is a type of assertion which defines a predicate.
propfunctor/1: REGTYPE
Usage: propfunctor(X)
X is a type of assertion which defines a property.
docstring/1: PROPERTY
Usage: docstring(String)
String is a text comment with admissible documentation commands. The usual format-
ting commands that are applicable in comment strings are defined by stringcommand/1.
See the lpdoc manual for documentation on comments.
Chapter 8: Declaring regular types 63
Regular types can be used as properties to describe predicates and play an essential role in
program debugging (see the Ciao Prolog preprocessor (ciaopp) manual).
In this chapter we explain some general considerations worth taking into account when writing
properties in general, not just regular types.
sumlist([],0).
sumlist([X|R],S) :- sumlist(R,PS), S is PS+X.
to describe the type of calls for which the program has been designed, i.e., those in which the
first argument of sumlist/2 is indeed a list of integers.
The property instantiated_to_intlist/1 might be written as in the following (Prolog)
definition:
:- prop instantiated_to_intlist/1.
instantiated_to_intlist(X) :-
nonvar(X), instantiated_to_intlist_aux(X).
instantiated_to_intlist_aux([]).
instantiated_to_intlist_aux([X|T]) :-
integer(X), instantiated_to_intlist(T).
(Recall that the Prolog builtin integer/1 itself implements an instantiation check, failing if
called with a variable as the argument.)
The property compatible_with_intlist/1 might in turn be written as follows (also in
Prolog):
:- prop compatible_with_intlist/1.
compatible_with_intlist(X) :- var(X).
compatible_with_intlist(X) :-
nonvar(X), compatible_with_intlist_aux(X).
compatible_with_intlist_aux([]).
compatible_with_intlist_aux([X|T]) :-
int_compat(X), compatible_with_intlist(T).
int_compat(X) :- var(X).
int_compat(X) :- nonvar(X), integer(X).
Note that these predicates meet the criteria for being properties and thus the prop/1 decla-
ration is correct.
Ensuring that a property meets the criteria for “not affecting the computation” can sometimes
make its coding somewhat tedious. In some ways, one would like to be able to write simply:
intlist([]).
intlist([X|R]) :- int(X), intlist(R).
(Incidentally, note that the above definition, provided that it suits the requirements for being a
property and that int/1 is a regular type, meets the criteria for being a regular type. Thus, it
could be declared :- regtype intlist/1.)
But note that (independently of the definition of int/1) the definition above is not the
correct instantiation check, since it would succeed for a call such as intlist(X). In fact, it is
not strictly correct as a compatibility property either, because, while it would fail or succeed
as expected, it would perform instantiations (e.g., if called with intlist(X) it would bind X to
[]). In practice, it is convenient to provide some run-time support to aid in this task.
The run-time support of the Ciao system (see Chapter 11 [Run-time checking of assertions],
page 101) ensures that the execution of properties is performed in such a way that properties
written as above can be used directly as instantiation checks. Thus, writing:
Chapter 8: Declaring regular types 65
regtype/1: DECLARATION
This assertion is similar to a prop assertion but it flags that the property being doc-
umented is also a “ regular type.” Regular types are properties whose definitions are
regular programs (see lelow). This allows for example checking whether it is in the class
of types supported by the regular type checking and inference modules.
A regular program is defined by a set of clauses, each of the form:
p(x, v_1, ..., v_n) :- body_1, ..., body_k.
where:
1. x is a term whose variables (which are called term variables) are unique, i.e., it is not
allowed to introduce equality constraints between the variables of x.
For example, p(f(X, Y)) :- ... is valid, but p(f(X, X)) :- ... is not.
2. in all clauses defining p/n+1 the terms x do not unify except maybe for one single
clause in which x is a variable.
3. n >= 0 and p/n is a parametric type functor (whereas the predicate defined by the
clauses is p/n+1).
4. v_1, ..., v_n are unique variables, which are called parametric variables.
5. Each body_i is of the form:
1. t(z) where z is one of the term variables and t is a regular type expression;
2. q(y, t_1, ..., t_m) where m >= 0, q/m is a parametric type functor, not in the
set of functors =/2, ^/2, ./3.
t_1, ..., t_m are regular type expressions, and y is a term variable.
6. Each term variable occurs at most once in the clause’s body (and should be as the
first argument of a literal).
Chapter 8: Declaring regular types 67
regtype/2: DECLARATION
This assertion is similar to a regtype/1 assertion but it is explicitely qualified. Non-
qualified regtype/1 assertions are assumed the qualifier check. Note that checking regular
type definitions should be done with the ciaopp preprocessor.
Usage: :- AssertionStatus regtype AssertionBody.
− The following properties should hold at call time:
AssertionStatus is an acceptable status for an assertion. ( assrt_status/1)
AssertionBody is an assertion body. ( assrt_body/1)
68 The Ciao Preprocessor
Chapter 9: Basic data types and properties 69
term/1: REGTYPE
The most general type (includes all possible terms).
(True) Usage: term(X)
X is any term.
− The following properties hold globally:
This predicate is understood natively by CiaoPP. ( native/1)
General properties:
True: term(X)
− The following properties hold globally:
term(X) is side-effect free. ( sideff/2)
70 The Ciao Preprocessor
True: term(X)
− The following properties hold globally:
term(X) is evaluable at compile-time. ( eval/1)
True: term(X)
− The following properties hold globally:
term(X) is equivalent to true. ( equiv/2)
int/1: REGTYPE
The type of integers. The range of integers is [-2^2147483616, 2^2147483616). Thus
for all practical purposes, the range of integers can be considered infinite.
(True) Usage: int(T)
T is an integer.
− The following properties hold globally:
This predicate is understood natively by CiaoPP. ( native/1)
General properties:
True: int(T)
− The following properties hold globally:
int(T) is side-effect free. ( sideff/2)
True: int(T)
− If the following properties hold at call time:
T is currently a term which is not a free variable. ( nonvar/1)
then the following properties hold globally:
int(T) is evaluable at compile-time. ( eval/1)
All calls of the form int(T) are deterministic. ( is_det/1)
Trust: int(T)
− The following properties hold upon exit:
T is an integer. ( int/1)
Trust:
− The following properties hold globally:
Indicates the type of test that a predicate performs. Required by the nonfailure
analyisis. ( test_type/2)
nnegint/1: REGTYPE
The type of non-negative integers, i.e., natural numbers.
(True) Usage: nnegint(T)
T is a non-negative integer.
− The following properties hold globally:
This predicate is understood natively by CiaoPP. ( native/1)
General properties:
True: nnegint(T)
Chapter 9: Basic data types and properties 71
flt/1: REGTYPE
The type of floating-point numbers. The range of floats is the one provided by the C
double type, typically [4.9e-324, 1.8e+308] (plus or minus). There are also three spe-
cial values: Infinity, either positive or negative, represented as 1.0e1000 and -1.0e1000;
and Not-a-number, which arises as the result of indeterminate operations, represented as
0.Nan
(True) Usage: flt(T)
T is a float.
− The following properties hold globally:
This predicate is understood natively by CiaoPP. ( native/1)
General properties:
True: flt(T)
− The following properties hold globally:
flt(T) is side-effect free. ( sideff/2)
True: flt(T)
− If the following properties hold at call time:
T is currently a term which is not a free variable. ( nonvar/1)
then the following properties hold globally:
flt(T) is evaluable at compile-time. ( eval/1)
All calls of the form flt(T) are deterministic. ( is_det/1)
Trust: flt(T)
− The following properties hold upon exit:
T is a float. ( flt/1)
Trust:
− The following properties hold globally:
Indicates the type of test that a predicate performs. Required by the nonfailure
analyisis. ( test_type/2)
72 The Ciao Preprocessor
num/1: REGTYPE
The type of numbers, that is, integer or floating-point.
(True) Usage: num(T)
T is a number.
− The following properties hold globally:
This predicate is understood natively by CiaoPP. ( native/1)
General properties:
True: num(T)
− The following properties hold globally:
num(T) is side-effect free. ( sideff/2)
num(T) is binding insensitive. ( bind_ins/1)
True: num(T)
− If the following properties hold at call time:
T is currently a term which is not a free variable. ( nonvar/1)
then the following properties hold globally:
num(T) is evaluable at compile-time. ( eval/1)
All calls of the form num(T) are deterministic. ( is_det/1)
Trust: num(T)
− The following properties hold upon exit:
T is a number. ( num/1)
Trust:
− The following properties hold globally:
Indicates the type of test that a predicate performs. Required by the nonfailure
analyisis. ( test_type/2)
atm/1: REGTYPE
The type of atoms, or non-numeric constants. The size of atoms is unbound.
(True) Usage: atm(T)
T is an atom.
− The following properties hold globally:
This predicate is understood natively by CiaoPP. ( native/1)
General properties:
True: atm(T)
− The following properties hold globally:
atm(T) is side-effect free. ( sideff/2)
True: atm(T)
− If the following properties hold at call time:
T is currently a term which is not a free variable. ( nonvar/1)
then the following properties hold globally:
atm(T) is evaluable at compile-time. ( eval/1)
All calls of the form atm(T) are deterministic. ( is_det/1)
Trust: atm(T)
Chapter 9: Basic data types and properties 73
struct/1: REGTYPE
The type of compound terms, or terms with non-zeroary functors. By now there is a limit
of 255 arguments.
(True) Usage: struct(T)
T is a compound term.
− The following properties hold globally:
This predicate is understood natively by CiaoPP. ( native/1)
General properties:
True: struct(T)
− The following properties hold globally:
struct(T) is side-effect free. ( sideff/2)
True: struct(T)
− If the following properties hold at call time:
T is currently a term which is not a free variable. ( nonvar/1)
then the following properties hold globally:
struct(T) is evaluable at compile-time. ( eval/1)
Trust: struct(T)
− The following properties hold upon exit:
T is a compound term. ( struct/1)
gnd/1: REGTYPE
The type of all terms without variables.
(True) Usage: gnd(T)
T is ground.
− The following properties hold globally:
This predicate is understood natively by CiaoPP. ( native/1)
General properties:
True: gnd(T)
− The following properties hold globally:
gnd(T) is side-effect free. ( sideff/2)
True: gnd(T)
− If the following properties hold at call time:
T is currently ground (it contains no variables). ( ground/1)
then the following properties hold globally:
gnd(T) is evaluable at compile-time. ( eval/1)
All calls of the form gnd(T) are deterministic. ( is_det/1)
74 The Ciao Preprocessor
Trust: gnd(T)
− The following properties hold upon exit:
T is ground. ( gnd/1)
Trust:
− The following properties hold globally:
Indicates the type of test that a predicate performs. Required by the nonfailure
analyisis. ( test_type/2)
gndstr/1: REGTYPE
(True) Usage: gndstr(T)
T is a ground compound term.
− The following properties hold globally:
This predicate is understood natively by CiaoPP. ( native/1)
General properties:
True: gndstr(T)
− The following properties hold globally:
gndstr(T) is side-effect free. ( sideff/2)
True: gndstr(T)
− If the following properties hold at call time:
T is currently ground (it contains no variables). ( ground/1)
then the following properties hold globally:
gndstr(T) is evaluable at compile-time. ( eval/1)
All calls of the form gndstr(T) are deterministic. ( is_det/1)
Trust: gndstr(T)
− The following properties hold upon exit:
T is a ground compound term. ( gndstr/1)
constant/1: REGTYPE
(True) Usage: constant(T)
T is an atomic term (an atom or a number).
General properties:
True: constant(T)
− The following properties hold globally:
constant(T) is side-effect free. ( sideff/2)
True: constant(T)
− If the following properties hold at call time:
T is currently a term which is not a free variable. ( nonvar/1)
then the following properties hold globally:
constant(T) is evaluable at compile-time. ( eval/1)
All calls of the form constant(T) are deterministic. ( is_det/1)
Trust: constant(T)
− The following properties hold upon exit:
T is an atomic term (an atom or a number). ( constant/1)
Chapter 9: Basic data types and properties 75
callable/1: REGTYPE
(True) Usage: callable(T)
T is a term which represents a goal, i.e., an atom or a structure.
General properties:
True: callable(T)
− The following properties hold globally:
callable(T) is side-effect free. ( sideff/2)
True: callable(T)
− If the following properties hold at call time:
T is currently a term which is not a free variable. ( nonvar/1)
then the following properties hold globally:
callable(T) is evaluable at compile-time. ( eval/1)
All calls of the form callable(T) are deterministic. ( is_det/1)
Trust: callable(T)
− The following properties hold upon exit:
T is currently a term which is not a free variable. ( nonvar/1)
list/1: REGTYPE
A list is formed with successive applications of the functor ’.’/2, and its end is the atom
[]. Defined as
list([]).
list([_1|L]) :-
list(L).
(True) Usage: list(L)
L is a list.
General properties:
True: list(L)
− The following properties hold globally:
list(L) is side-effect free. ( sideff/2)
True: list(L)
− If the following properties hold at call time:
L is currently ground (it contains no variables). ( ground/1)
then the following properties hold globally:
list(L) is evaluable at compile-time. ( eval/1)
All calls of the form list(L) are deterministic. ( is_det/1)
Trust: list(T)
− The following properties hold upon exit:
T is a list. ( list/1)
list/2: REGTYPE
list(L,T)
L is a list, and for all its elements, T holds.
(True) Usage: list(L,T)
L is a list of Ts.
Meta-predicate with arguments: list(?,(pred 1)).
General properties:
True: list(L,T)
− The following properties hold globally:
list(L,T) is side-effect free. ( sideff/2)
Chapter 9: Basic data types and properties 77
True: list(L,T)
− If the following properties hold at call time:
L is currently ground (it contains no variables). ( ground/1)
T is currently ground (it contains no variables). ( ground/1)
then the following properties hold globally:
list(L,T) is evaluable at compile-time. ( eval/1)
Trust: list(X,T)
− The following properties hold upon exit:
X is a list. ( list/1)
nlist/2: REGTYPE
(True) Usage: nlist(L,T)
L is T or a nested list of Ts. Note that if T is term, this type is equivalent to term, this
fact explain why we do not have a nlist/1 type
Meta-predicate with arguments: nlist(?,(pred 1)).
General properties:
True: nlist(L,T)
− The following properties hold globally:
nlist(L,T) is side-effect free. ( sideff/2)
True: nlist(L,T)
− If the following properties hold at call time:
L is currently ground (it contains no variables). ( ground/1)
T is currently ground (it contains no variables). ( ground/1)
then the following properties hold globally:
nlist(L,T) is evaluable at compile-time. ( eval/1)
Trust: nlist(X,T)
− The following properties hold upon exit:
X is any term. ( term/1)
member/2: PROPERTY
(True) Usage: member(X,L)
X is an element of L.
General properties:
True: member(X,L)
− The following properties hold globally:
member(X,L) is side-effect free. ( sideff/2)
member(X,L) is binding insensitive. ( bind_ins/1)
True: member(X,L)
− If the following properties hold at call time:
L is a list. ( list/1)
then the following properties hold globally:
member(X,L) is evaluable at compile-time. ( eval/1)
78 The Ciao Preprocessor
Trust: member(_X,L)
− The following properties hold upon exit:
L is a list. ( list/1)
Trust: member(X,L)
− If the following properties hold at call time:
L is currently ground (it contains no variables). ( ground/1)
then the following properties hold upon exit:
X is currently ground (it contains no variables). ( ground/1)
sequence/2: REGTYPE
A sequence is formed with zero, one or more occurrences of the operator ’,’/2. For
example, a, b, c is a sequence of three atoms, a is a sequence of one atom.
(True) Usage: sequence(S,T)
S is a sequence of Ts.
Meta-predicate with arguments: sequence(?,(pred 1)).
General properties:
True: sequence(S,T)
− The following properties hold globally:
sequence(S,T) is side-effect free. ( sideff/2)
True: sequence(S,T)
− If the following properties hold at call time:
S is currently ground (it contains no variables). ( ground/1)
T is currently ground (it contains no variables). ( ground/1)
then the following properties hold globally:
sequence(S,T) is evaluable at compile-time. ( eval/1)
Trust: sequence(E,T)
− The following properties hold upon exit:
E is currently a term which is not a free variable. ( nonvar/1)
T is currently ground (it contains no variables). ( ground/1)
string/1: REGTYPE
A string is a list of character codes. The usual syntax for strings "string" is allowed, which
is equivalent to [0’s,0’t,0’r,0’i,0’n,0’g] or [115,116,114,105,110,103]. There
is also a special Ciao syntax when the list is not complete: "st"||R is equivalent to
[0’s,0’t|R].
(True) Usage: string(T)
T is a string (a list of character codes).
General properties:
True: string(T)
− The following properties hold globally:
string(T) is side-effect free. ( sideff/2)
True: string(T)
− If the following properties hold at call time:
T is currently ground (it contains no variables). ( ground/1)
then the following properties hold globally:
string(T) is evaluable at compile-time. ( eval/1)
80 The Ciao Preprocessor
Trust: string(T)
− The following properties hold upon exit:
T is a string (a list of character codes). ( string/1)
predname/1: REGTYPE
(True) Usage: predname(P)
P is a Name/Arity structure denoting a predicate name:
predname(P/A) :-
atm(P),
nnegint(A).
General properties:
True: predname(P)
− The following properties hold globally:
predname(P) is side-effect free. ( sideff/2)
True: predname(P)
− If the following properties hold at call time:
P is currently ground (it contains no variables). ( ground/1)
then the following properties hold globally:
predname(P) is evaluable at compile-time. ( eval/1)
Trust: predname(P)
− The following properties hold upon exit:
P is a Name/Arity structure denoting a predicate name:
predname(P/A) :-
atm(P),
nnegint(A).
( predname/1)
compat/2: PROPERTY
This property captures the notion of type or property compatibility. The instantiation
or constraint state of the term is compatible with the given property, in the sense that
assuming that imposing that property on the term does not render the store inconsistent.
For example, terms X (i.e., a free variable), [Y|Z], and [Y,Z] are all compatible with the
regular type list/1, whereas the terms f(a) and [1|2] are not.
(True) Usage: compat(Term,Prop)
Term is compatible with Prop
Meta-predicate with arguments: compat(?,(pred 1)).
General properties:
True: compat(Term,Prop)
− If the following properties hold at call time:
Term is currently ground (it contains no variables). ( ground/1)
Prop is currently ground (it contains no variables). ( ground/1)
then the following properties hold globally:
compat(Term,Prop) is evaluable at compile-time. ( eval/1)
inst/2: PROPERTY
(True) Usage: inst(Term,Prop)
Term is instantiated enough to satisfy Prop.
Meta-predicate with arguments: inst(?,(pred 1)).
General properties:
True: inst(Term,Prop)
− The following properties hold globally:
inst(Term,Prop) is side-effect free. ( sideff/2)
True: inst(Term,Prop)
− If the following properties hold at call time:
Term is currently ground (it contains no variables). ( ground/1)
Prop is currently ground (it contains no variables). ( ground/1)
then the following properties hold globally:
inst(Term,Prop) is evaluable at compile-time. ( eval/1)
82 The Ciao Preprocessor
iso/1: PROPERTY
(True) Usage: iso(G)
Complies with the ISO-Prolog standard.
Meta-predicate with arguments: iso(goal).
General properties:
True: iso(G)
− The following properties hold globally:
iso(G) is side-effect free. ( sideff/2)
deprecated/1: PROPERTY
Specifies that the predicate marked with this global property has been deprecated, i.e.,
its use is not recommended any more since it will be deleted at a future date. Typically
this is done because its functionality has been superseded by another predicate.
(True) Usage: deprecated(G)
DEPRECATED.
Meta-predicate with arguments: deprecated(goal).
General properties:
True: deprecated(G)
− The following properties hold globally:
deprecated(G) is side-effect free. ( sideff/2)
sideff/2: PROPERTY
sideff(G,X)
Declares that G is side-effect free (if its execution has no observable result other than its
success, its failure, or its abortion), soft (if its execution may have other observable results
which, however, do not affect subsequent execution, e.g., input/output), or hard (e.g.,
assert/retract).
(True) Usage: sideff(G,X)
G is side-effect X.
− If the following properties hold at call time:
G is a term which represents a goal, i.e., an atom or a structure. ( callable/1)
X is an element of [free,soft,hard]. ( member/2)
Chapter 9: Basic data types and properties 83
regtype/1: PROPERTY
(True) Usage: regtype G
Defines a regular type.
Meta-predicate with arguments: regtype goal.
General properties:
True: regtype G
− The following properties hold globally:
regtype G is side-effect free. ( sideff/2)
native/1: PROPERTY
(True) Usage: native(Pred)
This predicate is understood natively by CiaoPP.
Meta-predicate with arguments: native(goal).
General properties:
True: native(P)
− The following properties hold globally:
native(P) is side-effect free. ( sideff/2)
native/2: PROPERTY
(True) Usage: native(Pred,Key)
This predicate is understood natively by CiaoPP as Key.
Meta-predicate with arguments: native(goal,?).
General properties:
True: native(P,K)
− The following properties hold globally:
native(P,K) is side-effect free. ( sideff/2)
rtcheck/1: PROPERTY
(True) Usage: rtcheck(G)
Equivalent to rtcheck(G, complete).
84 The Ciao Preprocessor
rtcheck/2: PROPERTY
(True) Usage: rtcheck(G,Status)
The runtime check of the property have the status Status.
− If the following properties hold at call time:
G is a term which represents a goal, i.e., an atom or a structure. ( callable/1)
Status of the runtime-check implementation for a given property. Valid values are:
• unimplemented: No run-time checker has been implemented for the property.
Althought it can be implemented further.
• incomplete: The current run-time checker is incomplete, which means, under
certain circunstances, no error is reported if the property is violated.
• unknown: We do not know if current implementation of run-time checker is
complete or not.
• complete: The opposite of incomplete, error is reported always that the property
is violated. Default.
• impossible: The property must not be run-time checked (for theoretical or prac-
tical reasons).
( rtc_status/1)
Meta-predicate with arguments: rtcheck(goal,?).
General properties:
True: rtcheck(G,Status)
− The following properties hold globally:
rtcheck(G,Status) is side-effect free. ( sideff/2)
no rtcheck/1: PROPERTY
(True) Usage: no_rtcheck(G)
Declares that the assertion in which this comp property appears must not be checked at
run-time. Equivalent to rtcheck(G, impossible).
− If the following properties hold at call time:
G is a term which represents a goal, i.e., an atom or a structure. ( callable/1)
Meta-predicate with arguments: no_rtcheck(goal).
General properties:
True: no_rtcheck(G)
− The following properties hold globally:
no_rtcheck(G) is side-effect free. ( sideff/2)
Chapter 9: Basic data types and properties 85
eval/1: PROPERTY
(True) Usage: eval(Goal)
Goal is evaluable at compile-time.
Meta-predicate with arguments: eval(goal).
equiv/2: PROPERTY
(True) Usage: equiv(Goal1,Goal2)
Goal1 is equivalent to Goal2.
Meta-predicate with arguments: equiv(goal,goal).
memo/1: PROPERTY
(True) Usage: memo(Goal)
Goal should be memoized (not unfolded).
Meta-predicate with arguments: memo(goal).
filter/2: PROPERTY
(True) Usage: filter(Vars,Goal)
Vars should be filtered during global control).
pe type/1: PROPERTY
(True) Usage: pe_type(Goal)
Goal will be filtered in partial evaluation time according to the PE types defined in the
assertion.
Meta-predicate with arguments: pe_type(goal).
86 The Ciao Preprocessor
clique/1: PROPERTY
clique(X)
X is a set of variables of interest, much the same as a sharing group but X represents all
the sharing groups in the powerset of those variables. Similar to a sharing group, a clique
is often translated to ground/1, indep/1, and indep/2 properties.
Usage: clique(X)
The clique pattern is X.
88 The Ciao Preprocessor
compat/1: PROPERTY
Usage: compat(Prop)
Use Prop as a compatibility property.
− The following properties should hold globally:
Declares that the assertion in which this comp property appears must not be checked
at run-time. Equivalent to rtcheck(G, impossible). ( no_rtcheck/1)
Meta-predicate with arguments: compat(goal).
constraint/1: PROPERTY
constraint(C)
C contains a list of linear (in)equalities that relate variables and int values. For example,
[A < B + 4] is a constraint while [A < BC + 4] or [A = 3.4, B >= C] are not.
(True) Usage: constraint(C)
C is a list of linear equations
− The following properties hold globally:
This predicate is understood natively by CiaoPP. ( native/1)
covered/1: PROPERTY
covered(X)
For any call of the form X there is at least one clause whose test succeeds (i.e., all the calls
of the form X are covered) [DLGH97].
Usage: covered(X)
All the calls of the form X are covered.
− The following properties should hold globally:
The runtime check of the property have the status unimplemented. ( rtcheck/2)
Chapter 10: Properties which are native to analyzers 89
covered/2: PROPERTY
covered(X,Y)
All variables occuring in X occur also in Y.
(True) Usage: covered(X,Y)
X is covered by Y.
− The following properties hold globally:
This predicate is understood natively by CiaoPP. ( native/1)
exception/1: PROPERTY
Usage: exception(Goal)
Calls of the form Goal throw an exception.
Meta-predicate with arguments: exception(goal).
exception/2: PROPERTY
Usage: exception(Goal,E)
Calls of the form Goal throw an exception that unifies with E.
Meta-predicate with arguments: exception(goal,?).
fails/1: PROPERTY
fails(X)
Calls of the form X fail.
(True) Usage: fails(X)
Calls of the form X fail.
− The following properties hold globally:
This predicate is understood natively by CiaoPP. ( native/1)
Meta-predicate with arguments: fails(goal).
indep/1: PROPERTY
(True) Usage: indep(X)
The variables in pairs in X are pairwise independent.
− The following properties hold globally:
This predicate is understood natively by CiaoPP as indep(X). ( native/2)
indep/2: PROPERTY
(True) Usage: indep(X,Y)
X and Y do not have variables in common.
− The following properties hold globally:
This predicate is understood natively by CiaoPP as indep([[X,Y]]). ( native/2)
instance/1: PROPERTY
Usage: instance(Prop)
Use Prop as an instantiation property. Verify that execution of Prop does not produce
bindings for the argument variables.
− The following properties should hold globally:
Declares that the assertion in which this comp property appears must not be checked
at run-time. Equivalent to rtcheck(G, impossible). ( no_rtcheck/1)
Meta-predicate with arguments: instance(goal).
is det/1: PROPERTY
is_det(X)
All calls of the form X are deterministic, i.e., produce at most one solution, or do not
terminate. In other words, if X succeeds, it can only succeed once. It can still leave choice
points after its execution, but when backtracking into these, it can only fail or go into an
infinite loop.
Usage: is_det(X)
All calls of the form X are deterministic.
Meta-predicate with arguments: is_det(goal).
linear/1: PROPERTY
linear(X)
X is bound to a term which is linear, i.e., if it contains any variables, such variables appear
only once in the term. For example, [1,2,3] and f(A,B) are linear terms, while f(A,A)
is not.
(True) Usage: linear(X)
X is instantiated to a linear term.
Chapter 10: Properties which are native to analyzers 91
mshare/1: PROPERTY
mshare(X)
X contains all sharing sets [JL88,MH89b] which specify the possible variable occurrences
in the terms to which the variables involved in the clause may be bound. Sharing sets are a
compact way of representing groundness of variables and dependencies between variables.
This representation is however generally difficult to read for humans. For this reason, this
information is often translated to ground/1, indep/1 and indep/2 properties, which are
easier to read.
Usage: mshare(X)
The sharing pattern is X.
− The following properties should hold globally:
This predicate is understood natively by CiaoPP as sharing(X). ( native/2)
Declares that the assertion in which this comp property appears must not be checked
at run-time. Equivalent to rtcheck(G, impossible). ( no_rtcheck/1)
General properties:
Test: mshare(L)
− If the following properties should hold at call time:
L=[[A],[p(A)]] ( = /2)
then the following properties should hold globally:
Calls of the form mshare(L) fail. ( fails/1)
Test: mshare(L)
− If the following properties should hold at call time:
L=[[A],[p(B)]] ( = /2)
then the following properties should hold globally:
All the calls of the form mshare(L) do not fail. ( not_fails/1)
no choicepoints/1: PROPERTY
Usage: no_choicepoints(X)
A call to X does not create choicepoints.
Meta-predicate with arguments: no_choicepoints(goal).
92 The Ciao Preprocessor
no exception/1: PROPERTY
Usage: no_exception(Goal)
Calls of the form Goal do not throw any exception.
Meta-predicate with arguments: no_exception(goal).
no exception/2: PROPERTY
Usage: no_exception(Goal,E)
Calls of the form Goal do not throw exception E.
Meta-predicate with arguments: no_exception(goal,?).
no signal/1: PROPERTY
Usage: no_signal(Goal)
Calls of the form Goal do not send any signal.
Meta-predicate with arguments: no_signal(goal).
no signal/2: PROPERTY
Usage: no_signal(Goal,E)
Calls of the form Goal do not send the signal E.
Meta-predicate with arguments: no_signal(goal,?).
nonground/1: PROPERTY
Usage: nonground(X)
X is not ground.
− The following properties should hold globally:
This predicate is understood natively by CiaoPP as not_ground(X). ( native/2)
solutions/2: PROPERTY
Usage: solutions(Goal,Sols)
Goal Goal produces the solutions listed in Sols.
− If the following properties should hold at call time:
Goal is a term which represents a goal, i.e., an atom or a structure. ( callable/1)
Sols is a list. ( list/1)
94 The Ciao Preprocessor
relations/2: PROPERTY
relations(X,N)
The goal X produces N solutions. In other words, N is the cardinality of the solution set of
X.
Usage: relations(X,N)
Goal X produces N solutions.
− The following properties should hold globally:
The runtime check of the property have the status unimplemented. ( rtcheck/2)
Meta-predicate with arguments: relations(goal,?).
signal/1: PROPERTY
Usage: signal(Goal)
Calls of the form Goal throw a signal.
Meta-predicate with arguments: signal(goal).
signal/2: PROPERTY
Usage: signal(Goal,E)
A call to Goal sends a signal that unifies with E.
Meta-predicate with arguments: signal(goal,?).
signals/2: PROPERTY
Usage: signals(Goal,Es)
Calls of the form Goal can generate only the signals that unify with the terms listed in
Es.
− The following properties should hold globally:
The runtime check of the property have the status unimplemented. ( rtcheck/2)
Meta-predicate with arguments: signals(goal,?).
size/2: PROPERTY
Usage: size(X,Y)
Y is the size of argument X, for any approximation.
− The following properties should hold globally:
Declares that the assertion in which this comp property appears must not be checked
at run-time. Equivalent to rtcheck(G, impossible). ( no_rtcheck/1)
96 The Ciao Preprocessor
size/3: PROPERTY
Usage: size(A,X,Y)
Y is the size of argument X, for the approximation A.
− The following properties should hold globally:
Declares that the assertion in which this comp property appears must not be checked
at run-time. Equivalent to rtcheck(G, impossible). ( no_rtcheck/1)
succeeds/1: PROPERTY
Usage: succeeds(Prop)
A call to Prop succeeds.
− The following properties should hold globally:
Declares that the assertion in which this comp property appears must not be checked
at run-time. Equivalent to rtcheck(G, impossible). ( no_rtcheck/1)
Meta-predicate with arguments: succeeds(goal).
steps/2: PROPERTY
steps(X,Y)
The time (in resolution steps) spent by any call of the form X is given by the expression Y
Usage: steps(X,Y)
Y is the cost (number of resolution steps) of any call of the form X.
− The following properties should hold globally:
Declares that the assertion in which this comp property appears must not be checked
at run-time. Equivalent to rtcheck(G, impossible). ( no_rtcheck/1)
Meta-predicate with arguments: steps(goal,?).
tau/1: PROPERTY
tau(Types)
Types contains a list with the type associations for each variable, in the form
V/[T1,..,TN]. Note that tau is used in object-oriented programs only
(True) Usage: tau(TypeInfo)
Types is a list of associations between variables and list of types
− The following properties hold globally:
This predicate is understood natively by CiaoPP. ( native/1)
terminates/1: PROPERTY
terminates(X)
Calls of the form X always terminate [DLGH97].
Usage: terminates(X)
All calls of the form X terminate.
− The following properties should hold globally:
Declares that the assertion in which this comp property appears must not be checked
at run-time. Equivalent to rtcheck(G, impossible). ( no_rtcheck/1)
Meta-predicate with arguments: terminates(goal).
throws/2: PROPERTY
Usage: throws(Goal,Es)
Calls of the form Goal can throw only the exceptions that unify with the terms listed in
Es.
− The following properties should hold globally:
The runtime check of the property have the status unimplemented. ( rtcheck/2)
Meta-predicate with arguments: throws(goal,?).
instance/2: PROPERTY
(True) Usage: instance(Term1,Term2)
Term1 is an instance of Term2.
− The following properties hold globally:
This predicate is understood natively by CiaoPP. ( native/1)
☛ ✟
✡ ✠
104 The Ciao Preprocessor
Chapter 12: Adding a new analysis domain to CiaoPP 105
amgu/5: PREDICATE
amgu(AbsInt,Sg,Head,ASub,AMGU)
Perform the abstract unification AMGU between Sg and Head given an initial abstract sub-
stitution ASub and abstract domain AbsInt.
project/5: PREDICATE
project(AbsInt,Vars,HvFv_u,ASub,Proj)
Projects the abstract substitution ASub onto the variables of list Vars resulting in the
projected abstract substitution Proj.
extend/5: PREDICATE
extend(AbsInt,Prime,Sv,Call,Succ)
Succ is the extension the information given by Prime (success abstract substitution over
the goal variables Sv) to the rest of the variables of the clause in which the goal occurs
(those over which abstract substitution Call is defined on). I.e., it is like a conjunction
of the information in Prime and Call, except that they are defined over different sets
of variables, and that Prime is a successor substitution to Call in the execution of the
program.
widen/4: PREDICATE
widen(AbsInt,ASub0,ASub1,ASub)
ASub is the result of widening abstract substitution ASub0 and ASub1, which are supposed
to be consecutive approximations to the same abstract value.
widencall/4: PREDICATE
widencall(AbsInt,ASub0,ASub1,ASub)
ASub is the result of widening abstract substitution ASub0 and ASub1, which are supposed
to be consecutive call patterns in a fixpoint computation.
110 The Ciao Preprocessor
glb/4: PREDICATE
glb(AbsInt,ASub0,ASub1,GlbASub)
GlbASub is the greatest lower bound of abstract substitutions ASub0 and ASub1.
concrete/4: PREDICATE
concrete(AbsInt,Var,ASub,List)
List are (all) the terms to which Var can be bound in the concretization of ASub, if they
are a finite number of finite terms. Otherwise, the predicate fails.
aidomain/1: PREDICATE
aidomain(AbsInt)
Declares that AbsInt identifies an abstract domain. The predicate is multifile.
• If Sg and Head are identical up to renaming it is just renaming Proj and adding the
Fv
• If Hv = [], Entry is just adding the Fv
• Otherwise, it will
• obtain in Binds the primitive equations corresponding to Sg=Head
• add to Proj the variables in Hv as not ground in Temp1
• update Temp1, grounding some variables obtaining Temp2
• insert Fv in Temp2 as ’any’ obtaining Temp3
• projects Temp3 onto Hv + Fv obtaining Entry
The meaning of the variables is
• Sv is a list of subgoal variables.
• Sg is the subgoal being analysed.
• Head is the Head of the clause being analysed.
• Fv is a list of free variables in the body of the clause being considered.
• Proj is the abstract substitution Call projected onto Sv.
• Entry is the Abstract entry substitution (i.e. the abstract subtitution obtained after
the abstract unification of Sg and Head projected onto Hv + Fv).
• ExtraInfo Info computed during the call to entry that can be reused during the
exit to prime step.
− The following properties should hold at call time:
Sv is currently a term which is not a free variable. ( nonvar/1)
Sg is currently a term which is not a free variable. ( nonvar/1)
Hv is currently a term which is not a free variable. ( nonvar/1)
Head is currently a term which is not a free variable. ( nonvar/1)
Fv is currently a term which is not a free variable. ( nonvar/1)
Proj is currently a term which is not a free variable. ( nonvar/1)
Entry is a free variable. ( var/1)
ExtraInfo is a free variable. ( var/1)
Sv is a list. ( list/1)
Sg is a term which represents a goal, i.e., an atom or a structure. ( callable/1)
Hv is a list. ( list/1)
Head is a term which represents a goal, i.e., an atom or a structure. ( callable/1)
Fv is a list. ( list/1)
Proj is an abstract substitution ( absu/1)
Entry is an abstract substitution ( absu/1)
ExtraInfo is a par (absu,binds) ( extrainfo/1)
gr project/3: PREDICATE
Usage: gr_project(Asub,Vars,Proj)
Proj is the result of eliminating from Asub all X/Value such that X is not in Vars
− The following properties should hold at call time:
Asub is currently a term which is not a free variable. ( nonvar/1)
Vars is currently a term which is not a free variable. ( nonvar/1)
Proj is a free variable. ( var/1)
Asub is an abstract substitution ( absu/1)
Vars is a list. ( list/1)
Proj is an abstract substitution ( absu/1)
gr extend/4: PREDICATE
Usage: gr_extend(Prime,Sv,Call,Succ)
If Prime = ’$bottom’, Succ = ’$bottom’. If Sv = [], Call = Succ. Otherwise, Succ is
computed updating the values of Call with those in Prime
− The following properties should hold at call time:
Prime is currently a term which is not a free variable. ( nonvar/1)
Sv is currently a term which is not a free variable. ( nonvar/1)
120 The Ciao Preprocessor
gr glb/3: PREDICATE
Usage: gr_glb(ASub0,ASub1,Glb)
Glb is the great lower bound of ASub0 and ASub1
− The following properties should hold at call time:
ASub0 is currently a term which is not a free variable. ( nonvar/1)
ASub1 is currently a term which is not a free variable. ( nonvar/1)
Glb is a free variable. ( var/1)
ASub0 is an abstract substitution ( absu/1)
ASub1 is an abstract substitution ( absu/1)
Glb is an abstract substitution ( absu/1)
gr sort/2: PREDICATE
Usage: gr_sort(Asub,Asub_s)
It sorts the set of X/Value in Asub ontaining Asub_s
− The following properties should hold at call time:
Asub is currently a term which is not a free variable. ( nonvar/1)
Asub_s is a free variable. ( var/1)
Asub is an abstract substitution ( absu/1)
Asub_s is an abstract substitution ( absu/1)
extrainfo/1: REGTYPE
Usage: extrainfo(E)
E is a par (absu,binds)
absu/1: REGTYPE
Usage: absu(A)
A is an abstract substitution
gr mode/1: REGTYPE
Usage: gr_mode(M)
M is g (ground), ng (nonground), or any
binds/1: REGTYPE
Usage: binds(B)
B is a list of bindings
binding/1: REGTYPE
Usage: binding(B)
B is a triple (X,Term,Vars), where X is a variable, Term is a term and Vars is the set of
variables in Term
126 The Ciao Preprocessor
References 127
References
[APG06] E. Albert, G. Puebla, and J. Gallagher.
Non-Leftmost Unfolding in Partial Evaluation of Logic Programs with Impure Pred-
icates.
In 15th International Symposium on Logic-based Program Synthesis and Transfor-
mation (LOPSTR’05), number 3901 in LNCS, pages 115–132. Springer-Verlag,
April 2006.
[BCC04] F. Bueno, D. Cabeza, M. Carro, M. Hermenegildo, P. López-Garcı́a, and G. Puebla-
(Eds.).
The Ciao System. Reference Manual (v1.10).
Technical report, School of Computer Science (UPM), 2004.
Available at http://www.ciaohome.org.
[BCHP96] F. Bueno, D. Cabeza, M. Hermenegildo, and G. Puebla.
Global Analysis of Standard Prolog Programs.
In European Symposium on Programming, number 1058 in LNCS, pages 108–124,
Sweden, April 1996. Springer-Verlag.
[BGH94] F. Bueno, M. Garcı́a de la Banda, and M. Hermenegildo.
The PLAI Abstract Interpretation System.
Technical Report CLIP2/94.0, Computer Science Dept., Technical U. of Madrid
(UPM), Facultad Informatica UPM, 28660-Boadilla del Monte, Madrid-Spain,
February 1994.
[BLGH04] F. Bueno, P. López-Garcı́a, and M. Hermenegildo.
Multivariant Non-Failure Analysis via Standard Abstract Interpretation.
In 7th International Symposium on Functional and Logic Programming (FLOPS
2004), number 2998 in LNCS, pages 100–116, Heidelberg, Germany, April 2004.
Springer-Verlag.
[BLGPH06]
F. Bueno, P. López-Garcı́a, G. Puebla, and M. Hermenegildo.
A Tutorial on Program Development and Optimization using the Ciao Preproces-
sor.
Technical Report CLIP2/06, Technical University of Madrid (UPM), Facultad de
Informática, 28660 Boadilla del Monte, Madrid, Spain, January 2006.
[CH94] D. Cabeza and M. Hermenegildo.
Extracting Non-strict Independent And-parallelism Using Sharing and Freeness In-
formation.
In 1994 International Static Analysis Symposium, number 864 in LNCS, pages 297–
313, Namur, Belgium, September 1994. Springer-Verlag.
[CMB93] M. Codish, A. Mulkers, M. Bruynooghe, M. Garcı́a de la Banda, and M.
Hermenegildo.
Improving Abstract Interpretations by Combining Domains.
In Proc. ACM SIGPLAN Symposium on Partial Evaluation and Semantics Based
Program Manipulation, pages 194–206. ACM, June 1993.
[COS96] The COSYTEC Team.
CHIP System Documentation, April 1996.
[DEDC96] P. Deransart, A. Ed-Dbali, and L. Cervoni.
Prolog: The Standard.
Springer-Verlag, 1996.
128 The Ciao Preprocessor
In Giorgio Levi, editor, Proceedings of SAS’98, volume 1503 of LNCS, pages 230–
245, Pisa, Italy, September 1998. Springer-Verlag.
[LGHD96a]
P. López-Garcı́a, M. Hermenegildo, and S. K. Debray.
A Methodology for Granularity Based Control of Parallelism in Logic Programs.
J. of Symbolic Computation, Special Issue on Parallel Symbolic Computation,
21:715–734, 1996.
[LGHD96b]
P. López-Garcı́a, M. Hermenegildo, and S. K. Debray.
A Methodology for Granularity Based Control of Parallelism in Logic Programs.
Journal of Symbolic Computation, Special Issue on Parallel Symbolic Computation,
21(4–6):715–734, 1996.
[MBdlBH99]
K. Muthukumar, F. Bueno, M. Garcı́a de la Banda, and M. Hermenegildo.
Automatic Compile-time Parallelization of Logic Programs for Restricted, Goal-
level, Independent And-parallelism.
Journal of Logic Programming, 38(2):165–218, February 1999.
[MH89a] K. Muthukumar and M. Hermenegildo.
Determination of Variable Dependence Information at Compile-Time Through Ab-
stract Interpretation.
Technical Report ACA-ST-232-89, Microelectronics and Computer Technology Cor-
poration (MCC), Austin, TX 78759, March 1989.
[MH89b] K. Muthukumar and M. Hermenegildo.
Determination of Variable Dependence Information at Compile-Time Through Ab-
stract Interpretation.
In 1989 North American Conference on Logic Programming, pages 166–189. MIT
Press, October 1989.
[MH91] K. Muthukumar and M. Hermenegildo.
Combined Determination of Sharing and Freeness of Program Variables Through
Abstract Interpretation.
In International Conference on Logic Programming (ICLP 1991), pages 49–63. MIT
Press, June 1991.
[MH92] K. Muthukumar and M. Hermenegildo.
Compile-time Derivation of Variable Dependency Using Abstract Interpretation.
Journal of Logic Programming, 13(2/3):315–347, July 1992.
[MS94] K. Marriott and P. Stuckey.
Approximating Interaction Between Linear Arithmetic Constraints.
In 1994 International Symposium on Logic Programming, pages 571–585. MIT
Press, 1994.
[PAH04] G. Puebla, E. Albert, and M. Hermenegildo.
Abstract Interpretation with Specialized Definitions.
Technical Report CLIP12/2004.0, Technical University of Madrid, School of Com-
puter Science, UPM, September 2004.
[PBH00] G. Puebla, F. Bueno, and M. Hermenegildo.
An Assertion Language for Constraint Logic Programs.
In P. Deransart, M. Hermenegildo, and J. Maluszynski, editors, Analysis and Visu-
alization Tools for Constraint Programming, number 1870 in LNCS, pages 23–61.
Springer-Verlag, September 2000.
130 The Ciao Preprocessor
Library/Module Index
A debugging_in_ciaopp . . . . . . . . . . . . . . . . . . . . . . . . . . 37
adding_new_domain . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 domains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
assertions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
assertions_props . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
auto_interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
G
gr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
B
basic_props . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 N
native_props . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
C
ciaopp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 R
regtypes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
D rtchecks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
132 The Ciao Preprocessor
Predicate/Method Index 133
Predicate/Method Index
A E
abs_sort/3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 eliminate_equivalent/3 . . . . . . . . . . . . . . . . . . . . . . 111
abs_subset/3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 empty_entry/3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
abstract_instance/5 . . . . . . . . . . . . . . . . . . . . . . . . . 114 exit_to_prime/8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
acheck/0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 extend/5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
again/0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
aidomain/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 F
amgu/5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
false/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
analyze/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
full_info_to_asub/4 . . . . . . . . . . . . . . . . . . . . . . . . . 112
asub_to_info/5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
asub_to_native/5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
augment_asub/4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 G
augment_two_asub/4 . . . . . . . . . . . . . . . . . . . . . . . . . . 111 get_menu_configs/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
auto_analyze/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 glb/4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
auto_analyze/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 gr_asub_to_native/3 . . . . . . . . . . . . . . . . . . . . . . . . . 123
auto_check_assert/1 . . . . . . . . . . . . . . . . . . . . . . . . . . 12 gr_call_to_entry/8 . . . . . . . . . . . . . . . . . . . . . . . . . . 117
auto_check_assert/2 . . . . . . . . . . . . . . . . . . . . . . . . . . 13 gr_call_to_success_builtin/6 . . . . . . . . . . . . . . . 122
auto_optimize/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 gr_call_to_success_fact/8 . . . . . . . . . . . . . . . . . . 121
auto_optimize/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 gr_compute_lub/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
gr_empty_entry/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
gr_exit_to_prime/7 . . . . . . . . . . . . . . . . . . . . . . . . . . 118
B gr_extend/4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
body_succ_builtin/9 . . . . . . . . . . . . . . . . . . . . . . . . . 111 gr_glb/3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
gr_input_interface/4 . . . . . . . . . . . . . . . . . . . . . . . . 123
gr_input_user_interface/3 . . . . . . . . . . . . . . . . . . 123
C gr_less_or_equal/2 . . . . . . . . . . . . . . . . . . . . . . . . . . 120
gr_project/3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
call_to_entry/9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 gr_sort/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
call_to_success_builtin/7 . . . . . . . . . . . . . . . . . . 114 gr_special_builtin/4 . . . . . . . . . . . . . . . . . . . . . . . . 121
call_to_success_fact/9 . . . . . . . . . . . . . . . . . . . . . . 111 gr_success_builtin/5 . . . . . . . . . . . . . . . . . . . . . . . . 122
check/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 gr_unknown_call/3 . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
clean_aux_files/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 gr_unknown_entry/2 . . . . . . . . . . . . . . . . . . . . . . . . . . 124
collect_types_in_abs/4 . . . . . . . . . . . . . . . . . . . . . . 113
compute_lub/3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
concrete/4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
H
contains_parameters/2 . . . . . . . . . . . . . . . . . . . . . . . 114 help/0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
current_pp_flag/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 hook_menu_check_flag_value/3 . . . . . . . . . . . . . . . . 16
customize/0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 hook_menu_default_option/3 . . . . . . . . . . . . . . . . . . 16
customize/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 hook_menu_flag_help/3 . . . . . . . . . . . . . . . . . . . . . . . . 16
hook_menu_flag_values/3 . . . . . . . . . . . . . . . . . . . . . . 16
customize_and_preprocess/0 . . . . . . . . . . . . . . . . . . 13
customize_and_preprocess/1 . . . . . . . . . . . . . . . . . . 13
customize_and_preprocess_java/1 . . . . . . . . . . . . . 14 I
customize_but_dont_save/1. . . . . . . . . . . . . . . . . . . . 14
identical_abstract/3 . . . . . . . . . . . . . . . . . . . . . . . . 110
customize_java/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
identical_proj/5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
identical_proj_1/7 . . . . . . . . . . . . . . . . . . . . . . . . . . 110
info_to_asub/5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
D init_abstract_domain/2 . . . . . . . . . . . . . . . . . . . . . . 108
dom_statistics/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 input_interface/5 . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
134 The Ciao Preprocessor
input_user_interface/4 . . . . . . . . . . . . . . . . . . . . . . 115 R
remove_menu_config/1 . . . . . . . . . . . . . . . . . . . . . . . . . 15
rename_types_in_abs/4 . . . . . . . . . . . . . . . . . . . . . . . 113
L restore_menu_config/1 . . . . . . . . . . . . . . . . . . . . . . . . 15
less_or_equal/3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
less_or_equal_proj/5 . . . . . . . . . . . . . . . . . . . . . . . . 110 S
save_menu_config/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
M select_modules/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
set_pp_flag/2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
module/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 show_menu_config/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
multi_part_conc/4 . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 show_menu_configs/0 . . . . . . . . . . . . . . . . . . . . . . . . . . 15
special_builtin/6 . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
success_builtin/7 . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
N
normalize_asub/3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 T
transform/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
true/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
O trust/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
obtain_info/5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
output/0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
output/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
U
unknown_call/4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
unknown_call/5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
P unknown_entry/3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
unknown_entry/4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
part_conc/5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
pop_pp_flag/1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
pp_flag/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 W
project/5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 widen/4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
push_pp_flag/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 widencall/4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Property Index 135
Property Index
A L
analysis/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 linear/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
B
bind_ins/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 M
member/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
C memo/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
clique/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 mshare/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
clique_1/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 mut_exclusive/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
compat/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
compat/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
constraint/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
covered/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 N
covered/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 nabody/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
native/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
D native/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
deprecated/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 no_choicepoints/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
docstring/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 no_exception/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
no_exception/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
no_rtcheck/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
E
no_signal/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
equiv/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
no_signal/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
error_free/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
eval/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 non_det/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
exception/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 nonground/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
exception/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 not_covered/1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
not_fails/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
F not_further_inst/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
not_mut_exclusive/1 . . . . . . . . . . . . . . . . . . . . . . . . . . 93
fails/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
filter/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 num_solutions/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
finite_solutions/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
H P
have_choicepoints/1 . . . . . . . . . . . . . . . . . . . . . . . . . . 89 pe_type/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
head_pattern/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 possibly_fails/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
possibly_nondet/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
I
indep/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
indep/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 R
inst/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
regtype/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
instance/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
instance/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 relations/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
is_det/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 rtcheck/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
iso/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 rtcheck/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
136 The Ciao Preprocessor
S steps_o/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
steps_ub/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
sideff/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
succeeds/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
sideff_hard/1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
sideff_pure/1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
sideff_soft/1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 T
signal/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
tau/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
signal/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
terminates/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
signals/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 test_type/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
size/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 throws/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
size/3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 transformation/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
size_lb/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
size_metric/3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
size_metric/4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 U
size_o/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 user_output/2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
size_ub/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
solutions/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
steps/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 V
steps_lb/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 valid_flag_value/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Regular Type Index 137
A gr_mode/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
absu/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
absu_elem/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
assrt_body/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
I
assrt_status/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 int/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
assrt_type/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
atm/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
atm_or_atm_list/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 L
list/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
list/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
B
binding/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
binds/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 N
nlist/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
nnegint/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
C num/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
c_assrt_body/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 num_code/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
callable/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
character_code/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
complex_arg_property/1 . . . . . . . . . . . . . . . . . . . . . . . 59 O
complex_goal_property/1 . . . . . . . . . . . . . . . . . . . . . . 59
operator_specifier/1 . . . . . . . . . . . . . . . . . . . . . . . . . 75
constant/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
D P
predfunctor/1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
dictionary/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
predname/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
property_conjunction/1 . . . . . . . . . . . . . . . . . . . . . . . 59
E property_starterm/1 . . . . . . . . . . . . . . . . . . . . . . . . . . 59
propfunctor/1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
extrainfo/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
F S
flag_value/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 s_assrt_body/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
flag_values/1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 sequence/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
flt/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 sequence_or_list/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
string/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
struct/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
G
g_assrt_body/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
gnd/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
T
gndstr/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 term/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
138 The Ciao Preprocessor
Declaration Index 139
Declaration Index
C P
calls/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 pred/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
calls/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 pred/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
comment/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 prop/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
comp/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 prop/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
comp/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
R
D regtype/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
decl/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 regtype/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
decl/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
doc/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
S
success/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
E success/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
entry/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
exit/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
exit/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 T
test/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
test/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
M texec/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
modedef/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 texec/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
140 The Ciao Preprocessor
Concept Index 141
Concept Index
A M
acceptable modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 module declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
assertion body syntax . . . . . . . . . . . . . . . . . . . 57, 60, 61
assertion checking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
P
C parametric type functor . . . . . . . . . . . . . . . . . . . . . . . . 66
calls assertion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49, 50 pred assertion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48, 49
check assertion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 program transformations . . . . . . . . . . . . . . . . . . . . . . . . . 7
comment assertion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 prop assertion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51, 52
comments, machine readable . . . . . . . . . . . . . . . . . . . . 47
properties of computations . . . . . . . . . . . . . . . . . . . . . . 63
comp assertion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
properties of execution states . . . . . . . . . . . . . . . . . . . 63
compatibility properties . . . . . . . . . . . . . . . . . . . . . . . . 63
properties, basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
properties, native . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
D
data declaration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 R
decl assertion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
regtype assertion . . . . . . . . . . . . . . . . . . . . . . . . . . . 66, 67
dynamic declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
regular type expression . . . . . . . . . . . . . . . . . . . . . . . . . 67
run-time tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
E
entry assertion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
entry declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 S
exit assertion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
sharing sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
soft side-effects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
F specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
false assertion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 static debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
formatting commands . . . . . . . . . . . . . . . . . . . . . . . . . . 47 success assertion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
H T
hard side-effects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
test assertion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50, 51
texec assertion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
I true assertion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
instantiation properties . . . . . . . . . . . . . . . . . . . . . . . . . 63 trust assertion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
ISO-Prolog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 trust assertions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
142 The Ciao Preprocessor
Author Index 143
Author Index
C G
Claudio Vaucheret . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 German Puebla . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
D M
Daniel Cabeza . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 Manuel Hermenegildo . . . . . . . . . . . . . 47, 57, 63, 69, 87
David Trallero Mena . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Maria Garcia de la Banda . . . . . . . . . . . . . . . . . . . . . 107
E P
Edison Mera . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87, 101 Pedro Lopez . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63, 87
F T
Francisco Bueno . . . . . . . . . . . . . . . . . 37, 47, 63, 87, 107 The CLIP Group . . . . . . . . . . . . 9, 19, 33, 35, 103, 105
144 The Ciao Preprocessor
Global Index 145
Global Index
This is a global index containing pointers to places where concepts, predicates, modes, prop-
erties, types, applications, etc., are referred to in the text of the document.
’ assertions . . 12, 19, 47, 48, 57, 66, 69, 87, 102, 108,
117
’,’/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
assertions/assertions_props . . . . . . . . . . . . . . 48, 66
assertions/native_props . . . . . . . . . . . . . . . . . 69, 108
* assertions_props . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
*/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 assrt_body/1. . . . . . . . . . . . . . . . . 48, 49, 52, 53, 57, 67
assrt_status/1 . . . . . . . . 49, 50, 51, 52, 53, 57, 61, 67
: assrt_type/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57, 62
asub_to_info/5 . . . . . . . . . . . . . . . . . . . . . . . . . . 108, 112
::/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
asub_to_native/5 . . . . . . . . . . . . . . . . . . . . . . . . 108, 112
atm/1 . . . . . . . . . . . . . . . . . . . . . . . . . . 15, 69, 72, 73, 122
= atm_or_atm_list/1 . . . . . . . . . . . . . . . . . . . . . 69, 80, 81
= /2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 atom/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
=>/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 atomic_basic . . . 12, 19, 48, 57, 69, 87, 102, 108, 117
augment_asub/4 . . . . . . . . . . . . . . . . . . . . . . . . . . 108, 111
+ augment_two_asub/4 . . . . . . . . . . . . . . . . . . . . . . 108, 111
auto_analyze/1 . . . . . . . . . . . . . . . . . . . . . . . . . 11, 12, 13
+/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
+/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 auto_analyze/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12, 13
auto_check_assert/1 . . . . . . . . . . . . . . . . . . . 11, 12, 13
auto_check_assert/2 . . . . . . . . . . . . . . . . . . . . . . . 12, 13
A auto_check_assrt/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
abs_sort/3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108, 110 auto_interface . . . . . . . . . . . . . . . . . . . . . . . . . 11, 23, 24
abs_subset/3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108, 111
auto_interface(auto_help). . . . . . . . . . . . . . . . . . . . 19
abstract_instance/5. . . . . . . . . . . . . . . . . . . . . 108, 114
auto_interface(auto_interface) . . . . . . . . . . . . . . 19
absu/1 . . . . . . . . 118, 119, 120, 121, 122, 123, 124, 125
absu_elem/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 auto_interface(optim_comp) . . . . . . . . . . . . . . . . . . 12
acceptable modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 auto_optimize/1. . . . . . . . . . . . . . . . . . . . . . . . 11, 12, 13
acheck/0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 auto_optimize/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . 12, 13
acheck_summary/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
adding_new_domain . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
again/0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12, 14
aggregates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 B
aidomain/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108, 114
basic_props . . . . 12, 19, 48, 57, 69, 87, 102, 108, 117
amgu/5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
analysis/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23, 25 basic_props.pl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
analyze/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 basic_props:regtype/1 . . . . . . . . . . . . . . . . . . . . . . . . 63
analyzer output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 basiccontrol . . . 12, 19, 48, 57, 69, 87, 102, 108, 117
api(api_menu). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 basicmodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
argnames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 bind_ins/1. . . . . . . . . . . . . . . . . . . . . . . . . . 69, 72, 77, 85
arithmetic . . 12, 19, 48, 49, 57, 69, 87, 102, 108, 117
binding/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
assertion body syntax . . . . . . . . . . . . . . . . . . 57, 60, 61
assertion checking. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 binds/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
assertion language . . . . . . . . . . . . . . . . . . . . . . . . . . 1, 3 body_succ_builtin/9 . . . . . . . . . . . . . . . . 108, 111, 115
assertion status . . . . . . . . . . . . . . . . . . . 49, 50, 51, 53 bzip2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
146 The Ciao Preprocessor
C computational cost . . . . . . . . . . . . . . . . . . . . . . . . . . 1, 3
c_assrt_body/1 . . . . . . . . . . . . . . . . . . 49, 50, 52, 57, 60 compute_lub/3 . . . . . . . . . . . . . . . . . . . . . . . . . . . 108, 110
concrete/4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108, 112
call/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
condcomp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
call_rtc/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
constant/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69, 74
call_to_entry/9 . . . . . . . . . . . . . . . . . . . . . . . . . 108, 109
constraint/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87, 88
call_to_success_builtin/7 . . . . . . . . . . . . . . . . . . 114
contains_parameters/2 . . . . . . . . . . . . . . . . . . 108, 114
call_to_success_fact/9 . . . . . . . . . . . . . . . . . 108, 111
covered/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87, 88
callable/1 . . . . 69, 75, 82, 84, 93, 118, 119, 121, 122,
covered/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87, 89
123
ctcheck_sum/1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
calls assertion . . . . . . . . . . . . . . . . . . . . . . . . . . . 49, 50
current_pp_flag/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
calls/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48, 49, 50, 52
customize/0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12, 13, 24
calls/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48, 50
customize/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12, 13
character string . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
customize_and_preprocess/0 . . . . . . . . . . . . 12, 13, 24
character_code/1 . . . . . . . . . . . . . . . . . . . . . . . . . . 69, 79
customize_and_preprocess/1 . . . . . . . . 11, 12, 13, 14
check assertion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
customize_and_preprocess_java/1 . . . . . . 12, 14, 24
Check(X) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
customize_but_dont_save/1 . . . . . . . . . . . . . . . . 12, 14
check/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48, 54, 55
customize_java/1 . . . . . . . . . . . . . . . . . . . . . . 12, 14, 24
checking the assertions . . . . . . . . . . . . . . . . . . . . . 1, 3
ciaopp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19, 87
ciaopp(driver) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12, 19 D
ciaopp(infercost(infercost_register)) . . . . . . . 19
Daniel Cabeza . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
ciaopp(p_unit(p_dump)) . . . . . . . . . . . . . . . . . . . . . . . 12
data declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
ciaopp(plai(fixpo_ops)) . . . . . . . . . . . . . . . . . . . . . . 12 data_facts . . . . . 12, 19, 48, 57, 69, 87, 102, 108, 117
ciaopp(preprocess_flags) . . . . . . . . . . . . . 12, 19, 108 David Trallero Mena . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
ciaopp(printer) . . . . . . . . . . . . . . . . . . . . . . . . . . . 12, 19 dcg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
ciaopp(resources(resources_register)) . . . . . . . 19 debugger_support . . . 12, 19, 48, 57, 69, 87, 102, 108,
ciaopp_options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 117
Claudio Vaucheret. . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
clean_aux_files/1 . . . . . . . . . . . . . . . . . . . . . 12, 14, 24 debugging_in_ciaopp . . . . . . . . . . . . . . . . . . . . . . . . . . 37
clique/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 decl assertion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
clique_1/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87, 88 decl/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48, 53, 57
collect_types_in_abs/4 . . . . . . . . . . . . . . . . . 108, 113 decl/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48, 53
comment assertion. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 deprecated/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69, 82
comment string . . . . . . . . . . . . . . . . . . . . . . . . . 58, 60, 61 determinacy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1, 3
comment/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48, 54 dictionary/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57, 60
comments, machine readable . . . . . . . . . . . . . . . . . . . 47 doc/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48, 53, 54
comp assertion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 docstring/1 . . . . . . . . . . . . . . 47, 54, 57, 58, 60, 61, 62
comp/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48, 51, 61 dom_statistics/2 . . . . . . . . . . . . . . . . . . . . . . . . 108, 114
comp/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48, 51 domain(aeq_top) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
compat/1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87, 88 domain(bshare(bshare)) . . . . . . . . . . . . . . . . . . . . . . 108
compat/2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69, 81 domain(def) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
compatibility properties . . . . . . . . . . . . . . . . . . . . . 63 domain(deftypes) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
compatible . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 domain(depthk) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
complex argument property . . . . . . . 57, 58, 59, 60, 61 domain(detplai) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
complex goal property . . . . . . . . . . . . . . . . . . 58, 60, 61 domain(eterms) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
complex_arg_property/1 . . . . . . . . . 57, 58, 59, 60, 61 domain(fd) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
complex_goal_property/1 . . . . . . . . . . . 57, 58, 59, 61 domain(fr_top) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Global Index 147
gr_special_builtin/4 . . . . . . . . . . . . . . . . . . . 117, 121 io_basic . . . . . . . 12, 19, 48, 57, 69, 87, 102, 108, 117
gr_success_builtin/5 . . . . . . . . . . . . . . . . . . . 117, 122 is_det/1 . . . . . . . . . . . 70, 71, 72, 73, 74, 75, 76, 87, 90
gr_unknown_call/3 . . . . . . . . . . . . . . . . . . . . . . . 117, 124 ISO-Prolog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
gr_unknown_entry/2 . . . . . . . . . . . . . . . . . . . . . . 117, 124 iso/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69, 81
granularity control . . . . . . . . . . . . . . . . . . . . . . . . . 1, 3
ground/1 . . . . 73, 74, 76, 77, 78, 79, 80, 81, 87, 88, 91
gunzip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 L
L=[[A],[p(A)]] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
H L=[[A],[p(B)]] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
hard side-effects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 less_or_equal/3 . . . . . . . . . . . . . . . . . . . . . . . . . 108, 110
have_choicepoints/1 . . . . . . . . . . . . . . . . . . . . . . . 87, 89 less_or_equal_proj/5 . . . . . . . . . . . . . . . . . . . 108, 110
head pattern . . . . . . . . . . . . . . . . . . . . . . . . . . . 57, 58, 61 library(basicmodes) . . . . . . . . . . . . . . . . . . . . . . . . . . 58
head_pattern/1 . . . . . . . . . . . . . . . . . . . . . 54, 57, 58, 61 library(isomodes) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
help/0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19, 24 linear/1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87, 90
hiord . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 list/1 . . . . . 69, 76, 77, 78, 81, 93, 118, 119, 120, 121,
hiord_rt . . . . . . . 12, 19, 48, 57, 69, 87, 102, 108, 117 122, 123, 124
hiordlib . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 list/2 . . . . . . . . . . . . . . . . . . . . . . 14, 22, 59, 69, 76, 120
hook_menu_check_flag_value/3 . . . . . . . . . . . . . 12, 16 lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12, 48, 51, 87
hook_menu_default_option/3 . . . . . . . . . . . . . . . 12, 16 literal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
hook_menu_flag_help/3 . . . . . . . . . . . . . . . . . . . . 12, 16 long . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
hook_menu_flag_values/3 . . . . . . . . . . . . . . . . . . 12, 16 lpdoc . . . . . . . . . . . . . . . . . . . . . . . . . . 1, 3, 47, 54, 58, 62
I
M
identical_abstract/3 . . . . . . . . . . . . . . . . . . . 108, 110
identical_proj/5 . . . . . . . . . . . . . . . . . . . . . . . . 108, 110 make . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
identical_proj_1/7 . . . . . . . . . . . . . . . . . . . . . . 108, 110 Manuel Hermenegildo . . . . . . . . . . . . . 47, 57, 63, 69, 87
indep/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87, 88, 90, 91 Maria Garcia de la Banda . . . . . . . . . . . . . . . . . . . . . 107
indep/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87, 88, 90, 91 member/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69, 77, 82
infer(infer_db) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 memo/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69, 85
infer(infer_dom) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 menu/menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
infer(low_level_props) . . . . . . . . . . . . . . . . . . . . . . 108 menu/menu_generator . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Inference of properties . . . . . . . . . . . . . . . . . . . . . 1, 3 menu/menu_rt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
info_to_asub/5 . . . . . . . . . . . . . . . . . . . . . . . . . . 108, 112 menu_branch/3 . . . . . . . . . . . . . . . . . . . . . . . . . . 16, 23, 24
init_abstract_domain/2 . . . . . . . . . . . . . . . . . . . . . . 108 menu_branch/4 . . . . . . . . . . . . . . . . . . . . . . . . . . 16, 23, 24
inner . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
menu_generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15, 16
input_interface/5 . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
menu_rt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
input_user_interface/4 . . . . . . . . . . . . . . . . . . . . . . 115
messages . . . . . . . . . . . . . . . . . . . . . . . . . . 12, 19, 108, 117
inst/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69, 81
mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48, 58
instance/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87, 90
instance/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 modedef/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48, 53, 58
instantiation properties . . . . . . . . . . . . . . . . . . . . . 63 modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1, 3
int/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69, 70, 93 module declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
integer/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 module/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
inter-modular analysis . . . . . . . . . . . . . . . . . . . . . . . 30 mshare/1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87, 91
internals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 multi_part_conc/4 . . . . . . . . . . . . . . . . . . . . . . . 108, 112
io_aux . . . . . . . . . . 12, 19, 48, 57, 69, 87, 102, 108, 117 mut_exclusive/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 87, 91
Global Index 149
N P
n_assrt_body/5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60, 61 parametric type functor . . . . . . . . . . . . . . . . . . . . . . 66
nabody/1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57, 60 part_conc/5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108, 112
native/1 . . . 69, 70, 71, 72, 73, 74, 83, 88, 89, 91, 93, Partial deduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
98, 99 partial evaluation . . . . . . . . . . . . . . . . . . . . . . . 1, 3, 32
native/2 . . . . . . . . . . . . . . . . . . . . . 69, 83, 88, 90, 91, 92 pe_type/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69, 85
native_props . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 Pedro Lopez . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63, 87
nativeprops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 plai(acc_ops). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
nativeprops.pl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 plai(fixpo_ops) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
plai(intermod) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
nlist/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
plai(plai_errors) . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
nlist/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69, 77
pop_pp_flag/1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
nnegint/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69, 70, 71
possibly_fails/1 . . . . . . . . . . . . . . . . . . . . . . . . . . 87, 93
no . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101, 102
possibly_nondet/1 . . . . . . . . . . . . . . . . . . . . . . . . . 87, 94
no_choicepoints/1 . . . . . . . . . . . . . . . . . . . . . 23, 87, 91
pp_flag/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19, 20, 21
no_exception/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87, 92
pred assertion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48, 49
no_exception/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87, 92
pred/1 . . . . . . . . . . . . . . . . . . . . 48, 49, 50, 51, 53, 57, 60
no_rtcheck/1 . . 69, 82, 83, 84, 88, 89, 90, 91, 94, 95, pred/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48, 49
96, 97, 98 predfunctor/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57, 62
no_signal/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87, 92 predicate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
no_signal/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87, 92 predname/1 . . . . . . . . . . . . . . . . . . . . 58, 69, 80, 122, 123
non-failure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1, 3 prelude . . . . . 12, 19, 48, 57, 66, 69, 87, 102, 108, 117
non_det/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87, 92 printer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
nonground/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87, 92 program assertions . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
nonpure . . . . . . . . . 12, 19, 48, 57, 69, 87, 102, 108, 117 program parallelization . . . . . . . . . . . . . . . . . . . . . 1, 3
nonvar/1 . . . 22, 23, 70, 71, 72, 73, 74, 75, 76, 78, 79, program specialization . . . . . . . . . . . . . . . . . . . . . . 1, 3
118, 119, 120, 121, 122, 123, 124 program transformations . . . . . . . . . . . . . . . . . . 1, 3, 7
normalize_asub/3 . . . . . . . . . . . . . . . . . . . . . . . . 108, 110 program(assrt_db) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
nortchecks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 program(aux_filenames) . . . . . . . . . . . . . . . . . . . . . . . 12
not_covered/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87, 92 program(itf_db) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
not_fails/1 . . . . . . . . . . . . . . . . . . . . . . . . 23, 87, 91, 93 program(p_asr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
not_further_inst/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 program(p_unit) . . . . . . . . . . . . . . . . . . . . . . . . . . 12, 108
not_further_inst/2 . . . . . . . . . . . . . . . . . . . . . . . . 69, 82 project/5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108, 109
not_mut_exclusive/1 . . . . . . . . . . . . . . . . . . . . . . . 87, 93 prolog_flags . . . 12, 19, 48, 57, 69, 87, 102, 108, 117
num/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69, 72 prolog_sys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
num_code/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69, 80 prompt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
num_solutions/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . 87, 93 prop assertion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51, 52
prop/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48, 51, 52
prop/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48, 52
O properties of computations . . . . . . . . . . . . . . . . . . . 63
properties of execution states . . . . . . . . . . . . . . . 63
obtain_info/5 . . . . . . . . . . . . . . . . . . . . . . . . . . . 108, 112 properties, basic. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
odd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 properties, native . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
operator_specifier/1 . . . . . . . . . . . . . . . . . . 69, 75, 76 property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
output/0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 property compatibility . . . . . . . . . . . . . . . . . . . . . . . 81
output/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 property_conjunction/1 . . . . . . . . . . . . . 54, 55, 57, 59
output/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 property_starterm/1 . . . . . . . . . . . . . . . . . . . . . . . 57, 59
150 The Ciao Preprocessor
T typeslib(typeslib) . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
tau/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87, 98
term/1 . . . . . . . . . . . . . . . . . . . . . . . 69, 77, 122, 123, 124
U
term_basic . . 12, 19, 48, 57, 66, 69, 87, 102, 108, 117
term_compare . . . 12, 19, 48, 57, 69, 87, 102, 108, 117 unknown_call/4 . . . . . . . . . . . . . . . . . . . . . . . . . . 108, 113
term_typing . . . . 12, 19, 48, 57, 69, 87, 102, 108, 117 unknown_call/5 . . . . . . . . . . . . . . . . . . . . . . . . . . 108, 113
terminates/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87, 98 unknown_entry/3 . . . . . . . . . . . . . . . . . . . . . . . . . 108, 113
terms_check . . . . . . . . . . . . . . . . . . . . . . 69, 87, 108, 117 unknown_entry/4 . . . . . . . . . . . . . . . . . . . . . . . . . 108, 113
terms_vars . . . . . . . . . . . . . . . . . . . . . . . . . . . 87, 108, 117 usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
test assertion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50, 51 user_output/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87, 99
test/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48, 50, 51
test/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48, 50
test_type/2 . . . . . . . . . . . . . . 70, 71, 72, 73, 74, 87, 98
V
texec assertion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 valid_flag_value/2 . . . . . . . . . . . . . . . . . . . . 19, 20, 21
texec/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48, 49 var/1 . . . . 14, 22, 23, 59, 118, 119, 120, 121, 122, 123,
texec/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48, 49 124
The CLIP Group . . . . . . . . . . . . . . 9, 19, 33, 35, 103, 105 variable instantiation. . . . . . . . . . . . . . . . . . . . 1, 3, 6
throws/2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87, 99 variable names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
transform/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
transformation/1 . . . . . . . . . . . . . . . . . . . . . . . . . . 22, 27
true assertion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
W
true/1 . . . . . . . . . . . . . . . . . . . . . . . . . . 16, 23, 24, 48, 55 widen/4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108, 109
true/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16, 23, 24 widencall/4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108, 109
trust assertion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
trust assertions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
trust/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48, 54 Y
types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1, 3 yes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101, 102
152 The Ciao Preprocessor