home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 9 / 09.iso / l / l210 / 1.ddi / EXAMPLES.ARC / CH05EX04.PRO < prev    next >
Encoding:
Prolog Source  |  1988-06-21  |  454 b   |  25 lines

  1. /*
  2.    Turbo Prolog 2.0 Chapter 5, Example Program 4
  3.    
  4.    Copyright (c) 1986, 88 by Borland International, Inc
  5.    
  6. */
  7.    
  8. domains
  9.    name, thing = symbol
  10.  
  11. predicates
  12.    likes(name, thing)
  13.    reads(name)
  14.    is_inquisitive(name)
  15.  
  16. clauses
  17.    likes(john, wine).
  18.    likes(lance, skiing).
  19.    likes(Z, books) :-
  20.       reads(Z), is_inquisitive(Z).
  21.    likes(lance, books).
  22.    likes(lance, films).
  23.  
  24.    reads(john).
  25.    is_inquisitive(john).