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

  1. term(p(a,b,c,1,2,3)).
  2. term(p(X:a,X,c,4,5,6)).
  3. term(P:p(a(7),b(8),P)).
  4. term(ouch(int,real,string,cons,nil)).
  5. term(ouch(1,2.4,"abc",[a,b],[])).
  6. term(p(a=>1,b=>2,c=>3)).
  7. term(p(a=>a,b=>b,c=>c)).
  8. term(p([1,2,3])).
  9.  
  10.  
  11. test(A,B) :-
  12.     nl,nl,nl,
  13.     write("*** Substituting: ",A," with ",B," ***"),
  14.     nl,
  15.     term(X),write(X),nl,
  16.         (substitute(A,B,X),write(X),nl;
  17.      write(X),nl,nl),
  18.     fail.
  19.  
  20. test(a,b)?
  21. test(int,real)?
  22. test(int,string)?
  23. test(cons,joke)?
  24. test(nil,cons)?
  25. test(1,blah)?
  26.