0
我需要查看是否有三个人至少有两个来自组g1。我写道:序言中的算术错误
ingroup(person1, g1).
ingroup(person2, g1).
ingroup(person3, g1).
ingroup(person4, g2).
ingroup(person5, g2).
test_ok :- ingroup(X,g1),ingroup(Y,g1), ingroup(Z,G), diff(X,Y,Z).
diff(X,Y,Z) :- X =\= Y, X =\= Z, Y =\= Z.
这使得在SWI Prolog的以下错误:
68 ?- test_ok.
ERROR: =\=/2: Arithmetic: `person1/0' is not a function.
我要去哪里错了?
OT:你的代码是非常昂贵的...了解一些更便宜的选择... – CapelliC