2013-12-11 113 views
-1
option(d):-write('Delete existing route'),nl. 
    write('Please key in the type of transportation[c=byCar/p=byPlane/t=byTrain] '),read(R1),nl, 
    write('Please key in the starting point of destination: '),read(S1),nl, 
    write('Please key in the ending point of destination: '),read(D1),run4(R1,S1,D1),nl, 
    write('Delete existing travelling alternative record success!'),nl,nl,menu. 

它顯示謂詞保護。我可以知道如何解決它嗎?謂詞保護 - 序言錯誤

回答

1

你的問題是你在第一行而不是逗號後有一段nl,所以它看起來像Prolog一樣,你正在重新定義逗號操作符而不是定義一個option/1謂詞。但這就是你的問題開始的地方。