The Ciao Internals

The Ciao Compiler, Engine, and Runtime libraries

REFERENCE MANUAL The Ciao Documentation Series

                     https://ciao-lang.org/

Generated/Printed on: 22 July 2023

Table of Contents

1 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

2 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

3 Dynamic loading and compilation. . . . . . . . . . . . . . 5

3.1 Usage and interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 3.2 Documentation on exports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

make po/1 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 make wam/1 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 ensure loaded/1 (pred). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 ensure loaded/2 (pred). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 use module/1 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 use module/2 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 use module/3 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 unload/1 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 set debug mode/1 (pred). . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 set nodebug mode/1 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . 6 set debug module/1 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . 6 set nodebug module/1 (pred). . . . . . . . . . . . . . . . . . . . . . . . 6 set debug module source/1 (pred) . . . . . . . . . . . . . . . . . . . 6 mode of module/2 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 module of/2 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

3.3 Documentation on imports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

4 exemaker (library) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

4.1 Usage and interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 4.2 Documentation on exports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

make exec/2 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 force lazy/1 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 undo force lazy/1 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 dynamic search path/1 (pred) . . . . . . . . . . . . . . . . . . . . . . . 7 needs interface/2 (pred). . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 create interfaces/0 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

4.3 Documentation on multifiles. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

define flag/3 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

4.4 Documentation on imports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

5 Compiler frontend . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

5.1 Usage and interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 5.2 Documentation on exports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

compiler version/1 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 compiler name/1 (pred). . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 opt suffix/2 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 defines module/2 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 def multifile/4 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 decl/2 (pred). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 exports/5 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 uses/2 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 adds/2 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 uses file/2 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 imports pred/7 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 imports all/2 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 includes/2 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 loads/2 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 clause of/7 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 package/2 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 imports nocheck/4 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . 12 defines pred/3 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 meta pred/4 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 dyn decl/4 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 defines/5 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 comp defines/1 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 restore defines/5 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 restore imports/5 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 restore multifile/4 (pred). . . . . . . . . . . . . . . . . . . . . . . . . . . 12 imports/5 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 meta args/2 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 (multifile)/3 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 defines/3 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 (discontiguous)/3 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 add module check/1 (pred). . . . . . . . . . . . . . . . . . . . . . . . . 13 ensure imported/4 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . 13 define ops/0 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 processed/2 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 process files from/7 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . 14 process file/7 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 old file extension/2 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . 14 cleanup c itf data/0 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . 14 cleanup itf cache/0 (pred). . . . . . . . . . . . . . . . . . . . . . . . . . 14 base name/2 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 file data/3 (pred). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 compute base name/4 (pred) . . . . . . . . . . . . . . . . . . . . . . . 14 module from base/2 (pred). . . . . . . . . . . . . . . . . . . . . . . . . 14 exports pred/3 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 module error/0 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 module error/1 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 expand module decl/5 (pred). . . . . . . . . . . . . . . . . . . . . . . 15 read sentence/3 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 default package/1 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 handle exc/1 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 false/1 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 make object1/2 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 make po file/1 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 activate translation/3 (pred) . . . . . . . . . . . . . . . . . . . . . . . 15 end goal trans/1 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 module expansion/9 (pred). . . . . . . . . . . . . . . . . . . . . . . . . 15 c itf internal pred/2 (pred). . . . . . . . . . . . . . . . . . . . . . . . . 16 c itf internal pred decl/1 (pred) . . . . . . . . . . . . . . . . . . . . 16 incore mode of/2 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 pred module/2 (pred). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 location t/1 (regtype) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 location/3 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 location/1 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 set ciaopp expansion/1 (pred) . . . . . . . . . . . . . . . . . . . . . . 16 (multifile)/1 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 module loaded/4 (pred). . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 static module/1 (pred). . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 static base/1 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 use mod/3 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 use mod user/2 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 abolish module/1 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 unload mod/1 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 interpret file/1 (pred). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 interpret module/1 (pred). . . . . . . . . . . . . . . . . . . . . . . . . . 17 interpret srcdbg/1 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . 17

5.3 Documentation on multifiles. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 define flag/3 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 do on abolish/1 (pred). . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

5.4 Documentation on imports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

6 pl2wam (library) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

6.1 Usage and interface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 6.2 Documentation on exports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

