:-dlib_require(clp).
go:-
VarsX=[X1,X2,X3,X4,X5,X6,X7,X8,X9,X10],
VarsX::[0..1],X1*X2+X3+X4+X5+X6+X7*X8+X9+X10#=1,
labeling(VarsX),write(VarsX),nl,
fail;true.
:-go.
で実行しますとエラーが出ます。
AZ-Prolog version 9.24 (Win64/x64)
Copyright (C) SOFNEC CO., LTD. 1987-2016/02/08
Illegal Arithmetic expression —- Backtrace
;((=(VarsX,[X1,X2,X3,X4,X5,X6,X7,X8,X9,X10]),(::(VarsX,[..(0,1)]),(#=(+(+(+(+(+(+(+(*(X1,X2),X3),X4),X5),X6),*(X7,X8)),X9),X10),1),(labeling(VarsX),(write(VarsX),(nl,fail)))))),true) go :-
| ?-
1行目を削除して、
bprologでの実行の場合はエラーが出ず実行できます。
B-Prolog Version 8.1, All rights reserved, (C) Afany Software 1994-2014.
| ?- [-‘trb2.pl’].
consulting::trb2.pl
[0,0,0,0,0,0,0,0,0,1]
[0,0,0,0,0,0,0,0,1,0]
[0,0,0,0,0,0,0,1,0,1]
[0,0,0,0,0,0,0,1,1,0]
[0,0,0,0,0,0,1,0,0,1]
[0,0,0,0,0,0,1,0,1,0]
[0,0,0,0,0,0,1,1,0,0]
[0,0,0,0,0,1,0,0,0,0]
。。。
azprologの場合はどのような手直しが必要でしょうか。