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

  1. /*
  2.    Turbo Prolog 2.0 Chapter 5, Example Program 10
  3.    
  4.    Copyright (c) 1986, 88 by Borland International, Inc
  5.    
  6. */
  7.    
  8. domains
  9.    name = symbol
  10.    gpa  = real
  11.  
  12. predicates
  13.    honor_student(name)
  14.    student(name, gpa)
  15.    probation(name)
  16.  
  17. clauses
  18.    honor_student(Name):- 
  19.       student(Name, GPA),
  20.       GPA>=3.5,
  21.       not(probation(Name)).
  22.  
  23.    student("Betty Blue", 3.5).
  24.    student("David Smith", 2.0).
  25.    student("John Johnson", 3.7).
  26.    probation("Betty Blue").
  27.    probation("David Smith").
  28.