reset counter/1 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 set compiler mode out/2 (pred) . . . . . . . . . . . . . . . . . . . . 19 set compiler mode/1 (pred) . . . . . . . . . . . . . . . . . . . . . . . . 19 set compiler out/1 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . 19 compile clause/2 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 compile clause in mode/3 (pred). . . . . . . . . . . . . . . . . . . . 19 proc declaration/4 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . 19 proc declaration in mode/5 (pred) . . . . . . . . . . . . . . . . . . 19 cleanup compilation data/0 (pred) . . . . . . . . . . . . . . . . . . 20

6.3 Documentation on imports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

7 Emulator description language. . . . . . . . . . . . . . . . 21

7.1 Usage and interface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

8 The Ciao engine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

Library/Module Index . . . . . . . . . . . . . . . . . . . . . . . . . . 27

Predicate Index. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

Property Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

Regular Type Index. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

Declaration Index. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

Concept Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

Author Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

Global Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

Chapter 1: Summary 1

1 Summary

This (semi-automatically generated) manual is still incomplete. It is however being updated regularly as the machine-readable documentation of the different libraries is completed.

This is the internal manual for the Ciao compiler, engine, and runtime libraries. It documents modules not included in the reference manual.

Please consult the alldocs bundle for the Ciao reference manual.

2 The Ciao Internals Chapter 2: Introduction 3

2 Introduction

This (semi-automatically generated) manual is still incomplete. It is however being updated regularly as the machine-readable documentation of the different libraries is completed.

This is the internal manual for the Ciao compiler, engine, and runtime libraries. It documents modules not included in the reference manual.

Please consult the alldocs bundle for the Ciao reference manual.

4 The Ciao Internals

3 Dynamic loading and compilation

Author(s): The Ciao Development Team. This module provides a simplified interface to the Ciao compiler front-end (see toplevel for

details).

3.1 Usage and interface

• Library usage:

:- use_module(library(compiler)).

• Exports:

− Predicates:

   make_po/1, make_wam/1, ensure_loaded/1, ensure_loaded/2, use_module/1, use_
   module/2, use_module/3, unload/1, set_debug_mode/1, set_nodebug_mode/1, set_
   debug_module/1, set_nodebug_module/1, set_debug_module_source/1, mode_of_
   module/2, module_of/2.

3.2 Documentation on exports

PREDICATE make po/1:

No further documentation available for this predicate.

PREDICATE make wam/1:

No further documentation available for this predicate.

PREDICATE ensure loaded/1:

No further documentation available for this predicate.

PREDICATE ensure loaded/2:

No further documentation available for this predicate.

PREDICATE use module/1:

No further documentation available for this predicate.

PREDICATE use module/2:

No further documentation available for this predicate. Meta-predicate with arguments:

use_module(?,addmodule(?)).

PREDICATE use module/3:

No further documentation available for this predicate.

PREDICATE unload/1:

No further documentation available for this predicate.

PREDICATE set debug mode/1:

No further documentation available for this predicate.

PREDICATE set nodebug mode/1:

No further documentation available for this predicate.

PREDICATE set debug module/1:

No further documentation available for this predicate.

PREDICATE set nodebug module/1:

No further documentation available for this predicate.

PREDICATE set debug module source/1:

No further documentation available for this predicate.

PREDICATE mode of module/2:

No further documentation available for this predicate.

PREDICATE module of/2:

No further documentation available for this predicate.

3.3 Documentation on imports

This module has the following direct dependencies: − Application modules:

datafacts_rt, system, c_itf, exemaker.

− Packages:

prelude, initial, condcomp, assertions, assertions/assertions_basic, datafacts.

4 exemaker (library)

4.1 Usage and interface

• Library usage:

:- use_module(library(compiler/exemaker)).

• Exports:

− Predicates:

   make_exec/2, force_lazy/1, undo_force_lazy/1, dynamic_search_path/1, needs_
   interface/2, create_interfaces/0.

− Multifiles:

   define_flag/3.

4.2 Documentation on exports

PREDICATE make exec/2:

No further documentation available for this predicate.

PREDICATE force lazy/1:

No further documentation available for this predicate.

PREDICATE undo force lazy/1:

No further documentation available for this predicate.

PREDICATE dynamic search path/1:

No further documentation available for this predicate. The predicate is of type data.

PREDICATE needs interface/2:

No further documentation available for this predicate. The predicate is of type data.

PREDICATE create interfaces/0:

No further documentation available for this predicate.

4.3 Documentation on multifiles

PREDICATE define flag/3:

 Usage: define_flag(Flag,FlagValues,Default)

− The following properties hold upon exit: Flag is an atom. (atm/1) Define the valid flag values (flag_values/1)

