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

  1. /* Program 54 */
  2. /*
  3.   Goal is on page 117 of the manual.
  4. */
  5.  
  6. domains
  7.     d = integer
  8.  
  9. predicates
  10.     not_(D,D)
  11.     and_(D,D,D)
  12.     or_(D,D,D)
  13.     xor(D,D,D)
  14.  
  15. clauses
  16.     not_(1,0).
  17.     not_(0,1).
  18.     and_(0,0,0).
  19.     and_(0,1,0).
  20.     and_(1,0,0).
  21.     and_(1,1,1).
  22.     or_(0,0,0).
  23.     or_(0,1,1).
  24.     or_(1,0,1).
  25.     or_(1,1,1).
  26.     xor(Input1,Input2,Output) if
  27.         not_(Input1,N1) and not_(Input2,N2) and
  28.         and_(Input1,N2,N3) and and_(Input2,N1,N4) and
  29.         or_(N3,N4,Output).
  30.