我写了如下规则:
rule_1561_cctype([],_,_,_).
rule_1561_cctype([X1|Y1],[Ru1|Ru1T],[Ru2|Ru2T],[Ru3|Ru3T]):-
X1 is 0 -> Ru1 in {2,3,4}, Ru2 in {-1}, Ru3 in {-1}
;X1 is 1 -> Ru1 in {2,3,4}, Ru2 in {2,3,4}, Ru3 in {-1}
;X1 is 2 -> Ru1 in {2}, Ru2 in {2}, Ru3 in {2}
;rule_1561_cctype(Y1,Ru1,Ru2,Ru3),!.
我将这条规则称为如下:
rule_1561_cctype(CctypeInt, Ru1, Ru2,Ru3),
其中 CctypeInt 是整数列表。
但我在下面收到错误:
935 9 Call: rule_1561_cctype(dom(0..2),dom({-1}\/(2..4)),dom({-1}\/(2..4)),dom({-1}\/(2..4))) ?
! Type error in argument 2 of = /2
! integer expected, but [] found
! goal: _310957=[]
935 9 Exception: rule_1561_cctype(dom(0..2),dom({-1}\/(2..4)),dom({-1}\/(2..4)),dom({-1}\/(2..4))) ?
我在某个地方错了吗?