我是答案集编程的初学者,对 cligo 完全陌生。我尝试了以下关于护士换班的事实和限制条件,但我没有得到任何模型,并且 cligo 没有标记任何错误。我不断收到UNSAT。我做错了什么?
nurselimits(x, min, max).
worklimits(min, max).
daylimits(x, t, min, max).
x(morning; afternoon; night; off; leave).
x(1..5).
day(1..28).
days(28).
nurse(1..40).
shift(1, morning, 8).
shift(2, afternoon, 14).
shift(3, night, 20).
shift(4, off, 0).
shift(5, leave, 10).
nurselimits(1,6,9).
nurselimits(2,6,9).
nurselimits(3,4,7).
daylimits(1,8,6,9).
daylimits(2,8,6,9).
daylimits(3,8,5,10).
worklimits(132,228).
{assign(N, X, D) : shift(X, Name, H), X != 4, X != 5} = 1:- nurse(N), day(D).
:- day(D), #count{N : assign(N, X, D)} > max, nurselimits(x, min, max).
:- day(D), #count{N : assign(N, X, D)} < min, nurselimits(x, min, max).
:- nurse(N), #sum{H, D : assign(N, X, D), shift(X, Name, H)} > max, worklimits(min, max).
:- nurse(N), #sum{H, D : assign(N, X, D), shift(X, Name, H)} < min, worklimits(min, max).
:- nurse(N), assign(N, X1, D), assign(N, X2, D+1), X2 < X1 , X1 <= 3.
:- nurse(N), day(D), days(DAYS), D <= DAYS-21,
#count{D1 : assign(N, 4, D1), D1 >= D, D1 <= D+21} = 1.
:- nurse(N), #count{D: assign(N, X, D)} > max, daylimits(x, t, min, max).
:- nurse(N), #count{D: assign(N, X, D)} < min, daylimits(x, t, min, max).