The predicate is multifile.

4.4 Documentation on imports

This module has the following direct dependencies: − Application modules:

datafacts_rt, aggregates, c_itf, file_buffer, stream_utils, system, engine_path,
pl2wam, lists, ctrlcclean, build_foreign_interface.

− Packages:

prelude, initial, condcomp, assertions, assertions/assertions_basic, define_
flag, datafacts.

5 Compiler frontend

Author(s): The Ciao Development Team. This module implements the Ciao compiler front-end. The main entry point for the front-end is the process_files_from/7 predicate, which pro-

cess (Ciao) source files and all their dependencies. Source file processing is incremental and dependecy extraction automatic from source declarations. For each processed file, a user-provided back-end (as higher-order arguments) is invoked.

Based on incremental file processing, this module implements source-to-bytecode compilation (using pl2wam and wamql as back-end) and basic support for dynamic module loading ( use_

mod/3).

5.1 Usage and interface

• Library usage:

:- use_module(library(compiler/c_itf)).

• Exports:

− Predicates:

compiler_version/1, compiler_name/1, opt_suffix/2, defines_module/2, def_
multifile/4, decl/2, exports/5, uses/2, adds/2, uses_file/2, imports_
pred/7, imports_all/2, includes/2, loads/2, clause_of/7, package/2,
imports_nocheck/4, defines_pred/3, meta_pred/4, dyn_decl/4, defines/5,
comp_defines/1, restore_defines/5, restore_imports/5, restore_multifile/4,
imports/5, meta_args/2, multifile/3, defines/3, discontiguous/3, add_module_
check/1, ensure_imported/4, define_ops/0, processed/2, process_files_from/7,
process_file/7, old_file_extension/2, cleanup_c_itf_data/0, cleanup_itf_
cache/0, base_name/2, file_data/3, compute_base_name/4, module_from_base/2,
exports_pred/3, module_error/0, module_error/1, expand_module_decl/5,
read_sentence/3, default_package/1, handle_exc/1, make_object1/2, make_po_
file/1, activate_translation/3, end_goal_trans/1, module_expansion/9, c_
itf_internal_pred/2, c_itf_internal_pred_decl/1, incore_mode_of/2, pred_
module/2, location/3, location/1, set_ciaopp_expansion/1, multifile/1,
module_loaded/4, static_module/1, static_base/1, use_mod/3, use_mod_user/2,
abolish_module/1, unload_mod/1, interpret_file/1, interpret_module/1,
interpret_srcdbg/1.

− Regular Types:

location_t/1.

− Multifiles:

define_flag/3, do_on_abolish/1.

5.2 Documentation on exports

PREDICATE compiler version/1:

No further documentation available for this predicate.

PREDICATE compiler name/1:

No further documentation available for this predicate.

PREDICATE opt suffix/2:

No further documentation available for this predicate.

PREDICATE defines module/2:

Usage: defines_module(Base,Module)

The source Base.pl defines module Module.

The predicate is of type data.

PREDICATE def multifile/4:

Usage: def_multifile(Base,F,A,DynType)

The source Base.pl defines multifile predicate F/A, defined as DynType (static, dynamic, data or concurrent).

The predicate is of type data.

PREDICATE decl/2:

Usage: decl(Base,Decl)

The source Base.pl contains the declaration Decl as an itf-exported new declaration.

The predicate is of type data.

PREDICATE exports/5:

Usage: exports(Base,F,A,DefType,Meta)

The source Base.pl exports predicate F/A, defined as DefType (static, implicit, dynamic, data or concurrent) and with meta predicate declaration Meta (which can be 0 if it has not).

PREDICATE uses/2:

Usage: uses(Base,File)

The source Base.pl imports from file File.

The predicate is of type data.

PREDICATE adds/2:

Usage: adds(Base,File)
The source Base.pl does ensure_loaded/1 of file File.

The predicate is of type data.

PREDICATE uses file/2:

Usage: uses_file(Base,File)

The source Base.pl uses file File explicitly through use_module/1 or use_module/2 or implicity.

PREDICATE imports pred/7:

Usage: imports_pred(Base,ImpFile,F,A,DefType,Meta,EndFile)

The source Base.pl imports from file ImpFile predicate F/A. Predicate is defined as DefType and has meta predicate declaration Meta (possibly 0). EndFile is ’.’ if the predicate resides in ImpFile, otherwise it is the file in which the predicate resides (due to reexportations). Stored in itf file for dependency check.

The predicate is of type data.

PREDICATE imports all/2:

Usage: imports_all(Base,ImpFile)

The source Base.pl imports all predicates of ImpFile.

The predicate is of type data.

PREDICATE includes/2:

Usage: includes(Base,File)

The source Base.pl includes file File. Stored in itf file for dependency check.

The predicate is of type data.

PREDICATE loads/2:

Usage: loads(Base,File)

The source Base.pl does load compilation module of file File. Stored in itf file for dependency check.

The predicate is of type data.

PREDICATE clause of/7:

Usage: clause_of(Base,Head,Body,VarNames,Source,Line0,Line1)

We have read from Base.pl (or included files) the clause Head :- Body, which has variable names VarNames, and is located in source Source (that changes if clauses are from an included file) between lines Line0 and Line1. In the special case that Head is a number, Body is the body of a declaration.

The predicate is of type data.

PREDICATE package/2:

The predicate is of type data.

PREDICATE imports nocheck/4:

Usage: imports_nocheck(Base,Module,F,A)

The source Base.pl imports predicate F/A from module Module using import/2.

The predicate is of type data.

PREDICATE defines pred/3:

The predicate is of type data.

PREDICATE meta pred/4:

The predicate is of type data.

PREDICATE dyn decl/4:

The predicate is of type data.

PREDICATE defines/5:

Usage: defines(Base,F,A,DefType,Meta)

The source Base.pl defines predicate F/A, defined as DefType (static, implicit, dynamic, data or concurrent) and with meta predicate declaration Meta (which can be 0 if it has not). Generated by calling comp_defines/1.

The predicate is of type data.

PREDICATE comp defines/1:

Usage: comp_defines(Base)

Can be used in the TreatP phase of the compilation process to generate facts of defines/5 for source Base.pl

PREDICATE restore defines/5:

Usage: restore_defines(Base,F,A,DefType,Meta)

Given the same arguments obtained from defines/5, it generates (assert in c itf DB) all necessary data to offer itf functionality.

PREDICATE restore imports/5:

Usage: restore_imports(M,IM,F,A,EndMod)

Given the same arguments obtained from imports/5, it restores c itf imports DB.

PREDICATE restore multifile/4:

Usage: restore_multifile(M,IM,F,Def)

Given the same arguments obtained from multifile/4, it restores c itf multifile DB.

PREDICATE imports/5:

Usage: imports(Mod,Mod2,F,A,EndMod)

Module Mod imports from module Mod2 predicate F/A, which resides in module EndMod. EndMod can be different from Mod2 due to reexportation.

The predicate is of type data.

PREDICATE meta args/2:

Usage: meta_args(Mod,Meta)

Module Mod has meta predicate declaration Meta.

The predicate is of type data.

PREDICATE multifile/3:

No further documentation available for this predicate.

PREDICATE defines/3:

Usage: defines(Mod,F,A)

Module Mod defines predicate F/A.

The predicate is of type data.

PREDICATE discontiguous/3:

The predicate is of type data.

PREDICATE add module check/1:

Usage: add_module_check(Pred)

Used by code expanders (loaded with load_compilation_module/1 declarations) to provide additional checks to be executed before the current file is compiled. The predicate is called with the base name of the file processed as the first argument, and all solutions will be found. A fact module_error/0 can be asserted if a condition which should stop the compilation is found.

Meta-predicate with arguments: add_module_check(pred(1)).

PREDICATE ensure imported/4:

No further documentation available for this predicate.

PREDICATE define ops/0:

No further documentation available for this predicate.

PREDICATE processed/2:

The predicate is of type data.

PREDICATE process files from/7:

No further documentation available for this predicate. Meta-predicate with arguments:

process_files_from(?,?,?,pred(1),pred(1),pred(1),pred(1)).

PREDICATE process file/7:

No further documentation available for this predicate. Meta-predicate with arguments:

process_file(?,?,?,pred(1),pred(1),pred(1),pred(1)).

PREDICATE old file extension/2:

No further documentation available for this predicate.

PREDICATE cleanup c itf data/0:

No further documentation available for this predicate.

PREDICATE cleanup itf cache/0:

No further documentation available for this predicate.

PREDICATE base name/2:

No further documentation available for this predicate.

PREDICATE file data/3:

No further documentation available for this predicate. The predicate is of type data.

PREDICATE compute base name/4:

No further documentation available for this predicate.

PREDICATE module from base/2:

No further documentation available for this predicate.

PREDICATE exports pred/3:

The predicate is of type data.

