different(Hyogo,Kyoto), …… , different(Osaka,Wakayama). ? coloring(Hyogo,Kyoto,Shiga,Nara,Osaka,Wakayama). Hyogo = red Kyoto = green Shiga = red Nara = red Osaka = blue Wakayama = green ; Hyogo = red Kyoto = green Shiga = blue Nara = red Osaka = blue Wakayama = green (...以下省略)
[X | Zs]) : append(Ls, Ys, Zs). %質問 ? append([1,2],[3,4,5],X). X = [1,2,3,4,5] yes. ? append([1,2],X,[1,2,3,4,5]). X = [3,4,5] yes. ? append(X,Y,[a,b,c]). X = NIL Y = [a,b,c] ; X = [a] Y = [b,c] ; X = [a,b] Y = [c] ; X = [a,b,c] Y = NIL