p_abs (library)

Documentation on exports

Usage:

Cleans up internal data predicates.

    Usage:

    Cleans up all the data predicates.

      Usage:gen_registry_info(Verb,Callers,Imported)

      Obtains from analysis internal structures the information on exported predicates regarding the current module and related modules. Returns in Callers and Imported the list of basenames of related modules whose registry information has been updated.

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

      Usage:gen_registry_info(Verb,Callers,Imported,Info)

      As gen_registry_info/3, but also returns Info.

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

      Usage:save_registry_info(Verb,Info)

      Writes on disk the registry information of the modules loaded into Ciaopp or related to modules loaded into Ciaopp. This information is updated by gen_registry_info/3. This predicate must be called after performing intermodular preprocessing (analysis, specialization...), even if save_registry_info/3 has been used.

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

      Usage:save_registry_info(Verb,CurrBase,Info)

      Writes on disk the registry information of the modules related to the current module (CurrBase) which have been modified. This information is updated by gen_registry_info/3. Even if this predicate is used, save_registry_info/2 must be used after performing intermodular preprocessing.

      • The following properties should hold at call time:
        (nonvar/1)Verb is currently a term which is not a free variable.
        (nonvar/1)CurrBase is currently a term which is not a free variable.
        (var/1)Info is a free variable.
        (atm/1)Verb is an atom.
        (atm/1)CurrBase is an atom.
        (term/1)Info is any term.

      Usage:update_spec_info(File,Changed)

      Updates the information about version names of specialized predicates in File.

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

      Usage:

      Gets the information about version names of specialized predicates belonging to the list of imported modules from the current module, and puts them into the specializer's abstract executability table.

        Usage:cleanup_persistent_registry(Bases)

        Removes the *.reg files associated to Bases.

        • The following properties should hold at call time:
          (list/1)Bases is a list.

        No further documentation available for this predicate.

        Usage:read_registry_file(Module,Base,Verb)

        Reads the registry file of Module and loads it into registry/2, erasing any previous registry information for that module. Base must be the absolute file name, but excluding file extension.

        • The following properties should hold at call time:
          (nonvar/1)Module is currently a term which is not a free variable.
          (nonvar/1)Base is currently a term which is not a free variable.
          (nonvar/1)Verb is currently a term which is not a free variable.
          (atm/1)Module is an atom.
          (atm/1)Base is an atom.
          (atm/1)Verb is an atom.

        Usage:write_registry_file(Base,Module,Verb)

        Writes to disk the registry information stored in memory for module Module which has as base file name Base.

        • The following properties should hold at call time:
          (atm/1)Base is an atom.
          (atm/1)Module is an atom.
          (atm/1)Verb is an atom.

        PREDICATEregistry/3

        Usage:registry(Key,Module,Registry)

        Data predicate to locally store information about the registry of one or several modules. Module is the name of the module for which Registry is an entry in the registry file. It corresponds to the global answer table as it is described in [PCH03], or other auxiliary information (e.g., types).

        • Call and exit should be compatible with:
          (atm/1)Key is an atom.
          (atm/1)Module is an atom.
          (regdata_type/1)Regular type to store the semantic information of a predicate in a registry. It has the form regdata(Id,AbsInt,Sg,Call,Succ,Spec,Imdg,Chdg,Mark) where:

          • Id: Unique Id for that Sg:Call.
          • AbsInt: Abstract domain of the information.
          • Sg: Exported goal.
          • Call: Call pattern of the exported goal.
          • Succ: Success pattern for Sg:Call.
          • Spec: Abstract specialization information.
          • Imdg: List of P:CP that may produce a call to Sg:Call exported in other modules.
          • Chdg: List of P:CP to imported predicates.
          • Mark: Determines whether the value of Succ can/must be improved (depending on the success policy).
        The predicate is of type data.

        Usage:

        Gets the list of imported modules from the current module. This list is obtained from the itf information of the current module, and is stored in imported_module/1.

          No further documentation available for this predicate.

          Usage:imported_module(Module,Base)

          Enumerates the modules imported by the current module

          • Call and exit should be compatible with:
            (atm/1)Module is an atom.
            (atm/1)Base is an atom.
          The predicate is of type data.

          Usage:registry_headers(Module,HeaderTerm)

          HeaderTerm is a term read from the registry header of module Module. Data predicate to store the header terms of every registry file read. The list of registry header terms depends on the registry file version, and is stored in registry_header_format/2

          • Call and exit should be compatible with:
            (atm/1)Module is an atom.
            (term/1)HeaderTerm is any term.
          The predicate is of type data.

          Usage:add_to_imdg_list(Caller,OldList,NewList,Added)

          Adds an element Caller (formed by either a tuple (SgCaller,Caller_s,Base) or an atom '$query') to OldList, a list of intermodular dependencies. Added will be instantiated to 'y' if Caller is actually added to NewList, and 'n' if it was already in OldList.

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

          Usage:add_changed_module(Module,Base,SourceModule,Mode,ReqReanalysis)

          Adds a new entry to changed_module/6. Module registry info has been changed as a result of analyzing SourceModule, and the relatioship between SourceModule and Module is Mode (imported, caller or current).

          • The following properties should hold at call time:
            (nonvar/1)Module is currently a term which is not a free variable.
            (nonvar/1)Base is currently a term which is not a free variable.
            (nonvar/1)SourceModule is currently a term which is not a free variable.
            (nonvar/1)Mode is currently a term which is not a free variable.
            (nonvar/1)ReqReanalysis is currently a term which is not a free variable.

          PREDICATEopen_mode/3

          Usage:open_mode(Base,Type,OpenMode)

          Module with basename Base is of type Type and it is opened with mode OpenMode. Type can be user or library. OpenMode is used to indicate if an imported module's registry can be updated. It can take the values read_write or read_only.

            Usage:change_open_mode(Base,OpenMode)

            OpenMode is the new open mode of the module with basename Base. OpenMode can take the values read_write and read_only.

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

            Usage:may_be_improved_mark(SP,Mark)

            Succeeds if a registry entry marked with Mark can be used when the success policy SP is applied, and the analysis results can be improved by reanalysing the module.

              Usage:not_valid_mark(SP,Mark)

              Succeeds if a registry entry marked with Mark cannot be used when the success policy SP is applied.

                Usage:get_modules_to_analyze(AbsInt,TopLevel,ModList)

                Obtains the list of modules to analyze. This list is formed by the modules which have their .reg file outdated, or if the module is not completely analyzed (some of the entries in the .reg file are marked or invalid). For those modules which have no .reg file, the parents of the module are included in the list (as there are no call patterns for those modules without .reg file).

                The structure of the elements in the list is a term (Mod,Depth,Force), where Mod stands for the module name, Depth is the maximum depth without cycles in the intermodular graph, and Force marks those modules which must be completely reanalyzed (only useful for the parents of the modules with no reg file).

                AbsInt can be either an abstract domain name or a list of abstract domains.

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

                Usage:get_all_modules(TopLevelFile,ModList)

                Obtains ModList, the list of modules in the program unit whose top-level module is TopLevelFile. This list is formed by the modules which appear in the top-down modular graph traversal with registries set to read_write mode (and including library modules if process_libraries flag is set to 'on'.

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

                Usage:get_all_modules(TopLevelFile,ModList,IncludeList)

                The same as get_all_modules/2, but a list of included files is also returned. This list includes not only files explicitly included with :- include declarations, but also packages used.

                • The following properties should hold at call time:
                  (nonvar/1)TopLevelFile is currently a term which is not a free variable.
                  (var/1)ModList is a free variable.
                  (var/1)IncludeList is a free variable.
                  (filename/1)TopLevelFile is an atom describing the name of a file.
                • The following properties should hold upon exit:
                  (list/2)ModList is a list of filenames.
                  (list/2)IncludeList is a list of filenames.

                Usage:get_all_module_cycles(TopLevelFile,CycleList)

                Obtains CycleList, the list of cycles in the program unit whose top-level module is TopLevelFile. A cycle is a ciclic dependency in the module dependency graph. Every element of CycleList is a list of the modules which belong to each cycle. Modules not belonging to any cycle are represented as one-element lists. CycleList is sorted as a post-order traversal of the inter-cycle dependency graph.

                The modules included in CycleList are those which appear in the top-down modular graph traversal with registries set to read_write mode (and including library modules if process_libraries flag is set to 'on'.)

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

                Usage:get_all_modules_depth(TopLevelFile,ModList)

                Given the top-level module of a program, TopLevelFile, obtains in ModList the list of pairs (module,depth) with all modules in the modular graph with their maximal depth (without cycles). All the modules in a cycle have the same depth.

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

                Usage:get_module_from_sg(Sg,Module)

                Module is the name of the module for the predicate to which call pattern Sg corresponds.

                • Call and exit should be compatible with:
                  (term/1)Sg is any term.
                  (atm/1)Module is an atom.
                • The following properties should hold at call time:
                  (nonvar/1)Sg is currently a term which is not a free variable.

                Usage:recover_from_invalid_state(AbsInt,TopLevel)

                Checks if there is any invalid state in the program unit starting from TopLevel, and marks transitively as invalid all affected entries in any module of the program unit. This predicate is useful only in manual analysis of modular programs.

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

                Usage:propagate_invalid_info(AbsInt,TopLevel,BaseList)

                Marks as 'invalid' all registry entries in BaseList which transitively depend on invalid entries.

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

                Usage:module_is_processable(Base)

                Succeeds if module in Base can be processed by intermodular preprocessing tools. This predicate may have to load the registry file of that module, in order to check that the module has read-write mode.

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

                Usage:registry_is_empty(AbsInt,Mod,Base)

                Succeeds if the registry of module Mod with base name Base is empty for the abstract domain AbsInt.

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

                Usage:get_imported_calls(ICalls)

                Returns a list of tuples (IM,IMBase,Sg), where Sg is an imported call of module IM (basename IMBase). Only the imported calls from processable modules are considered.

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

                No further documentation available for this predicate.

                Usage:get_new_reg_id(Id)

                Generates a new unique identifier for registries.

                • The following properties should hold at call time:
                  (var/1)Id is a free variable.
                • The following properties should hold upon exit:
                  (atm/1)Id is an atom.

                Usage:curr_mod_entry(SgKey,AbsInt,Sg,Proj)

                Enumerates the CPs of the exported predicate of the current module(s).