Why is this prolog program not compiling?
I have a prolog program. These lines are preventing it from compiling:
wins(A,B,C,D) :- convert(A,W), value(W,P), convert(B,X), value(X,Q),
convert(C, Y), value(Y,R), convert(D,Z), value(Z,S), card(A), card(B), card(C), card(D),
(P+Q)>(R+S), (P+Q)<22, A/=B, A/=C, A/=D, B/=C, B/=D, C/=D. %this is not compiling
wins(A,B,C,D) :- convert(A,W), value(W,P), convert(B,X), value(X,Q),
convert(C,Y), value(Y,R), convert(D,Z), value(Z,S), card(A), card(B), card(C), card(D),
(R+S)>21, (P+Q)<22, A/=B, A/=C, A/=D, B/=C, B/=D, C/=D. %this is not compiling
I get the following errors开发者_JAVA技巧:
| ?- [blackjack].
compiling /home/ross/flash/current/CS390/blackjack.pl for byte code...
/home/ross/flash/current/CS390/blackjack.pl:47:25: syntax error: . or operator expected after expression
/home/ross/flash/current/CS390/blackjack.pl:51:22: syntax error: . or operator expected after expression
2 error(s)
compilation failed
/=
is not a valid operator. You must have meant \=
.
(Better yet, use dif(A,B)
if your Prolog supports it, and put the dif
calls before the rest of the clause.)
精彩评论