:- module(prolog_detect,[prolog/1]).

%
% check for the presence of "eclipse" module in ECLiPSe
%
prolog(eclipse) :-
	current_module(eclipse),
	!.

%
% check for prolog_flag(quintus_directory,_) in Quintus
%
prolog(quintus)	:-
	current_prolog_flag(quintus_directory,_),
	!.

%
% check for prolog_flag/2 in SICStus
%
prolog(sicstus) :-
	current_prolog_flag(language,sicstus),
	!.

%
% if all fail, then it is SWI
%
prolog(swi).

