This library provides predicates to load, access, modify, and pretty print module preprocessing units . A preprocessing unit of a module is made up of the following elements:
This is similar to the information stored in compiler/c_itf but extended to include the definitions of the exported and local properties transitively used by assertions of the exported predicates (and properties). This is necessary to be able to correctly interpret such assertions. When loading a preprocessing unit, this library generates .ast files , to cache this information.
Other modules and files in this library:
Usage:preprocessing_unit(Fs,Ms,E,Opts)
Loads the preprocessing unit of Fs defining Ms.
Usage:program(P,D)
P are the clauses (no directives) of the current module and D their dictionaries.
Usage:filtered_program_clauses(Mods,P,D)
P are the clauses of module Mod and D their dictionaries.
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.
Usage:native_to_props(Props,Goals)
Maps native Props into their corresponding Goals (using native_prop_map/3 when needed).
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.
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.
Usage:erase_directive(D)
Erase directive D (previously added with add_directive/1
Usage:type_of_directive(Type,Body)
There is a directive of the form :- Type Body (of arity one).
Usage:pr_key_clean(M)
Removes all information about predicate order for M.
Usage 1:pr_key_add(M,K)
Add a predicate key (once)
Usage 2:pr_key_add(M,K)
Add a predicate key (once), extract module from key
Usage:pr_key_get(M,K)
Enumerate predicate keys
Usage:add_defined_pred(ClKey,M)
Add the necessary data in itf_db to define the predicate ClKey in the module M.
Usage:new_predicate(F,A,NewF)
Checks whether there is a predicate F/A in the program and returns NewF so that there is no predicate NewF/A in the program.
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.
Usage:add_output_package(A)
Add the package A to the output packages list
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).
Usage:get_output_operator(Pred,Type,OP)
Enumerate output operators (same arguments as in op/3).
Usage:add_comment(Comment)
Add comment to the comment db
Usage:get_comment(Comment)
Retrieves comments from the comment db
Usage:
Cleans up the comment db
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.
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. Warning: It cleans the current state of p_unit.
Usage:define_flag(Flag,FlagValues,Default)