Preprocessing Unit Information Server

Author(s): The Ciao Development Team.

This module loads the preprocessing unit of a file to be preprocessed and serves all the information related to it to the rest of CiaoPP, including (but not limited to) the source code.

Documentation on exports

Usage 1:preprocessing_unit(Fs,Ms,E)

Loads the preprocessing unit of Fs defining Ms.

  • The following properties should hold at call time:
    (list/2)Fs is a list of filenames.
  • The following properties should hold upon exit:
    (list/2)Ms is a list of moddescs.
    (switch/1)E is an atom indicating yes/no.

Usage 2:preprocessing_unit(F,M,E)

Loads the preprocessing unit of F defining M.

  • The following properties should hold at call time:
    (filename/1)F is an atom describing the name of a file.
  • The following properties should hold upon exit:
    (moddesc/1)M is a module descriptor.
    (switch/1)E is an atom indicating yes/no.

PREDICATEprogram/2

Usage:program(P,D)

P are the clauses (no directives) of the current module and D their dictionaries.

  • The following properties should hold at call time:
    (var/1)P is a free variable.
    (var/1)D is a free variable.
  • The following properties should hold upon exit:
    (list/2)P is a list of clauses.
    (list/2)D is a list of varnamedicts.

Usage:filtered_program_clauses(Mods,P,D)

P are the clauses of module Mod and D their dictionaries.

  • The following properties should hold at call time:
    (nonvar/1)Mods is currently a term which is not a free variable.
    (var/1)P is a free variable.
    (var/1)D is a free variable.
    (list/1)Mods is a list.
  • The following properties should hold upon exit:
    (list/1)Mods is a list.
    (list/2)P is a list of clauses.
    (list/2)D is a list of varnamedicts.

Usage:replace_program(P,D)

The database holding the program is updated by first deleting its contents and then adding the clauses in P and dictionaries in D.

  • The following properties should hold at call time:
    (list/2)P is a list of clauses.
    (varnamedict/1)D is a dictionary of variable names.

Usage:native_to_prop(NProp,Prop)

Obtain the user predicate (lit) Prop that corresponds to the native property (lit) NProp.

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

Usage:prop_to_native(Prop,NProp)

Obtain the native property (lit) NProp that corresponds to the (lit) Prop user predicate.

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

Usage:native_to_props_visible(Props,Goals)

Maps native Props into their corresponding Goals visible in the current module.

  • The following properties should hold upon exit:
    (list/2)Props is a list of cgoals.
    (list/2)Goals is a list of cgoals.

Usage:dynamic_or_unknown_predicate(Goal)

