Analyze driver (monolithic)

This module provides the main entry points for performing analysis and assertion checking. It requires loading the program before (e.g., with frontend_driver).

Adding new analyses

To include a new analysis, add a clause for analyze/2 (and for analysis/1).

As an alternative, you can add clauses for the multifile predicates analysis/4 and analysis/1, directly in your own sources.

See the file examples/Extending/myanalyzer.pl in the source directory for an example of this.


Usage and interface

Documentation on exports

No further documentation available for this predicate.

No further documentation available for this predicate.

PREDICATEanalyze/1

Usage:analyze(Analysis)

Analyzes the current module with Analysis. If the intermod flag is not off, this predicate may call module/1.

  • The following properties should hold at call time:
    (nonvar/1)Analysis is currently a term which is not a free variable.
    (analysis/1)Analysis is a valid analysis identifier.
  • The following properties should hold globally:
    (not_fails/1)All the calls of the form analyze(Analysis) do not fail.
    (no_choicepoints/1)A call to analyze(Analysis) does not leave new choicepoints.

PREDICATEanalyze/2

Usage:analyze(Analysis,Info)

Same as analyze(Analysis) but in Info returns statistics (time and memory).

  • The following properties should hold at call time:
    (nonvar/1)Analysis is currently a term which is not a free variable.
    (var/1)Info is a free variable.

PREDICATEanalyze1/2
No further documentation available for this predicate.

A regular type, defined as follows:
ctcheck_sum(ok).
ctcheck_sum(warning).
ctcheck_sum(error).

Usage:acheck_summary(S)

Checks assertions w.r.t. analysis information. Upon success S is bound to: ok (the compile-time checking process has generated no error nor warning), warning (compile-time checking has not generated any error, but there has been at least one warning) or error (at least one error has been produced).

Usage:acheck_summary(Info,S)

Same as acheck_summary(S) but in Info returns assertion checking statistics.

  • The following properties should hold at call time:
    (var/1)Info is a free variable.
    (var/1)S is a free variable.

No further documentation available for this predicate.

PREDICATEacheck/0

Usage:

Checks assertions w.r.t. analysis information, obtains from domain/1 which analyses were run.

    PREDICATEacheck/1

    Usage:acheck(AbsInt)

    Checks assertions using the analysis information of AbsInt. The analysis must be present in CiaoPP (via analysis or restore dump).

      PREDICATEacheck/2

      Usage 1:acheck(AbsInt,ModList)

      • The following properties should hold at call time:
        (nonvar/1)AbsInt is currently a term which is not a free variable.
        (nonvar/1)ModList is currently a term which is not a free variable.
        (list/2)AbsInt is a list of atms.
        (list/2)ModList is a list of atms.

      Usage 2:acheck(AbsInt,MaybeModList)

      If MaybeModList is the atom all, all modules in the current punit are considered. If it is a list of module names, only the assertions or predicates in those modules are checked.

      • The following properties should hold at call time:
        (nonvar/1)AbsInt is currently a term which is not a free variable.
        (nonvar/1)MaybeModList is currently a term which is not a free variable.
        (list/2)AbsInt is a list of atms.
        (atm/1)MaybeModList is an atom.

      Usage:

      Cleans all analysis info but keep the program as wether it would be just read.

        No further documentation available for this predicate.

        No further documentation available for this predicate.

        PREDICATEtrace_fixp/1

        Usage 1:trace_fixp(X)

        Mode for setting the current flag to a single value.

        Usage 2:trace_fixp(X)

        Mode for setting the current flag to several values.

        • The following properties should hold at call time:
          (list/2)X is a list of trace_options.
        • The following properties should hold globally:
          (not_further_inst/2)X is not further instantiated.

        Documentation on multifiles

        Specifies an analysis that can be lazy loaded The predicate is multifile.

        Given an analysis, returns the module that contains the implementation (or entry point) of a lazy loadable analysis. Such module must implement the analysis/4 multifile clause. The predicate is multifile.

        Helps to determine if an analysis was already loaded. Must be defined in the same module specified by analysis_module/2. The predicate is multifile.

        PREDICATEanalysis/4

        Usage:analysis(Analysis,Clauses,Dictionaries,Info)

        Performs Analysis on program Clauses.

        • The following properties should hold at call time:
          (analysis/1)Analysis is a valid analysis identifier.
        The predicate is multifile.

        PROPERTYanalysis/1

        Usage:analysis(Analysis)

        Analysis is a valid analysis identifier.

          The predicate is multifile.

          PREDICATEaidomain/1
          See the chapter on domains. The predicate is multifile.