I realize there are going to be limits to this, but is there a reasonable way to put in conditional directives in Prolog code so that it an work reasonably in either GNU or SWI? I'm thinking at least the simplest cases, where built-in predicates such as sumlist
in SWI and sum_list
in GNU don't match each other in spelling. Or SWI has assert
but GNU does not. So it would be nice to have something like:
:- if($SWI).
SWI version of stuff
:- else.
GNU version of stuff
:- endif.
Or simply:
:- if(not_a_builtin(sumlist))
sumlist(L, S) :- sum_list(L, S).
:- endif.
Or what not. The conditional directives exist in both languages, but the seem to stop just short of providing the conditionals needed to do this sort of thing. I'm probably missing something that a manual search didn't turn up for me.