home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / prolog / library / prolo_c / exampl02.pro < prev    next >
Text File  |  1986-10-06  |  795b  |  33 lines

  1. /* Program 2 */
  2. /*
  3.    Goals for this program are on page 21 of the
  4.    manual. We have added an error to this
  5.    program to show how errors are returned. To
  6.    correct this program just delete the portion
  7.    marked.
  8. */
  9.  
  10. domains
  11.     brand, color  = symbol
  12.     age, price    = integer
  13.     mileage       = real
  14.  
  15. predicates
  16.     car(brand,mileage,age,color,price)
  17.  
  18. /* <==  delete from this line [F7] down to... */
  19. goal
  20.     car(renault,13,3,red,12000).
  21.  
  22. /*   2200 type error:  at the bottom of
  23. the message window is this error. 3.5 is
  24. not an integer and Age must be an integer.
  25. Delete this goal section and continue to
  26. read page 21  */
  27. /* ... here ==> */
  28.  
  29. clauses
  30.     car(chrysler,130000,3,red,12000).
  31.     car(ford,90000,4,gray,25000).
  32.     car(datsun,8000,1,red,30000).
  33.