home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 9 / 09.iso / l / l217 / 2.ddi / EXAMPLES / CH05EX11.PRO < prev    next >
Encoding:
Prolog Source  |  1990-03-26  |  638 b   |  25 lines

  1. /*
  2.    Copyright (c) 1986, 90 by Prolog Development Center
  3. */
  4.    
  5. predicates
  6.    likes_shopping(symbol)
  7.    has_credit_card(symbol, symbol)
  8.    bottomed_out(symbol, symbol)
  9.  
  10. clauses
  11.    likes_shopping(Who) :- 
  12.       has_credit_card(Who, Card),
  13.       not (bottomed_out(Who, Card) ) ,
  14.       write(Who, " can shop with the ",Card, " credit card.\n").
  15.  
  16.    has_credit_card(chris, visa).
  17.    has_credit_card(chris, diners).
  18.    has_credit_card(joe, shell).
  19.    has_credit_card(sam, mastercard).
  20.    has_credit_card(sam, citibank).
  21.  
  22.    bottomed_out(chris, diners).
  23.    bottomed_out(sam, mastercard).
  24.    bottomed_out(chris, visa).
  25.