This module provides compatibility to YAP through the directive
expects_dialect/1:
:- expects_dialect(yap)
The task of this module is:
- Implement system predicates available in YAP we do not yet or
do not wish to support in SWI-Prolog. Export these predicates.
- Provide yap_<name>(...) predicates for predicates that exist
both in YAP and SWI-Prolog and define goal_expansion/2 rules to
map calls to these predicates to the yap_<name> version.
Export these predicates.
- Alter the library search path, placing dialect/yap before
the system libraries.
- Allow for
.yap
extension as extension for Prolog files.
If both a .pl
and .yap
is present, the .yap
file
is loaded if the current environment expects YAP.
Current set is taken from
http://www.david-reitter.com/compling/prolog/compat_swi.pl, written by
David Reitter and Steve Moyle
- author
- - Jan Wielemaker
- To be done
- - Fill it in!
- yap_expansion(+In, +Out)[multifile]
- goal_expansion rules to emulate YAP behaviour in SWI-Prolog. The
expansions below maintain optimization from compilation.
Defining them as predicates would loose compilation.
- push_yap_library[private]
- Pushes searching for dialect/yap in front of every library
directory that contains such as sub-directory.
- push_yap_file_extension[private]
- Looks for .yap files before looking for .pl files if the current
dialect is
yap
.
- gc
- Garbage collect.
- Compatibility
- - yap
- depth_bound_call(:Goal, :Limit)
- Equivalent to
call_with_depth_limit(Goal, Limit, _Reached)
- Compatibility
- - yap
- system(+Command)
- Equivalent to
shell(Command)
.
- Compatibility
- - yap
- exists(+File)
- Equivalent to
exists_file(File)
.
- Compatibility
- - yap
- assert_static(:Term)
- Assert as static predicate. SWI-Prolog provides
compile_predicates/1 to achieve this. The emulation is a mere
alias for assert/1, as immediate compilation would prohibit
further calls to this predicate.
- deprecated
- - Use assert/1 and compile_predicates/1 after
completing the predicate definition.
- Compatibility
- - yap
- source is det
- YAP directive to maintain source-information. We have that
always.
- yap_flag(+Key, +Value) is det
- Map some YAP flags to SWI-Prolog. Supported flags:
- write_strings:Bool
- If
on
, writes strings as "..." instead of a list of
integers. In SWI-Prolog this only affects write routines
that use portray.
- yap_style_check(+Style) is det
- Map YAP style-check options onto the SWI-Prolog ones.