1
votes

I have the error/solution :5:10 : Syntax Error : Operator expected

nonoverlap(R,Task1,Task2) :-
   Task1 = task(_,T1,L1,Rs2),
   Task2 = task(_,T2,L2,Rs2),
   ((member(R,Rs1), member(R,Rs2)) ->
      T2 #> T1+L1     % start Task2 after Task1 has finished
       #\/             % OR
      T1 #> T2+L2     % start Task1 after Task2 has finished
   ;
      true            % non-conflicting, do nothing
   ).
1
You probably need to add :- use_module(library(clpfd)). at the start. CLP(FD) is not yet an autoloaded library in SWI. - mat

1 Answers

2
votes

You need to say at the beginning of the file/module

:- use_module(library(clpfd)).

And apart from that, you most probably want to say T2 #>= T1 + L1.

Also, abs(T2-T1) #>= min(L1,L2) can be said, regardless of the order.