PREDICATE module error/0:

No further documentation available for this predicate. The predicate is of type data.

PREDICATE module error/1:

No further documentation available for this predicate. The predicate is of type data.

PREDICATE expand module decl/5:

No further documentation available for this predicate.

PREDICATE read sentence/3:

No further documentation available for this predicate.

PREDICATE default package/1:

No further documentation available for this predicate. The predicate is of type data.

PREDICATE handle exc/1:

No further documentation available for this predicate.

PREDICATE false/1:

No further documentation available for this predicate.

PREDICATE make object1/2:

No further documentation available for this predicate.

PREDICATE make po file/1:

No further documentation available for this predicate.

PREDICATE activate translation/3:

No further documentation available for this predicate.

PREDICATE end goal trans/1:

No further documentation available for this predicate.

PREDICATE module expansion/9:

No further documentation available for this predicate.

PREDICATE c itf internal pred/2:

No further documentation available for this predicate.

PREDICATE c itf internal pred decl/1:

No further documentation available for this predicate.

PREDICATE incore mode of/2:

No further documentation available for this predicate. The predicate is of type data.

PREDICATE pred module/2:

No further documentation available for this predicate. The predicate is of type data.

REGTYPE location t/1:

Usage: Identifies a source line range in a file.

     location_t(loc(File,L1,L2)) :-
         atm(File),
         int(L1),
         int(L2).

PREDICATE location/3:

Usage: − The following properties should hold upon exit:

Arg1 is an atom. (atm/1) Arg2 is an integer. (int/1) Arg3 is an integer. (int/1)

The predicate is of type data.

PREDICATE location/1:

Usage: location(Loc)

Unifies Loc with the locator of the current source line range. If this information can not be obtained, leaves Loc uninstantiated. − The following properties should hold upon exit:

Identifies a source line range in a file.

         location_t(loc(File,L1,L2)) :-
             atm(File),
             int(L1),
             int(L2).
                                                             (location_t/1)

PREDICATE set ciaopp expansion/1:

No further documentation available for this predicate.

PREDICATE multifile/1:

No further documentation available for this predicate.

PREDICATE module loaded/4:

No further documentation available for this predicate. The predicate is of type data.

PREDICATE static module/1:

No further documentation available for this predicate.

PREDICATE static base/1:

No further documentation available for this predicate.

PREDICATE use mod/3:

No further documentation available for this predicate.

PREDICATE use mod user/2:

No further documentation available for this predicate.

PREDICATE abolish module/1:

No further documentation available for this predicate.

PREDICATE unload mod/1:

No further documentation available for this predicate.

PREDICATE interpret file/1:

No further documentation available for this predicate. The predicate is of type data.

PREDICATE interpret module/1:

No further documentation available for this predicate. The predicate is of type data.

PREDICATE interpret srcdbg/1:

No further documentation available for this predicate. The predicate is of type data.

5.3 Documentation on multifiles

PREDICATE define flag/3:

 Usage: define_flag(Flag,FlagValues,Default)

− The following properties hold upon exit:

Flag is an atom. (atm/1) Define the valid flag values (flag_values/1)

The predicate is multifile.

PREDICATE do on abolish/1:

 Usage: do_on_abolish(G)

− The following properties should hold at call time:

G is a term which represents a goal, i.e., an atom or a structure. (cgoal/1) The predicate is multifile.

5.4 Documentation on imports

This module has the following direct dependencies: − Application modules:

datafacts_rt, aggregates, translation, pl2wam, srcdbg, global_module_options,
file_buffer, fastrw, complete_dict, terms_io, system, dynamic_rt, pathnames,
strings, stream_utils, ctrlcclean, terms, hiordlib, lists, read, operators, build_
foreign_interface, assrt_lib, rtchecks_tr, frontend_condcomp, exemaker.

− Packages:

prelude, initial, condcomp, assertions, assertions/assertions_basic, nortchecks,
hiord, define_flag, datafacts.

6 pl2wam (library)

6.1 Usage and interface

• Library usage:

:- use_module(library(compiler/pl2wam)).

• Exports:

− Predicates:

   reset_counter/1,  set_compiler_mode_
   out/2, set_compiler_mode/1, set_compiler_out/1, compile_clause/2, compile_
   clause_in_mode/3, proc_declaration/4, proc_declaration_in_mode/5, cleanup_
   compilation_data/0.

6.2 Documentation on exports

PREDICATE reset counter/1:

No further documentation available for this predicate.

