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.

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

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:entry_assertion(Goal,Call,Name)

There is an entry assertion for Goal with call pattern Call, uniquely identifiable by Name.

  • Call and exit should be compatible with:
    (callable/1)Goal is a term which represents a goal, i.e., an atom or a structure.

Usage:exit_assertion(Goal,Call,Succ)

There is an exit assertion for Goal with call pattern Call and success pattern Succ.

  • Call and exit should be compatible with:
    (callable/1)Goal is a term which represents a goal, i.e., an atom or a structure.

PREDICATEnative_prop/2

Usage:native_prop(Goal,Prop)

Goal is an atom of a predicate which corresponds to the native property (atom) Prop.

  • The following properties should hold upon exit:
    (callable/1)Goal is a term which represents a goal, i.e., an atom or a structure.
    (native_prop_term/1)Prop identifies a native property.

Usage:native_props(Props,Goals)

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

  • Call and exit should be compatible with:
    (list/2)Props is a list of callables.
    (list/2)Goals is a list of callables.

Usage:dynamic_code_predicate(Goal)

Goal is an atom for a predicate such that all its clauses might not be available in the program unit (e.g., if it is multifile).

    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.

          PREDICATEpr_key_add/1

          Usage:pr_key_add(K)

          Add a predicate key (once)

          • The following properties should hold upon exit:
            (predkey/1)K is an atom that uniquely identifies a program predicate.

          PREDICATEpr_key_get/1

          Usage:pr_key_get(K)

          Current predicate keys

          • The following properties should hold upon exit:
            (predkey/1)K is an atom that uniquely identifies a program predicate.

          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.

          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.

          Usage:

          Returns the specs of predicates defined in the current module.

          • 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:push_history(X)

          Push history item X.

          • The following properties should hold at call time:
            (atom/1)X is currently instantiated to an atom.

          PREDICATEpop_history/1

          Usage:pop_history(X)

          Pop history item X.

          • The following properties should hold at call time:
            (atom/1)X is currently instantiated to an atom.

          Usage:get_output_path(UseHistory,Path)

          Default output file name based. Encode analysis/transformation history if UseHistory is yes.

          • The following properties should hold upon exit:
            (atm/1)UseHistory is an atom.
            (atm/1)Path is an atom.

          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 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.

            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.

                  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.

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

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

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