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

  1. import("structures","io") ?
  2.  
  3. non_strict(test)?
  4. test(X) :- writeln("testing: ",X),writeln("       ",evalin(X)),fail.
  5.  
  6. toto <| tata.
  7.  
  8. test(tata +>= toto) ?                 %% simple matching
  9. test(toto +>= tata) ?               
  10. test((A,B) +>= (C,C)) ?               %% coreference
  11. test((C,C) +>= (A,B)) ?
  12. test([A|B] +>= [C,C]) ?               %% lists
  13. test([C|C] +>= [A|B]) ?              
  14. test(foo(a,s,d) +>= foo(a,s,d,@)) ?   %% features
  15. test(foo(a,s,d,@) +>= foo(a,s,d)) ?
  16.  
  17. test(tata +> toto) ?                 %% simple matching
  18. test(toto +> tata) ?               
  19. test((A,B) +> (C,C)) ?               %% coreference
  20. test((C,C) +> (A,B)) ?
  21. test([A|B] +> [C|C]) ?               %% lists
  22. test([C|C] +> [A|B]) ?              
  23. test(foo(a,s,d) +> foo(a,s,d,@)) ?   %% features
  24. test(foo(a,s,d,@) +> foo(a,s,d)) ?
  25.  
  26. test(tata == toto) ?                 %% simple matching
  27. test(toto == tata) ?               
  28. test((A,B) == (C,C)) ?               %% coreference
  29. test((C,C) == (A,B)) ?
  30. test([A|B] == [C,C]) ?               %% lists
  31. test([C|C] == [A|B]) ?              
  32. test(foo(a,s,d) == foo(a,s,d,@)) ?   %% features
  33. test(foo(a,s,d,@) == foo(a,s,d)) ?
  34.  
  35.  
  36. X = big(tom(hair => knotted,
  37.         hands => clumsy,
  38.         brain => slow_witted,
  39.     favorite_exclamation => 'arghh!!',
  40.         friend => {john(face => spotty,
  41.                         teeth => yellow);
  42.                    jeremy(skin => black_and_blue,
  43.                           known_letters => [a,b,c,y,t,w,i,o],
  44.                           brain => hurts);
  45.                    martha(brain => plank(number => 2,
  46.                                          length => short),
  47.                           beauty => gorgon_like)},
  48.         nose => long(warts => red,
  49.                      spots => ugly),
  50.         mother => witch,
  51.         father => tax_collector)),
  52. Y = copy_term(X),
  53. test(X == Y) ?
  54.  
  55. test(tata +=< toto) ?                 %% simple matching
  56. test(toto +=< tata) ?               
  57. test((A,B) +=< (C,C)) ?               %% coreference
  58. test((C,C) +=< (A,B)) ?
  59. test([A|B] +=< [C,C]) ?               %% lists
  60. test([C|C] +=< [A|B]) ?              
  61. test(foo(a,s,d) +=< foo(a,s,d,@)) ?   %% features
  62. test(foo(a,s,d,@) +=< foo(a,s,d)) ?
  63.  
  64.  
  65. test(tata +< toto) ?                 %% simple matching
  66. test(toto +< tata) ?               
  67. test((A,B) +< (C,C)) ?               %% coreference
  68. test((C,C) +< (A,B)) ?
  69. test([A|B] +< [C,C]) ?               %% lists
  70. test([C|C] +< [A|B]) ?              
  71. test(foo(a,s,d) +< foo(a,s,d,@)) ?   %% features
  72. test(foo(a,s,d,@) +< foo(a,s,d)) ?
  73.  
  74. test(tata +>< toto) ?                 %% simple matching
  75. test(toto +>< tata) ?               
  76. test((A,B) +>< (C,C)) ?               %% coreference
  77. test((C,C) +>< (A,B)) ?
  78. test([A|B] +>< [C,C]) ?               %% lists
  79. test([C|C] +>< [A|B]) ?              
  80. test(foo(a,s,d) +>< foo(a,s,d,@)) ?   %% features
  81. test(foo(a,s,d,@) +>< foo(a,s,d)) ?
  82.  
  83. X = big(tom(hair => knotted,
  84.         hands => clumsy,
  85.         brain => slow_witted,
  86.     favorite_exclamation => 'arghh!!',
  87.         friend => {john(face => spotty,
  88.                         teeth => yellow);
  89.                    jeremy(skin => black_and_blue,
  90.                           known_letters => [a,b,c,y,t,w,i,o],
  91.                           brain => hurts);
  92.                    martha(brain => plank(number => 2,
  93.                                          length => short),
  94.                           beauty => gorgon_like)},
  95.         nose => long(warts => red,
  96.                      spots => ugly),
  97.         mother => witch,
  98.         father => tax_collector)),
  99. Y = copy_term(X),
  100. test(X \== Y) ?
  101.  
  102.  
  103. ab <| a.
  104. ab <| b.
  105. ac <| a.
  106. ac <| c.
  107. bc <| a.
  108. bc <| c.
  109.  
  110. test( f(b,c) +>< f(X,X) ) ?
  111.  
  112.