PREDICATE set compiler mode out/2:

No further documentation available for this predicate.

PREDICATE set compiler mode/1:

No further documentation available for this predicate.

PREDICATE set compiler out/1:

No further documentation available for this predicate.

PREDICATE compile clause/2:

No further documentation available for this predicate.

PREDICATE compile clause in mode/3:

No further documentation available for this predicate.

PREDICATE proc declaration/4:

No further documentation available for this predicate.

PREDICATE proc declaration in mode/5:

No further documentation available for this predicate.

PREDICATE cleanup compilation data/0:

No further documentation available for this predicate.

6.3 Documentation on imports

This module has the following direct dependencies: − Application modules:

datafacts_rt, iso_misc, sort, dict, terms, write, lists, pl2wam_tables, c_itf.

− Packages:

prelude, initial, condcomp, assertions, assertions/assertions_basic, nortchecks,
dcg, datafacts.

7 Emulator description language

Author(s): Jose F. Morales. This package implements a reduced version of the emulator generator and emulator descrip-

tion language described in [ Mor10, MCH09].

7.1 Usage and interface

• Library usage:

:- use_package(compiler/emugen).

or

:- module(...,...,[compiler/emugen]).

• Implicit imports:

− Packages:

    prelude, initial, condcomp, assertions, assertions/assertions_basic.

22 The Ciao Internals Chapter 8: The Ciao engine 23

8 The Ciao engine

Eventually, this should contain a description of the engine, as a chapter of the Reference Manual.

NOTE: After Ciao v0.8 and before switching to SVN and Git, changes to the engine C files

where documented in the Manifest/GlobalChangeLog file.

24 The Ciao Internals

References

[MCH09] J.F. Morales, M. Carro, and M. V. Hermenegildo.

Description and Optimization of Abstract Machines in a Dialect of Prolog. Technical Report CLIP4/2009.0, Technical University of Madrid (UPM), School of Computer Science, UPM, October 2009.

[Mor10] J.F. Morales.

Advanced Compilation Techniques for Logic Programming. PhD thesis, Universidad Politécnica de Madrid (UPM), Facultad Informática UPM, 28660-Boadilla del Monte, Madrid-Spain, July 2010.

26 The Ciao Internals Library/Module Index 27

Library/Module Index

C

c_itf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 compiler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

E

emugen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 exemaker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

P

pl2wam . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

28 The Ciao Internals Predicate Index 29

Predicate Index

A

abolish_module/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 activate_translation/3 . . . . . . . . . . . . . . . . . . . . . . . 15 add_module_check/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 adds/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

B

base_name/2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

C

c_itf_internal_pred/2 . . . . . . . . . . . . . . . . . . . . . . . . 16

c_itf_internal_pred_decl/1 . . . . . . . . . . . . . . . . . . 16

clause_of/7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 cleanup_c_itf_data/0 . . . . . . . . . . . . . . . . . . . . . . . . . 14

cleanup_compilation_data/0 . . . . . . . . . . . . . . . . . . 20

cleanup_itf_cache/0 . . . . . . . . . . . . . . . . . . . . . . . . . . 14 comp_defines/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 compile_clause/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

compile_clause_in_mode/3. . . . . . . . . . . . . . . . . . . . . 19

compiler_name/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 compiler_version/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 compute_base_name/4 . . . . . . . . . . . . . . . . . . . . . . . . . . 14 create_interfaces/0 . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

D

decl/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 def_multifile/4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 default_package/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 define_flag/3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8, 18 define_ops/0. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 defines/3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 defines/5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 defines_module/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 defines_pred/3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 discontiguous/3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 do_on_abolish/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 dyn_decl/4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 dynamic_search_path/1 . . . . . . . . . . . . . . . . . . . . . . . . . 7

E

end_goal_trans/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 ensure_imported/4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 ensure_loaded/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 ensure_loaded/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 expand_module_decl/5 . . . . . . . . . . . . . . . . . . . . . . . . . 15 exports/5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 exports_pred/3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

F

false/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 file_data/3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 force_lazy/1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

H

handle_exc/1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

I

imports/5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 imports_all/2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 imports_nocheck/4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 imports_pred/7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 includes/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 incore_mode_of/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 interpret_file/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 interpret_module/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 interpret_srcdbg/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

L

loads/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 location/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 location/3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

M

make_exec/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 make_object1/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 make_po/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 make_po_file/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 make_wam/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 meta_args/2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 meta_pred/4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 mode_of_module/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 module_error/0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 module_error/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 module_expansion/9 . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 module_from_base/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 module_loaded/4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 module_of/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 multifile/1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 multifile/3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

