Did you know ... Search Documentation:
Pack logicmoo_base -- prolog/logicmoo/pdt_server/org.cs3.prolog.library_3.1.2.201603251848/pl/utils4modules - all backup.pl
PublicShow source
 hidden_module(M)
 empty_module(?Module)
Generate or test empty modules (which contain no own predicate declaration, let alone any clauses).
 module_of_file(?File, ?Module)
Module is the module defined in File (or 'user' if the file defines no explicit module or the defined module is a hidden system module.
 visible_in_module(?Module, ?Name, ?Arity) is nondet
Suceed if the predicate Name/Arity is visible in Module either via a local declaration or import.

The used predicate_property(Head,visible) is documented as: True when predicate can be called without raising a predicate existence error. This means that the predicate is (1) defined, (2) can be inherited from one of the default modules (see default_module/2) or (3) can be autoloaded. The behaviour is logically consistent iff the propery visible is provided explicitly. If the property is left unbound, only defined predicates are enumerated.

 declared_in_module(?Module, ?Name, ?Arity, ?DeclaringModule) is nondet
Succeed if the predicate Name/Arity visible in Module is declared in DeclaringModule. Module = DeclaringModule holds if Module contains a local (non-imported) declaration. Otherwise, DeclaringModule is the module from which the declaration is imported. Note that predicate suceeds even if there is no defining clause for Name/Arity in DeclaringModule (definition implies declaration but not vice versa).
 declared_in_module(?Module, +Head, ?DeclaringModule) is nondet
does not generate!
 defined_in_module(Module, Name, Arity) is nondet
 referenced_but_undeclared(?Module, ?Name, ?Arity) is nondet
Succeed if the predicate Name/Arity is called in Module is but not visible there.
 defined_in_file(-Module, -Name, -Arity, -N, ?File, ?Line) is nondet
defined_in_file(+Module,+Name,+Arity,+N,?File,?Line) is det

Get the source locations (File and Line) of all clauses that define Module:Name/Arity.

 declared_in_file(?Module, Head, ?File, ?Line) is nondet
File is the file containing the declaration for the predicate Head, which is visible in Module. Line = 1 (approximating the line number information missing for declarations).
 assert_in_module(?Mod, ?Head) is det
Assert clauses in an explicitly specified module.

CAUTION: Due to the semantics of modules in SWI-Prolog, the clause ends up in the module from which the explicitly specified module imports the declaration of the predicate to be asserted.

assert_in_module/2,3 differs from a normal assert called in a module, which would assert the fact into the module containing the invocation of assert (unless the predicate containing the invocation and all its parents on the stack were "module_transparent" and the invoking module was loaded via use_module ...).

Undocumented predicates

The following predicates are exported, but not or incorrectly documented.

 declared_in_module(Arg1, Arg2)
 declared_but_undefined(Arg1, Arg2, Arg3)
 defined_in_module(Arg1, Arg2)
 defined_in_module(Arg1, Arg2, Arg3, Arg4)
 defined_in_files(Arg1, Arg2, Arg3, Arg4)
 assert_in_module(Arg1, Arg2, Arg3)
 clause_in_module(Arg1, Arg2)
 clause_in_module(Arg1, Arg2, Arg3)
 retract_in_module(Arg1, Arg2)
 retract_in_module(Arg1, Arg2, Arg3)
 retractall_in_module(Arg1, Arg2)
 call_in_module(Arg1, Arg2)
 call_and_report_contex_module(Arg1)
 report_contex_module(Arg1)
 listing_in_module(Arg1, Arg2)
 copy_module_predicate(Arg1, Arg2, Arg3)
 move_module_predicate(Arg1, Arg2, Arg3)