Prolog Recursive Rules Wrong Result -


I have defined a recursive rule but the result seems incorrect

  customer (Peter, Bank (MacConk), Customstrip (Individual), Citizen (Malaysia), Age (62), Credit (50000), Income (3000), Property (car) Citizen (X): - Client (ex, bank (_), cast type (_), citizen (Malaysia), age (age), credit (_), income (_), property (_), age & gt ; 60. Low interest (senior): - Teacher (senior) issiencecitizen (Peter).  

but SWI-Prolog backs X = peter; X = Peter

Why change it once twice?

Please help

thanks

A common problem It is that you have said that Peter is twice a senior citizen; First by adding the first to the "database" before the first order logic in your program, just by stating that it is a senior citizen at the bottom of your program. My last answer (Add deductible) is also true but misses the problem; After being a matching atom, an integrated variable will cancel the search of X, and therefore will not progress from the cutter to the other X-E.


Comments