home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d5xx / d524 / kamin.lha / Kamin / P-Distr.lzh / code1.pro < prev    next >
Text File  |  1988-11-18  |  4KB  |  119 lines

  1. ; Section 8.1
  2. (infer (different yellow blue))
  3. (infer (different yellow red))
  4. (infer (different blue yellow))
  5. (infer (different blue red))
  6. (infer (different red yellow))
  7. (infer (different red blue))
  8. ;
  9. (infer (mapb-coloring A B C D E F)
  10.      from (different A B) (different A C) (different A D) (different A F)
  11.        (different B C) (different B E) (different C E) (different C D)
  12.        (different D E) (different E F))
  13. (infer?  (mapb-coloring A B C D E F))
  14. (infer? (print))
  15. (infer?  (mapb-coloring A B C D E F) (print A B C D E F))
  16. (infer? (print yellow blue red blue yellow blue))
  17. ;
  18. (infer (member X (cons X L)))
  19. (infer (member X (cons Y M)) from (member X M))
  20. (infer?  (member 3 (cons 2 (cons 3 nil))))
  21. (infer? (print))
  22. (infer?  (member 3 (cons 2 (cons 4 nil))))
  23. (infer? fail)
  24. ; Section 8.2.2
  25. (infer imokay from youreokay hesokay)
  26. (infer youreokay from theyreokay)
  27. (infer hesokay)
  28. (infer theyreokay)
  29. (infer?  imokay)
  30. (infer? (print))
  31. (infer hesnotokay from imnotokay)
  32. (infer shesokay from hesnotokay)
  33. (infer shesokay from theyreokay)
  34. (infer?  shesokay)
  35. (infer? (print))
  36. (infer hesnotokay from shesokay)
  37. (infer hesnotokay from imokay)
  38. ; section 8.2.3
  39. (infer (addtoend nil X (cons X nil)))
  40. (infer (addtoend (cons Y L) X (cons Y M)) from (addtoend L X M))
  41. (infer?  (addtoend (cons 3 nil) 4 L) (print L))
  42. (infer? (print (cons 3 (cons 4 nil))))
  43. (infer?  (addtoend L 4 (cons 3 (cons 4 nil))) (print L))
  44. (infer? (print (cons 3 nil)))
  45. ;
  46. (infer (reverse nil nil))
  47. (infer (reverse (cons X L) M) from (reverse L N) (addtoend N X M))
  48. (infer?  (reverse (cons 1 (cons 2 nil)) L) (print L))
  49. (infer? (print (cons 2 (cons 1 nil))))
  50. (infer?  (reverse L (cons 1 (cons 2 nil))) (print L))
  51. (infer? (print (cons 2 (cons 1 nil))))
  52. ;
  53. (infer (append nil L L))
  54. (infer (append (cons X L) M (cons X N)) from (append L M N))
  55. (infer? (append nil (cons 3 nil) L) (print L))
  56. (infer? (print (cons 3 nil)))
  57. (infer? (append (cons 3 (cons 4 nil)) (cons 5 (cons 6 nil)) L)
  58.        (print L))
  59. (infer? (print (cons 3 (cons 4 (cons 5 (cons 6 nil))))))
  60. (infer? (append L (cons 6 (cons 7 nil)) (cons 5 (cons 6 (cons 7 nil))))
  61.        (print L))
  62. (infer? (print (cons 5 nil)))
  63. ;
  64. (infer (member X L) from (append L1 (cons X L2) L)).
  65. (infer (lookup K A L) from (member (pair K A) L))
  66. (infer (capitols (cons (pair chile santiago) (cons (pair peru lima) nil))))
  67. (infer?  (capitols C) (lookup peru Capitol C) (print Capitol))
  68. (infer? (print lima))
  69. ;
  70. (infer (mult 0 Y 0))
  71. (infer (mult X Y Z) from (minus X 1 V) (mult V Y W) (plus W Y Z))
  72. (infer?  (mult 3 5 X) (print X))
  73. (infer? (print 15))
  74. (infer (mult X Y Z) from (minus X 1 V) (plus W Y Z) (mult V Y W)).
  75. (infer (fac 0 1))
  76. (infer (fac N R) from (minus N 1 N1) (fac N1 R1) (mult R1 N R))
  77. (infer (naive-sort L M) from (permutation L M) (ordered M)).
  78. (infer (<= X X))
  79. (infer (<= X Y) from (less X Y))
  80. ;
  81. (infer (ordered nil))
  82. (infer (ordered (cons A nil)))
  83. (infer (ordered (cons A (cons B L))) from (<= A B) (ordered (cons B L)))
  84. ;
  85. (infer (permutation nil nil))
  86. (infer (permutation L (cons H T))
  87.       from (append V (cons H U) L) (append V U W) (permutation W T))
  88. ;
  89. (infer (naive-sort L M) from (permutation L M) (ordered M)).
  90. (infer?  (naive-sort (cons 4 (cons 2 (cons 3 nil))) L) (print L))
  91. (infer? (print (cons 2 (cons 3 (cons 4 nil)))))
  92. ;
  93. (infer (partition H (cons A X) (cons A Y) Z) from (<= A H) (partition H X Y Z))
  94. (infer (partition H (cons A X) Y (cons A Z)) from (less H A) (partition H X Y Z))
  95. (infer (partition H nil nil nil))
  96. ;
  97. (infer (quicksort nil nil))
  98. (infer (quicksort (cons H T) S)
  99.       from
  100.       (partition H T A B)
  101.              (quicksort A A1)
  102.              (quicksort B B1)
  103.              (append A1 (cons H B1) S))
  104. (infer?  (quicksort (cons 8 (cons 2 (cons 3 (cons 7 (cons 1 nil))))) S)
  105.               (print S))
  106. (infer? (print (cons 1 (cons 2 (cons 3 (cons 7 (cons 8 nil)))))))
  107. ;
  108. (infer (simplify (diff X X) nil))
  109. (infer (simplify (diff (cons X Y) Z) (cons X W)) from (simplify (diff Y Z) W))
  110. (infer?  (simplify (diff (cons 3 (cons 4 X)) X) L) (print L))
  111. (infer? (print (cons 3 (cons 4 nil))))
  112. (infer?  (simplify L (cons 3 (cons 4 nil))) (print L))
  113. (infer? (print (diff (cons 3 (cons 4 Z1)) Z1)))
  114. (infer (diffappend (diff L X) (diff X Y) (diff L Y))).
  115. (infer?  (diffappend (diff (cons 3 X) X) (diff (cons 4 Y) Y) Z)
  116.         (print Z))
  117. (infer? (print (diff (cons 3 (cons 4 Y)) Y)))
  118. quit
  119.