我一直在試圖學習Prolog,並且完全沉迷於謂詞s()所做的事情。 我看到它經常被使用,並且互聯網上關於Prolog的資源如此之少以至於我找不到答案。s()謂詞在Prolog中做什麼?
Ex。
/* sum(Is,S) is true if S is the sum of the list of integers Is. */
sum([],0).
sum([0|Is],S):-sum(Is,S).
sum([s(I)|Is], s(Z)):-sum([I|Is],Z).
你使用的是什麼版本的prolog解釋器? –
我使用:SWI-Prolog版本5.10.1 for amd64 – okin33