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

  1. %====================== storage/3             ===============================
  2. /* This program demonstrates the built-in predicate storage. */
  3.  
  4. DATABASE
  5.    fact(string)
  6.  
  7. PREDICATES
  8.   test
  9.   wstor(STRING)
  10.  
  11. CLAUSES
  12.   wstor(TXT):-
  13.     storage(Stack, Heap, Trail),
  14.     write(TXT,":\n"),
  15.     write("Stack size=", Stack, ", Heap size=",Heap, ", Trail size=", Trail),
  16.     readchar(_), nl.
  17.  
  18.   test:-wstor("After call of test"),fail.
  19.   test:-
  20.  /* You may need to add a path to PROLOG.ERR */ 
  21.         file_str("prolog.err", FILE),
  22.     wstor("After load of file to GSTACK"),
  23.     assert(fact(FILE)),
  24.     wstor("After assert of file"),
  25.     fail.
  26.   test:-wstor("After fail").
  27.  
  28. goal    makewindow(1, 7, 7, " STORAGE ", 0, 0, 20, 80),
  29.     wstor("Before call of test"),
  30.     test,
  31.     wstor("After return from test").
  32.