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

  1. /*
  2.    Turbo Prolog 2.0 Chapter 7, Example Program 1
  3.    
  4.    Copyright (c) 1986, 88 by Borland International, Inc
  5.    
  6. */
  7.    
  8. predicates
  9.    country(symbol)
  10.    print_countries
  11.  
  12. clauses
  13.    country(england).
  14.    country(france).
  15.    country(germany).
  16.    country(denmark).
  17.  
  18.    print_countries :- country(X),
  19.                      write(X),                        /* write the value of X */
  20.                      nl,                                  /* start a new line */
  21.                      fail.
  22.  
  23.    print_countries.
  24.