Availability::- use_module(library(prolog_xref)).(can be autoloaded)
 xref_defined(?Source, +Goal, ?How) is nondet
Test if Goal is accessible in Source. If this is the case, How specifies the reason why the predicate is accessible. Note that this predicate does not deal with built-in or global predicates, just locally defined and imported ones. How is one of of the terms below. Location is one of Line (an integer) or File:Line if the definition comes from an included (using :- include(File)) directive.
  • dynamic(Location)
  • thread_local(Location)
  • multifile(Location)
  • public(Location)
  • local(Location)
  • foreign(Location)
  • constraint(Location)
  • imported(From)