Crossed-references of a program

The CIAO System Documentation Series Draft printed on: 29 December 1999

Francisco Bueno

Table of Contents

1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

2 Crossed-references between modules . . . . . . . . . . . 3

2.1 Usage and interface (xmrefs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2.2 Documentation on exports (xmrefs) . . . . . . . . . . . . . . . . . . . . . . . . . . 3

xmrefs/0 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 xmlinks/0 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 quit/0 (pred). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 set files/1 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 set flag/1 (pred). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2.3 Documentation on internals (xmrefs) . . . . . . . . . . . . . . . . . . . . . . . . . 4

sourcename/1 (pred). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2.4 Known bugs and planned improvements (xmrefs) . . . . . . . . . . . . . . 4 2.5 Version/Change Log (xmrefs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

3 Graphs of crossed-references between modules. . 5

3.1 Usage and interface (mrefs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 3.2 Documentation on exports (mrefs) . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

mrefs lgraph/1 (pred). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 mrefs ugraph/1 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 set files/1 (udreexp) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 set flag/1 (udreexp) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

3.3 Known bugs and planned improvements (mrefs) . . . . . . . . . . . . . . . 6 3.4 Version/Change Log (mrefs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

4 Crossed-references between files . . . . . . . . . . . . . . . 7

4.1 Usage and interface (xfrefs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 4.2 Documentation on exports (xfrefs) . . . . . . . . . . . . . . . . . . . . . . . . . . 7

xfrefs/1 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 xflinks/1 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 quit/0 (pred). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 set files/1 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 set flag/1 (pred). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

4.3 Documentation on internals (xfrefs) . . . . . . . . . . . . . . . . . . . . . . . . . 8

sourcename/1 (pred). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

4.4 Known bugs and planned improvements (xfrefs) . . . . . . . . . . . . . . 8

5 Lists of crossed-references between files . . . . . . . . 9

5.1 Usage and interface (pxrefs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 5.2 Documentation on exports (pxrefs) . . . . . . . . . . . . . . . . . . . . . . . . . 10

pxrefs/1 (pred). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 set flag/1 (udreexp) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 set files/1 (udreexp) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

6 Graphs of crossed-references between files . . . . . 11

6.1 Usage and interface (xrefs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 6.2 Documentation on exports (xrefs) . . . . . . . . . . . . . . . . . . . . . . . . . . 11

xrefs lgraph/2 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 xrefs ugraph/2 (pred). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 set flag/1 (udreexp) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 xref/1 (udreexp) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 set files/1 (udreexp) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

6.3 Known bugs and planned improvements (xrefs) . . . . . . . . . . . . . . 12

7 xrefsbuild (library) . . . . . . . . . . . . . . . . . . . . . . . . . . 13

7.1 Usage and interface (xrefsbuild) . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 7.2 Documentation on exports (xrefsbuild) . . . . . . . . . . . . . . . . . . . . . 13

xref/1 (regtype) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 xrefs/2 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 set flag/1 (pred). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

8 Finding crossed-references between modules/files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

8.1 Usage and interface (xrefsread) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 8.2 Documentation on exports (xrefsread) . . . . . . . . . . . . . . . . . . . . . . 15

xrefs modules/2 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 xrefs files/1 (pred). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 set files/1 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 set flag/1 (pred). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 meta call/3 (pred). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

8.3 Documentation on internals (xrefsread) . . . . . . . . . . . . . . . . . . . . . 16

sourcename/1 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

8.4 Known bugs and planned improvements (xrefsread) . . . . . . . . . 16

9 xrefs2graph (library). . . . . . . . . . . . . . . . . . . . . . . . . 17

9.1 Usage and interface (xrefs2graph) . . . . . . . . . . . . . . . . . . . . . . . . . . 17 9.2 Documentation on exports (xrefs2graph). . . . . . . . . . . . . . . . . . . . 17

xrefs2graph/2 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 xrefsnolabels/2 (pred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

1 Introduction

The xrefs crossed-references Ciao library includes several modules which allow displaying crossed-references of the code in a program. Crossed-references identify modules which import code from other modules, or files (be them modules or not) which use code in other files. Crossedreferences can be obtained as a term representing a graph, displayed graphically (using daVinci, a graph displayer developed by U. of Bremen, Germany), or printed as a list.

The libraries involved are as follows:

• etc(xmrefs) displays a graph of crossed-references between modules using daVinci,

• etc(xfrefs) displays a graph of crossed-references between files using daVinci,

• library(xrefs) obtains a graph of crossed-references between files,

• library('xrefs/mrefs') obtains a graph of crossed-references between modules,

• library('xrefs/pxrefs') prints a list of crossed-references between files.

The first two are intended to be used by loading in ciaosh. The other three are intended to be used as modules within an application.

The following is an example graph of the library modules involved in the crossed-references application. It has been obtained with:

[ciao/etc]> ciaosh
Ciao-Prolog 1.5 #24: Tue Dec 28 14:12:11 CET 1999
?- use_module(xmrefs).
yes
?- set_flag(X).
X = 3 ?
yes
?- set_files([xfrefs, xmrefs,
              library(xrefs),
              library('xrefs/mrefs'),
              library('xrefs/pxrefs'),
              library('xrefs/xrefs2graph'),
              library('xrefs/xrefsbuild'),
              library('xrefs/xrefsread')
     ]).
yes
?- xmrefs.

so that it is displayed by daVinci as:

The following is an example graph of the same module files, where crossed-references have

been obtained with xfrefs:xfrefs(whodefs) instead of xmrefs:xmrefs:

For more information refer to the xrefs documentation (xrefs_doc.dvi) in the source library of the Ciao distribution.

2 Crossed-references between modules

Author(s): Francisco Bueno. Version: 1.5#31 (1999/12/29, 15:44:18 CET) Version of last change: 1.5#23 (1999/12/21, 18:42:19 MET) This module allows displaying a graph of crossed-references between modules. The graph

is obtained using library('xrefs/mrefs') and is displayed using daVinci (a windows-based graphics graph displayer developed by U. of Bremen, Germany), via library(davinci).

See the documentation of these libraries for details.

2.1 Usage and interface (xmrefs)

• Library usage:

  :- use_module(library(xmrefs)).

• Exports:

− Predicates:

      xmrefs/0, xmlinks/0, quit/0.

• Other modules used:

− System library modules:

      davinci, xrefs/mrefs.

− Internal (engine) modules:

      arithmetic, atomic_basic, attributes, basic_props, basiccontrol, concurrency,
      data_facts, exceptions, io_aux, io_basic, prolog_flags, streams_basic,
      system_info, term_basic, term_compare, term_typing.

2.2 Documentation on exports (xmrefs)

PREDICATE xmrefs/0:

Usage:

− Description: Displays a graph of crossed-references for the current files.

PREDICATE xmlinks/0:

Usage:

− Description: Like xmrefs/0 but edges have no labels.

PREDICATE quit/0:

Quits daVinci.

PREDICATE set files/1:

Usage 1: set_files(List_of_files)

− Description: Sets the current files to List_of_files. − The following properties should hold at call time:

   List_of_files is a list of sourcenames.  (list/2)
Usage 2: set_files(List_of_files)

− Description: Binds List_of_files to the current files. − The following properties should hold at call time:

   List_of_files is a free variable.  (var/1)

PREDICATE set flag/1:

Usage 1: set_flag(Flag)

− Description: Sets the current flag to Flag. − The following properties should hold at call time:

Flag is currently instantiated to a number. (number/1)

Usage 2: set_flag(Flag)

− Description: Binds Flag to the current flag. − The following properties should hold at call time:

Flag is a free variable. (var/1)

2.3 Documentation on internals (xmrefs)

PREDICATE sourcename/1:

See engine(streams_basic).

2.4 Known bugs and planned improvements (xmrefs)

• quit/0 does nothing. daVinci has to be exited from its own window.

2.5 Version/Change Log (xmrefs)

Version 1.5#23 (1999/12/21, 18:42:19 MET)

Added etc/xmrefs.pl and related libraries. (Francisco Bueno Carrillo)

3 Graphs of crossed-references between modules

Author(s): Francisco Bueno.

Version: 1.5#31 (1999/12/29, 15:44:18 CET)

Version of last change: 0.5#5 (1998/4/2)

This library provides support for obtaining a graph of crossed-references between modules. The graph has directed edges which go in the direction of the imports between the modules: edge source imports predicates (in edge label) from edge sink.

The library works as follows. The files (modules) which are taken into account to construct the graph are set by the predicate set_files/1. The kind of links between these files that will be included as graph edges are set by the predicate set_flag/1. Then, predicates mrefs_lgraph/1 and mrefs_ugraph/1 construct the labeled (lgraph) or unlabeled (ugraph) graph.

3.1 Usage and interface (mrefs)

• Library usage:

    :- use_module(library(mrefs)).

• Exports:

− Predicates:

        mrefs_lgraph/1, mrefs_ugraph/1.

• Other modules used:

− Application modules:

        library(graphs),  library(graphs/ugraphs),  library(graphs/lgraphs),
        library(xrefs/xrefsread), library(xrefs/xrefs2graph).

− Internal (engine) modules:

        arithmetic, atomic_basic, attributes, basic_props, basiccontrol, concurrency,
        data_facts, exceptions, io_aux, io_basic, prolog_flags, streams_basic,
        system_info, term_basic, term_compare, term_typing.

3.2 Documentation on exports (mrefs)

PREDICATE mrefs lgraph/1:

     Usage: mrefs_lgraph(Graph)

− Description: Binds Graph to a graph of crossed-references for the current files.

− The following properties should hold at call time:

Graph is a free variable. (var/1) − The following properties should hold upon exit:

Graph is a labeled graph of gnd terms. (lgraph/2)

PREDICATE mrefs ugraph/1:

Usage:

− Description: Like mrefs_lgraph/1 but edges have no labels.

− The following properties should hold at call time:

Arg1 is a free variable. (var/1) − The following properties should hold upon exit:

Arg1 is an ugraph. (ugraph/1)

(UNDOC REEXPORT) set files/1:

Imported from xrefsread (see the corresponding documentation for details).

(UNDOC REEXPORT) set flag/1:

Imported from xrefsread (see the corresponding documentation for details).

3.3 Known bugs and planned improvements (mrefs)

• The modules multifile and user are not taken into account.

3.4 Version/Change Log (mrefs)

Version 0.5#5 (1998/4/2)

Documented all exported predicates. (Francisco Bueno Carrillo)

Version 0.4#5 (1998/2/24)

Synchronized file versions with global CIAO version. (Manuel Hermenegildo)

4 Crossed-references between files

Author(s): Francisco Bueno. Version: 1.5#31 (1999/12/29, 15:44:18 CET) This module allows displaying a graph of crossed-references between source code in different

files. The graph is obtained using library(xrefs) and is displayed using daVinci (a windowsbased graphics graph displayer developed by U. of Bremen, Germany), via library(davinci).

See the documentation of these libraries for details.

4.1 Usage and interface (xfrefs)

• Library usage:

:- use_module(library(xfrefs)).

• Exports:

− Predicates:

xfrefs/1, xflinks/1, quit/0.

• Other modules used:

− System library modules:

davinci, xrefs/xrefs.

− Internal (engine) modules:

arithmetic, atomic_basic, attributes, basic_props, basiccontrol, concurrency,
data_facts, exceptions, io_aux, io_basic, prolog_flags, streams_basic,
system_info, term_basic, term_compare, term_typing.

4.2 Documentation on exports (xfrefs)

PREDICATE xfrefs/1:

Usage: xfrefs(Xrefs)

− Description: Displays a graph of crossed-references of type Xrefs for the current files. − The following properties should hold at call time:

 Xrefs is either whodefs or whouses.  (xref/1)

PREDICATE xflinks/1:

Usage: xflinks(Xrefs)

− Description: Like xfrefs/1 but edges have no labels.

PREDICATE quit/0:

Quits daVinci.

PREDICATE set files/1:

Usage 1: set_files(List_of_files)

− Description: Sets the current files to List_of_files. − The following properties should hold at call time:

   List_of_files is a list of sourcenames.  (list/2)
Usage 2: set_files(List_of_files)

− Description: Binds List_of_files to the current files. − The following properties should hold at call time:

   List_of_files is a free variable.  (var/1)

PREDICATE set flag/1:

Usage 1: set_flag(Flag)

− Description: Sets the current flag to Flag. − The following properties should hold at call time:

Flag is currently instantiated to a number. (number/1)

Usage 2: set_flag(Flag)

− Description: Binds Flag to the current flag. − The following properties should hold at call time:

Flag is a free variable. (var/1)

4.3 Documentation on internals (xfrefs)

PREDICATE sourcename/1:

See engine(streams_basic).

4.4 Known bugs and planned improvements (xfrefs)

• quit/0 does nothing. daVinci has to be exited from its own window.

5 Lists of crossed-references between files

Author(s): F. Bueno.

Version: 1.5#31 (1999/12/29, 15:44:18 CET)

This library provides support for identifying crossed-references between the source code in different files, i.e., calls from clauses in one file which match the name of a predicate defined in another file. This can be helpful in identifying which file(s) define(s) a predicate called in other files, or the other way around, which files call a predicate defined in other file(s).

Crossed-references can be of two types. For type whouses a list of xrefs is output that shows, for each file F, the names of the predicates defined in F, and for each of these, the names of all other files which call the predicate. I.e.:

             file
                predicate-defined-in-this-file
                    file-using-this-predicate ...
                ...
             ...

For type whodefs, for each file F and each predicate called in F, the files that define the predicate are listed. I.e.:

             file
                predicate-used-in-this-file
                    file-defining-this-predicate ...
                ...
             ...

The lists of xrefs are output to files xrefs.whodefs and xrefs.whouses, respectively.

The files which are taken into account and the classes of predicates which are considered can be selected with flags. See below.

5.1 Usage and interface (pxrefs)

• Library usage:

    :- use_module(library(pxrefs)).

• Exports:

− Predicates:

        pxrefs/1.

• Other modules used:

− Application modules:

        library(xrefs/xrefsbuild), library(xrefs/xrefsread).

− System library modules:

        streams, terms, write.

− Internal (engine) modules:

        arithmetic, atomic_basic, attributes, basic_props, basiccontrol, concurrency,
        data_facts, exceptions, io_aux, io_basic, prolog_flags, streams_basic,
        system_info, term_basic, term_compare, term_typing.

5.2 Documentation on exports (pxrefs)

PREDICATE pxrefs/1:

Usage: pxrefs(Xrefs)

− Description: Outputs a list of crossed-references of type Xrefs for the current files. − The following properties should hold at call time:

    Xrefs is either whodefs or whouses.  (xref/1)

(UNDOC REEXPORT) set flag/1:

Imported from xrefsbuild (see the corresponding documentation for details).

(UNDOC REEXPORT) set files/1:

Imported from xrefsread (see the corresponding documentation for details).

6 Graphs of crossed-references between files

Author(s): Francisco Bueno.

Version: 1.5#31 (1999/12/29, 15:44:18 CET)

This library provides support for obtaining a graph of crossed-references between the source code in different files. The graph identifies calls from clauses in one file which match the name of a predicate defined in another file.

The graph has directed edges between the file names, the meaning of which depends on the selected type of crossed-references. For crossed-references of type whouses edges go in the direction of the "use" relation of the code, i.e., edge source uses (calls) predicates (in edge label) defined in edge sink. For crossed-references of type whodefs edges go in the other direction, i.e., edge source defines predicates (in edge label) which are used (called) in edge sink. A source sink 0 indicates that the edge has no real sink.

The library works as follows. The files which are taken into account to construct the graph are set by the predicate set_files/1. The kind of links between these files that will be included as graph edges are set by the predicate set_flag/1. Then, predicates xrefs_lgraph/2 and xrefs_ugraph/2 construct the labeled (lgraph) or unlabeled (ugraph) graph.

6.1 Usage and interface (xrefs)

• Library usage:

    :- use_module(library(xrefs)).

• Exports:

− Predicates:

        xrefs_lgraph/2, xrefs_ugraph/2.

• Other modules used:

− Application modules:

        library(graphs),  library(graphs/ugraphs),  library(graphs/lgraphs),
        library(xrefs/xrefsbuild),  library(xrefs/xrefsread),
        library(xrefs/xrefs2graph).

− System library modules:

        sort, terms.

− Internal (engine) modules:

        arithmetic, atomic_basic, attributes, basic_props, basiccontrol, concurrency,
        data_facts, exceptions, io_aux, io_basic, prolog_flags, streams_basic,
        system_info, term_basic, term_compare, term_typing.

6.2 Documentation on exports (xrefs)

PREDICATE xrefs lgraph/2:

     Usage: xrefs_lgraph(Xrefs,Graph)

− Description: Binds Graph to a graph of crossed-references of type Xrefs for the

current files. − The following properties should hold at call time:

         Xrefs is either whodefs or whouses.  (xref/1)

Graph is a free variable. (var/1) − The following properties should hold upon exit:

Xrefs is either whodefs or whouses.  (xref/1)

Graph is a labeled graph of gnd terms. (lgraph/2)

PREDICATE xrefs ugraph/2:

Usage: xrefs_ugraph(Xrefs,Graph)

− Description: Like xrefs_lgraph/2 but edges have no labels. − The following properties should hold at call time:

Xrefs is either whodefs or whouses.  (xref/1)

Graph is a free variable. (var/1) − The following properties should hold upon exit:

Xrefs is either whodefs or whouses.  (xref/1)
Graph is an ugraph.  (ugraph/1)

(UNDOC REEXPORT) set flag/1:

Imported from xrefsbuild (see the corresponding documentation for details).

(UNDOC REEXPORT) xref/1:

Imported from xrefsbuild (see the corresponding documentation for details).

(UNDOC REEXPORT) set files/1:

Imported from xrefsread (see the corresponding documentation for details).

6.3 Known bugs and planned improvements (xrefs)

• The bodies of initialization/on abort directives are not taken into account.

7 xrefsbuild (library)

Version: 1.5#31 (1999/12/29, 15:44:18 CET)

7.1 Usage and interface (xrefsbuild)

• Library usage:

:- use_module(library(xrefsbuild)).

• Exports:

− Predicates:

xrefs/2, set_flag/1.

− Regular Types:

xref/1.

• Other modules used:

− Application modules:

library(xrefs/xrefsread).

− System library modules:

sort, terms.

− Internal (engine) modules:

arithmetic, atomic_basic, attributes, basic_props, basiccontrol, concurrency,
data_facts, exceptions, io_aux, io_basic, prolog_flags, streams_basic,
system_info, term_basic, term_compare, term_typing.

7.2 Documentation on exports (xrefsbuild)

REGTYPE xref/1:

Usage: xref(Xref)

− Description: Xref is either whodefs or whouses.

PREDICATE xrefs/2:

Usage: xrefs(Xrefs,Graph)

− Description: Obtains a graph of xrefs of type Xrefs based on the crossed-checking of

the source code of the current files read. − The following properties should hold at call time:

 Xrefs is either whodefs or whouses.  (xref/1)

Graph is a free variable. (var/1)

PREDICATE set flag/1:

set_flag(Flag)

Flag encodes in binary the references wanted from a file to: 1st bit- other files, 2nd bitsame file, 3rd bit- no file. Default flag is: only other files.

Usage 1: set_flag(Flag)

− Description: Sets the current flag to Flag. − The following properties should hold at call time:

Flag is currently instantiated to a number. (number/1)

Usage 2: set_flag(Flag)

− Description: Binds Flag to the current flag. − The following properties should hold at call time:

Flag is a free variable. (var/1)

8 Finding crossed-references between modules/files

Author(s): Francisco Bueno. Version: 1.5#31 (1999/12/29, 15:44:18 CET) This library provides support for obtaining crossed-references between modules (based on

the module interface) or files (based on the source code, disregarding the module interface).

8.1 Usage and interface (xrefsread)

• Library usage:

:- use_module(library(xrefsread)).

• Exports:

− Predicates:

xrefs_modules/2, xrefs_files/1, set_files/1, set_flag/1, meta_call/3.

• Other modules used:

− System library modules:

aggregates, compiler/c_itf, ctrlcclean, errhandle, terms.

− Internal (engine) modules:

arithmetic, atomic_basic, attributes, basic_props, basiccontrol, concurrency,
data_facts, exceptions, io_aux, io_basic, prolog_flags, streams_basic,
system_info, term_basic, term_compare, term_typing.

8.2 Documentation on exports (xrefsread)

PREDICATE xrefs modules/2:

Usage: xrefs_modules(Lbl,Graph)

− Description: Obtains a graph of xrefs with (labels) or without (nolabels) labels,

based on the module interface of the current files read. − The following properties should hold at call time:

 Lbl is either labels or nolabels.  (lblflag/1)

Graph is a free variable. (var/1)

PREDICATE xrefs files/1:

Usage: xrefs_files(CList)

− Description: Returns a list of clauses of the files read. − The following properties should hold at call time:

CList is a free variable. (var/1)

PREDICATE set files/1:

Usage 1: set_files(List_of_files)

− Description: Sets the current files to List_of_files.

− The following properties should hold at call time:

    List_of_files is a list of sourcenames.  (list/2)
Usage 2: set_files(List_of_files)

− Description: Binds List_of_files to the current files. − The following properties should hold at call time:

    List_of_files is a free variable.  (var/1)

PREDICATE set flag/1:

set_flag(Flag)

Flag encodes in binary the references wanted: 1st bit- from current files, 3rd bit- from others, 2nd bit- to current files, 4th bit- to others. Default flag is 3: from current files to current files.

Usage 1: set_flag(Flag)

− Description: Sets the current flag to Flag. − The following properties should hold at call time:

Flag is currently instantiated to a number. (number/1)

Usage 2: set_flag(Flag)

− Description: Binds Flag to the current flag. − The following properties should hold at call time:

Flag is a free variable. (var/1)

PREDICATE meta call/3:

meta_call(Atom,File,Call)

Atom is a meta-predicate in file File and meta-calls Call. If the meta-call cannot be identified as a well-formed body Call is bound to 0.

8.3 Documentation on internals (xrefsread)

PREDICATE sourcename/1:

See engine(streams_basic).

8.4 Known bugs and planned improvements (xrefsread)

• For the time being, meta_call/3 does nothing.

9 xrefs2graph (library)

9.1 Usage and interface (xrefs2graph)

• Library usage:

  :- use_module(library(xrefs2graph)).

• Exports:

− Predicates:

      xrefs2graph/2, xrefsnolabels/2.

• Other modules used:

− System library modules:

      sort.

− Internal (engine) modules:

      basiccontrol, term_basic.

9.2 Documentation on exports (xrefs2graph)

PREDICATE xrefs2graph/2:

Converts a graph of xrefs to a dlgraph in the style of library(graphs).

PREDICATE xrefsnolabels/2:

Strips out the labels in a graph of xrefs.

18 Crossed-references of a program