Goal is an atom for a predicate such that all its clauses might not be available or may change in the program unit.

    No further documentation available for this predicate.

    Usage:add_assertions(AssrtList)

    Add assertions list AssrtList to internal DB.

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

    Usage:add_assertion(Assrt)

    Add assertion Assrt to internal DB.

      Usage:add_directive(C)

      The directive C is added to the program data base. This directive will be considered as read from the program, i.e., analizers, transformations and output will use/show it.

      • The following properties should hold at call time:
        (term/1)C is any term.

      Usage:erase_directive(D)

      Erase directive D (previously added with add_directive/1

      • The following properties should hold at call time:
        (term/1)D is any term.

      Usage:type_of_directive(Type,Body)

      There is a directive of the form :- Type Body (of arity one).

        Usage:

        Removes all information about predicate order.

        • The following properties should hold globally:
          (det/1)Calls of the form pr_key_clean are deterministic.

        PREDICATEpr_key_add/1

        Usage:pr_key_add(K)

        Add a predicate key (once)

        • The following properties should hold upon exit:
          (cgoal/1)K is a term which represents a goal, i.e., an atom or a structure.
        • The following properties should hold globally:
          (det/1)Calls of the form pr_key_add(K) are deterministic.

        PREDICATEpr_key_get/1

        Usage:pr_key_get(K)

        Current predicate keys

        • The following properties should hold upon exit:
          (cgoal/1)K is a term which represents a goal, i.e., an atom or a structure.
        • The following properties should hold globally:
          (multi/1)Calls of the form pr_key_get(K) are multi-deterministic.

        Usage:add_defined_pred(ClKey,M)

        Add the necessary data in itf_db (and pr_key/1) to define the predicate ClKey in the module M.

        • The following properties should hold at call time:
          (term/1)ClKey is any term.
          (atm/1)M is an atom.
        • The following properties should hold globally:
          (det/1)Calls of the form add_defined_pred(ClKey,M) are deterministic.

        Usage:new_predicate(F,A,NewF)

        Checks wether there is a predicate F/A in the program and returns NewF so that there is no predicate NewF/A in the program.

        • The following properties should hold at call time:
          (nonvar/1)F is currently a term which is not a free variable.
          (nonvar/1)A is currently a term which is not a free variable.
          (var/1)NewF is a free variable.
        • The following properties should hold globally:
          (det/1)Calls of the form new_predicate(F,A,NewF) are deterministic.

        Usage:

        Returns the specs of predicates defined in the current punit.

        • Call and exit should be compatible with:
          (list/1)Arg1 is a list.
        • The following properties should hold at call time:
          (var/1)Arg1 is a free variable.

        Usage:

        Returns the specs of predicates defined in the current punit.

        • Call and exit should be compatible with:
          (list/1)Arg1 is a list.
        • The following properties should hold at call time:
          (var/1)Arg1 is a free variable.

        Usage:inject_output_package(A)

        Inject the package A in the current program database (including the output package list). The necesary information from these packages is loaded for correct treatment and unexpansion.

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

        Usage:add_output_package(A)

        Add the package A to the output packages list

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

        Usage:get_output_package(X)

        X is a package that will be included in the output (module directive).

          Usage:add_output_operator(Prec,Type,OP)

          Define an operator for output (same arguments as in op/3).

          • The following properties should hold at call time:
            (int/1)Prec is an integer.
            (atm/1)Type is an atom.
            (atm_or_atm_list/1)OP is an atom or a list of atoms.

          Usage:get_output_operator(Pred,Type,OP)

          Enumerate output operators (same arguments as in op/3).

          • The following properties should hold upon exit:
            (int/1)Pred is an integer.
            (atm/1)Type is an atom.
            (atm_or_atm_list/1)OP is an atom or a list of atoms.

          PREDICATEadd_comment/1

          Usage:add_comment(Comment)

          Add comment to the comment db

          • The following properties should hold at call time:
            (string/1)Comment is a string (a list of character codes).

          PREDICATEget_comment/1

          Usage:get_comment(Comment)

          Retrieves comments from the comment db

          • The following properties should hold upon exit:
            (string/1)Comment is a string (a list of character codes).

          Usage:

          Cleans up the comment db

            No further documentation available for this predicate.

            No further documentation available for this predicate.

            Usage:add_commented_assertions(A)

            Add the assertions list A to the commented assertions DB.

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

            Usage:add_commented_assertion(A)

            Add assertion A to the commented assertions DB.

            • The following properties should hold at call time:
              (term/1)A is any term.

            Usage:

            Clean up all facts that p_unit asserts.

              Usage:get_call_from_call_assrt(Sg,M,Status,Call,Source,LB,LE)

              Returns in Call, upon backtracking call patterns from calls assertions related to Sg, in module M. Also takes care of disjunctions.

                Usage:get_pred_mod_defined(Sg,Mod)

                Returns the module where a predicate given by goal Sg is defined. If the Sg is multifile, the modules where it is defined are enumerated.

                • The following properties should hold at call time:
                  (nonvar/1)Sg is currently a term which is not a free variable.
                  (var/1)Mod is a free variable.
                • The following properties should hold globally:
                  (nondet/1)Calls of the form get_pred_mod_defined(Sg,Mod) are non-deterministic.

                No further documentation available for this predicate.

                No further documentation available for this predicate.

                No further documentation available for this predicate.

                No further documentation available for this predicate.

                No further documentation available for this predicate.

                Usage:

                Cleans up libcache.

                  Usage:

                  Checks if the libcache is loaded

                    Usage:load_libcache(DataDir)

                    Load the preprocessed library cache (specified in the core/Manifest/core.libcache.pl module.

                      Usage:gen_libcache(DataDir)

                      Generate the preprocessed library cache (specified in the core/Manifest/core.libcache.pl module. .

                        (UNDOC_REEXPORT)type_of_goal/2
                        Imported from p_unit_basic (see the corresponding documentation for details).

                        Documentation on multifiles

                        PREDICATEdefine_flag/3

                        Usage:define_flag(Flag,FlagValues,Default)

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

                        No further documentation available for this predicate. The predicate is multifile.

                        No further documentation available for this predicate. The predicate is multifile.

                        No further documentation available for this predicate. The predicate is multifile.

                        No further documentation available for this predicate. The predicate is multifile.

                        No further documentation available for this predicate. The predicate is multifile.

                        No further documentation available for this predicate. The predicate is multifile.

                        No further documentation available for this predicate. The predicate is multifile.

                        No further documentation available for this predicate. The predicate is multifile.

                        No further documentation available for this predicate. The predicate is multifile.

                        No further documentation available for this predicate. The predicate is multifile.

                        No further documentation available for this predicate. The predicate is multifile.