开发者

swi prolog , matching data

this is my source code , can someone tell me what is error , and wat is the best way to do this , i want to show out who matching who ...can somebody help me ?

   % Author:
   % Date: 08-Sep-11
   person(may,female,25,blue).
   person(john,male,30,blue).
   match:-person(Fn,'female',Fage,Fatt),
          person(Mn,'male',Mage,Matt),
          Fage<=Mage,
          Fatt=Matt,
           write(Fn ,'-- match with----',Mn).


   error message :55 ?- match.
                        ERROR: Undefined procedure: match/0
                        ERROR:     However, there are definitions for:
                        ERROR:         catch/3
                      开发者_Go百科  false.


match :-
    person(Fn,female,Fage,Fatt),
    person(Mn,male,Mage,Matt),
    Fage =< Mage,
    Fatt = Matt,
    format('~w~s~w~n',[Fn ,'-- match with----',Mn]).
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