Re: PROLOG

看板Programming作者時間16年前 (2009/05/25 02:01), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串2/2 (看更多)
Hi, I've answered you using Google Groups. But it seems that cannot be accepted by normal BBS systems because of difference between UTF-8 and Big5 encoding. So I have to reply again in English. On 5=A4=EB24=A4=E9, =A4W=A4=C810=AE=C944=A4=C0, ntouckcm....@ptt.cc (=AA=BE= =A8=AC=B1`=BC=D6) wrote: > process(Input, G, P, G, P,_):- > Input \=3D positive(_), > Input \=3D negative(_), > write("Enter either positive(Instance) or negative(Instance) "), = nl > > % The following predicate definitions are duplicated in either > % the general to specific searches or the specific to genearal searches. > % > specialize_set([], [], _, _). > ERROR: c:/candidate1.pl:54:0: Syntax error: Operator expected The same error showed in GNU Prolog is more clear, "candidate1.pl:54:1: syntax error: . or operator expected after expression," which means that there's an operator missing. Watch out the tail of the formula before specialize_set/4, there it expects a dot symbol. And, ... > specialize_set([Hypothesis|Rest],[Hypothesis|Updated_rest],Instance, Type= s):- > not (covers(Hypothesis, Instance)), > specialize_set(Rest,Updated_rest, Instance, Types). Have you ever got any error at this segment? In GNU Prolog, it got the same error message at the line 63, position 12, which is just at the space between *not* and *(covers(Hypothesis, Instance)),*. And it will be clean out if the space is eliminated.

05/26 21:23, , 1F
謝謝~
05/26 21:23, 1F
文章代碼(AID): #1A6OjZ00 (Programming)
討論串 (同標題文章)
文章代碼(AID): #1A6OjZ00 (Programming)