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

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