home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / lifeos2.zip / LIFE-1.02 / TESTS / LF / ASSERT3.LF < prev    next >
Text File  |  1996-06-04  |  465b  |  30 lines

  1. p(1)     :- write('Rule one: ').
  2. p(2)     :- write('Rule two: ').
  3. p(3)     :- write('Rule three: ').
  4.  
  5. test_p     :- p(A),
  6.     write(A),
  7.     nl,
  8.     listing(p),
  9.     nl,
  10.     retract(p(2) :- B),
  11.     assert((p(4)     :-     write('RULE TWO:: '))).
  12.  
  13. f(1)    -> 'First result---'.
  14. f(2)     -> 'Second result--'.
  15. f(3)     -> 'Third result---'.
  16.  
  17. test_f     :-     A=f(B),
  18.         B={1;2;3;4},
  19.         write(A),
  20.         write(B),nl,
  21.         listing(f),nl,
  22.         retract((f(2) ->C)),
  23.         assert((f(4) -> 'Forth result---')).
  24.  
  25.  
  26.  
  27. dynamic(p),gc?
  28. dynamic(f)?
  29.  
  30.