Commit 0ba8eb5a authored by Michael Hanus 's avatar Michael Hanus
Browse files

Some checks added

parent fbb658d9
......@@ -15,6 +15,7 @@
writeErrNQ/1, nlErrNQ/0, writeLnErrNQ/1,
writeBlanks/1,
onlySICStusMessage/1, checkSICStusAndWarn/1,
onlySWIMessage/1, checkSWIAndWarn/1,
putChars/2, writeChars/2,
assertPakcsrc/1, writeRCvalues/0,
evaluateDynamicPredInfo/3, checkDynamicAccessMethod/2,
......@@ -177,10 +178,22 @@ checkSICStusAndWarn(Feature) :-
prolog(sicstus) -> true ; onlySICStusMessage(Feature).
onlySICStusMessage(Feature) :-
writeErr('WARNING: "'), writeErr(Feature),
writeErr('" not available!'), nlErr,
writeErr('(only available in a PAKCS implementation based on SICStus-Prolog)'),
nlErr.
appendAtoms(['"',Feature,'" not available ',
'(only available in a PAKCS implementation based on SICStus-Prolog)!'],
Message),
raise_exception(Message).
% check whether this is a SICStus-based implementation and provide warning
% if this is not the case:
checkSWIAndWarn(Feature) :-
prolog(swi) -> true ; onlySWIMessage(Feature).
onlySWIMessage(Feature) :-
appendAtoms(['"',Feature,'" not available ',
'(only available in a PAKCS implementation based on SWI-Prolog)!'],
Message),
raise_exception(Message).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
......
......@@ -63,11 +63,13 @@ translateLabelingOption('CLPFD.All',all) :- sicsLabel.
translateLabelingOption('CLPFD.Minimize'(DomVar),minimize(DomVar)) :- sicsLabel.
translateLabelingOption('CLPFD.Maximize'(DomVar),maximize(DomVar)) :- sicsLabel.
translateLabelingOption('CLPFD.Assumptions'(Var),assumptions(Var)) :- sicsLabel.
translateLabelingOption('CLPFD.RandomVariable'(Seed),random_variable(Seed)).
translateLabelingOption('CLPFD.RandomValue'(Seed),random_value(Seed)).
translateLabelingOption('CLPFD.RandomVariable'(Seed),random_variable(Seed)) :- swiLabel.
translateLabelingOption('CLPFD.RandomValue'(Seed),random_value(Seed)) :- swiLabel.
sicsLabel :- checkSICStusAndWarn('CLPFD.labeling: labeling options').
swiLabel :- checkSWIAndWarn('CLPFD.labeling: labeling options RandomVariable/RandomValue').
prim_FD_plus(Y,X,R) :- #=(R,X+Y).
prim_FD_minus(Y,X,R) :- #=(R,X-Y).
......
......@@ -65,6 +65,16 @@ prologMinorVersion(MV) :-
current_prolog_flag(version,VN),
MV is (VN mod 10000)//100.
% Check SWI version since version >=7.x is not a real Prolog system...
:- prologMajorVersion(7)
-> nl(user_error),
write(user_error,'CANNOT INSTALL PAKCS WITH SWI VERSION 7.x!!!'),
nl(user_error),
write(user_error,'See http://www.informatik.uni-kiel.de/~pakcs/download.html for further infos.'),
nl(user_error),
nl(user_error),
halt(1)
; true.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
:- multifile pakcsrc/2. % relevant for createSavedState
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment