/*
POLLUTION CONTROL EXAMPLE

RUNNING TIME:
2 of 4 - ~ 5 sec
3 of 5 - ~ 35 sec
4 of 6 - ~ 615 sec
*/
begin%pollution%

pollute (1,x,y,z) :- 2x + 3y + 3z <= 41.
pollute (2,x,y,z) :- x + 2y + z <= 25.
pollute (3,x,y,z) :- 3x + y + z <= 32.
pollute (4,x,y,z) :- 4x + 2y + z < 65.
pollute (5,x,y,z) :- 7x + 2y + 4z < 87.
pollute (6,x,y,z) :- 6x + 3y + 2z < 77.

/*pollute (7,x,y,z) :- 5x + 7y + 8z < 134.
pollute(8,x,y,z) :- 2x + 7y + 3z < 66.*/

s (0,1).
s (1,2).
s (2,3).
s (3,4).
s (4,5).
s (5,6).

/*s (6,7).
s (7,8).*/

iofj (i,j,x,y,z) :- i = 0, j = 0.
iofj (i2,j2,x,y,z) :- iofj(i,j,x,y,z), s(i,i2), s(j,j2), pollute(j,x,y,z).
iofj (i,j2,x,y,z) :- iofj(i,j,x,y,z), s(j,j2).
oktobuy (x,y,z) :- iofj(i,j,x,y,z), i >= 4, j = 6.

end%pollution%