home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / lifeos2.zip / LIFE-1.02 / TESTS / LF / ASSERT2.LF < prev    next >
Text File  |  1996-06-04  |  467b  |  32 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. gc?
  18.  
  19. test_f     :-     A=f(B),
  20.         B={1;2;3;4},
  21.         write(A),
  22.         write(B),nl,
  23.         listing(f),nl,
  24.         retract((f(2) ->C)),
  25.         assert((f(4) -> 'Forth result---')).
  26.  
  27.  
  28.  
  29. dynamic(p)?
  30. dynamic(f)?
  31.  
  32.