home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 9 / 09.iso / l / l210 / 1.ddi / REFEXAMP.ARC / RETRACT2.PRO < prev    next >
Encoding:
Text File  |  1988-06-21  |  584 b   |  31 lines

  1. %====================== retract/2             ===============================
  2. DOMAINS
  3.   LIST = INTEGER*
  4.  
  5. DATABASE - dba1
  6.   fact1(INTEGER,STRING,LIST)
  7.  
  8. DATABASE - dba2
  9.   fact2(INTEGER,STRING)
  10.  
  11. CLAUSES
  12.   fact1(1,"fact1",[1,2,3]).
  13.   fact1(2,"fact2",[1,3]).
  14.   fact1(3,"fact2",[3,2,1]).
  15.  
  16.   fact2(1,"one").
  17.   fact2(1,"one once more").
  18.   fact2(2,"two").
  19.  
  20.   -------- Dialog --------
  21. Goal: retract(X,dba1)
  22. X=fact1(1,"fact1",[1,2,3])
  23. X=fact1(2,"fact2",[1,3])
  24. X=fact1(3,"fact2",[3,2,1])
  25. 3 Solutions
  26.  
  27. Goal: retract(fact2(1,X),dba2)
  28. X=one
  29. X=one once more
  30. 2 Solutions
  31.