N

needs_interface/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

O

old_file_extension/2 . . . . . . . . . . . . . . . . . . . . . . . . . 14 opt_suffix/2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

P

package/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 pred_module/2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 proc_declaration/4 . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

proc_declaration_in_mode/5 . . . . . . . . . . . . . . . . . . 19

process_file/7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 process_files_from/7 . . . . . . . . . . . . . . . . . . . . . . . . . 14 processed/2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

R

read_sentence/3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 reset_counter/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 restore_defines/5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 restore_imports/5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 restore_multifile/4 . . . . . . . . . . . . . . . . . . . . . . . . . . 12

S

set_ciaopp_expansion/1 . . . . . . . . . . . . . . . . . . . . . . . 16 set_compiler_mode/1 . . . . . . . . . . . . . . . . . . . . . . . . . . 19 set_compiler_mode_out/2 . . . . . . . . . . . . . . . . . . . . . . 19 set_compiler_out/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 set_debug_mode/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 set_debug_module/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

set_debug_module_source/1. . . . . . . . . . . . . . . . . . . . . 6

set_nodebug_mode/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 set_nodebug_module/1 . . . . . . . . . . . . . . . . . . . . . . . . . . 6 static_base/1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 static_module/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

U

undo_force_lazy/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 unload/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 unload_mod/1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 use_mod/3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 use_mod_user/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 use_module/1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 use_module/2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 use_module/3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 uses/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 uses_file/2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

Property Index 31

Property Index

(Index is nonexistent)

32 The Ciao Internals Regular Type Index 33

Regular Type Index

location_t/1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

34 The Ciao Internals Declaration Index 35

Declaration Index

(Index is nonexistent)

36 The Ciao Internals Concept Index 37

Concept Index

(Index is nonexistent)

38 The Ciao Internals Author Index 39

Author Index

J

Jose F. Morales . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

T

The Ciao Development Team . . . . . . . . . . . . . . . . . . 5, 9

40 The Ciao Internals Global Index 41

Global Index

This is a global index containing pointers to places where concepts, predicates, modes, properties, types, applications, authors, etc., are referred to in the text of the document.

A

abolish_module/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 17 activate_translation/3 . . . . . . . . . . . . . . . . . . . . 9, 15 add_module_check/1 . . . . . . . . . . . . . . . . . . . . . . . . . 9, 13 adds/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 10 aggregates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8, 18 assertions . . . . . . . . . . . . . . . . . . . . . . . . 6, 8, 18, 20, 21

assertions/assertions_basic . . . . . . 6, 8, 18, 20, 21

assrt_lib . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

B

base_name/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 14

build_foreign_interface . . . . . . . . . . . . . . . . . . . 8, 18

C

c_itf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6, 8, 9, 20 c_itf_internal_pred/2. . . . . . . . . . . . . . . . . . . . . . 9, 16

c_itf_internal_pred_decl/1 . . . . . . . . . . . . . . . . 9, 16

clause_of/7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 11 cleanup_c_itf_data/0. . . . . . . . . . . . . . . . . . . . . . . 9, 14

cleanup_compilation_data/0 . . . . . . . . . . . . . . . 19, 20

cleanup_itf_cache/0. . . . . . . . . . . . . . . . . . . . . . . . 9, 14 comp_defines/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 12 compile_clause/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

compile_clause_in_mode/3. . . . . . . . . . . . . . . . . . . . . 19

compiler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 compiler_name/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 compiler_version/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 complete_dict. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 compute_base_name/4. . . . . . . . . . . . . . . . . . . . . . . . 9, 14 condcomp . . . . . . . . . . . . . . . . . . . . . . . . . . 6, 8, 18, 20, 21 create_interfaces/0 . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 ctrlcclean . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8, 18

D

datafacts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6, 8, 18, 20 datafacts_rt . . . . . . . . . . . . . . . . . . . . . . . . . 6, 8, 18, 20 dcg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 decl/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 10 def_multifile/4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 10 default_package/1 . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 15 define_flag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8, 18 define_flag/3 . . . . . . . . . . . . . . . . . . . . . . . . . 7, 8, 9, 18 define_ops/0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 13 defines/3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 13 defines/5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 12 defines_module/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 10 defines_pred/3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 12 dict . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 discontiguous/3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 13 do_on_abolish/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 18 dyn_decl/4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 12 dynamic_rt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 dynamic_search_path/1 . . . . . . . . . . . . . . . . . . . . . . . . . 7

