The idea for this predicate was raised by Vitor Santos Costa in a discussion to reach as a portability framework between SWI-Prolog and YAP.
This library defines :- expects_dialect/1, telling the system for which Prolog dialect was written, as well as useful tests in conditional compilation:
- expects_dialect(+Dialect:atom) is det
- Tell Prolog all subsequent code to the end of the file or the next :- expects_dialect/1 directive is written for the indicated Dialect. The current dialect is available through prolog_load_context/2.
- exists_source(+Source) is semidet
- True if Source (a term valid for load_files/2) exists. Fails
without error if this is not the case. The predicate is intended
to be used with :- if, as in the example below. See also
:- if(exists_source(library(error))). :- use_module_library(error). :- endif.
- source_exports(+Source, +Export) is semidet
- source_exports(+Source, -Export) is nondet
- True if Source exports Export. Fails without error if this is not the case. See also exists_source/1.