E

emugen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 end_goal_trans/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 15 engine_path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 ensure_imported/4 . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 13 ensure_loaded/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5, 10 ensure_loaded/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 exemaker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6, 7, 18 expand_module_decl/5. . . . . . . . . . . . . . . . . . . . . . . 9, 15 exports/5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 10 exports_pred/3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 14

F

false/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 fastrw . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 file_buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8, 18 file_data/3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 14 force_lazy/1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 frontend_condcomp . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

G

global_module_options . . . . . . . . . . . . . . . . . . . . . . . . 18

H

handle_exc/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 15 hiord . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 hiordlib . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

I

import/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 imports/5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 12, 13 imports_all/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 11 imports_nocheck/4 . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 12 imports_pred/7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 11 includes/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 11 incore_mode_of/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 16 initial . . . . . . . . . . . . . . . . . . . . . . . . . . . 6, 8, 18, 20, 21 interpret_file/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 17 interpret_module/1 . . . . . . . . . . . . . . . . . . . . . . . . . 9, 17 interpret_srcdbg/1 . . . . . . . . . . . . . . . . . . . . . . . . . 9, 17 iso_misc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

J

jfran-phd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Jose F. Morales . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

L

lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8, 18, 20

load_compilation_module/1. . . . . . . . . . . . . . . . . . . . 13

loads/2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 11 location/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 16 location/3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 16 location_t/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 16

M

make_exec/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 make_object1/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 15 make_po/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 make_po_file/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 15 make_wam/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 meta_args/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 13 meta_pred/4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 12 mode_of_module/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5, 6 module_error/0. . . . . . . . . . . . . . . . . . . . . . . . . . 9, 13, 14 module_error/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 15 module_expansion/9 . . . . . . . . . . . . . . . . . . . . . . . . . 9, 15 module_from_base/2 . . . . . . . . . . . . . . . . . . . . . . . . . 9, 14 module_loaded/4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 17 module_of/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5, 6 morales09:improlog-tr . . . . . . . . . . . . . . . . . . . . . . . . 21 multifile/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 17 multifile/3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 13 multifile/4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

N

needs_interface/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 nortchecks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18, 20

O

old_file_extension/2. . . . . . . . . . . . . . . . . . . . . . . 9, 14 operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 opt_suffix/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 10

P

package/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 11 pathnames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 pl2wam . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8, 9, 18, 19 pl2wam_tables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 pred_module/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 16 prelude . . . . . . . . . . . . . . . . . . . . . . . . . . . 6, 8, 18, 20, 21 proc_declaration/4 . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

                                                  proc_declaration_in_mode/5 . . . . . . . . . . . . . . . . . . 19

process_file/7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 14 process_files_from/7. . . . . . . . . . . . . . . . . . . . . . . 9, 14 processed/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 13

R

read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 read_sentence/3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 15 reset_counter/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 restore_defines/5 . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 12 restore_imports/5 . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 12 restore_multifile/4. . . . . . . . . . . . . . . . . . . . . . . . 9, 12 rtchecks_tr. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

S

set_ciaopp_expansion/1 . . . . . . . . . . . . . . . . . . . . 9, 16 set_compiler_mode/1 . . . . . . . . . . . . . . . . . . . . . . . . . . 19 set_compiler_mode_out/2 . . . . . . . . . . . . . . . . . . . . . . 19 set_compiler_out/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 set_debug_mode/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5, 6 set_debug_module/1 . . . . . . . . . . . . . . . . . . . . . . . . . . 5, 6

                                                  set_debug_module_source/1 . . . . . . . . . . . . . . . . . . 5, 6

set_nodebug_mode/1 . . . . . . . . . . . . . . . . . . . . . . . . . . 5, 6 set_nodebug_module/1. . . . . . . . . . . . . . . . . . . . . . . . 5, 6

Global Index 43

sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 srcdbg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 static_base/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 17 static_module/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 17 stream_utils . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8, 18 strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6, 8, 18

T

terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18, 20 terms_io . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

The Ciao Development Team . . . . . . . . . . . . . . . . . . . 5, 9

toplevel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 translation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

U

undo_force_lazy/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 unload/1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5, 6 unload_mod/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 17 use_mod/3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 17 use_mod_user/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 17 use_module/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5, 11 use_module/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5, 11 use_module/3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 uses/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 10 uses_file/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9, 10

W

wamql . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

44 The Ciao Internals