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

  1. ; Section 8.4 - Note that two versions of transform are given.
  2. ; This file can only be run if one of these is commented out.
  3. ; Currently, the first, and less efficient, version is commented out.
  4. (infer (member X (cons X L)))
  5. (infer (member X (cons Y M)) from (member X M))
  6. ;
  7. (infer (block a))
  8. (infer (block b))
  9. (infer (block c))
  10. ;
  11. (infer (different a b))
  12. (infer (different a c))
  13. (infer (different b a))
  14. (infer (different b c))
  15. (infer (different c a))
  16. (infer (different c b))
  17. (infer (different X table) from (block X))
  18. (infer (different table Y) from (block Y))
  19. ;
  20. (infer (clear X nil))
  21. (infer (clear X (cons (on B Y) State))
  22.       from (different X Y) (clear X State))
  23. ;
  24. (infer (on X Y State) from (member (on X Y) State))
  25. ;
  26. (infer (update (move X Y Z) (cons (on X Y) S) (cons (on X Z) S)))
  27. (infer (update (move X Y Z) (cons (on U V) S1) (cons (on U V) S2))
  28.       from (different X U) (update (move X Y Z) S1 S2))
  29. ;
  30. (infer (legal-move (move B P1 table) State)
  31.       from
  32.              (on B P1 State)
  33.              (different P1 table)
  34.              (clear B State))
  35. (infer (legal-move (move B1 P B2) State)
  36.       from
  37.              (block B2)
  38.              (on B1 P State)
  39.              (different P B2)
  40.              (different B1 B2)
  41.              (clear B1 State)
  42.              (clear B2 State))
  43. ;
  44. (infer (different (cons (on A X) State1) (cons (on A Y) State2))
  45.       from (different X Y))
  46. (infer (different (cons (on A X) State1) (cons (on A X) State2))
  47.       from (different State1 State2))
  48. ;
  49. (infer (not-member X nil))
  50. (infer (not-member X (cons Y L))
  51.       from (different X Y) (not-member X L))
  52. ;
  53. ;(infer (transform State1 State2 Plan)
  54. ;      from (transform State1 State2 (cons State1 nil) Plan))
  55. ;;
  56. ;(infer (transform State State Visited nil))
  57. ;(infer (transform State1 State2 Visited (cons Move Moves))
  58. ;      from
  59. ;            (legal-move Move State1)
  60. ;             (update Move State1 State)
  61. ;             (not-member State Visited)
  62. ;             (transform State State2 (cons State Visited) Moves))
  63. ;;
  64. ;(infer (state1 (cons (on a b) (cons (on b table) (cons (on c a) nil)))))
  65. ;(infer (state2 (cons (on a b) (cons (on b c) (cons (on c table) nil)))))
  66. ;(infer? (state1 S1) (state2 S2) (transform S1 S2 Plan)
  67. ;              (print Plan))
  68. ;(infer? (print (cons (move c a table)
  69. ;   (cons (move a b table) (cons (move b table a)
  70. ;   (cons (move b a c) (cons (move a table b) nil)))))))
  71. ;
  72. (infer (transform State1 State2 Plan)
  73.       from (transform State1 State2 (cons State1 nil) Plan))
  74. ;
  75. (infer (transform State State Visited nil))
  76. (infer (transform State1 State2 Visited (cons Move Moves))
  77.       from
  78.              (choose-move Move State1 State2)
  79.              (update Move State1 State)
  80.              (not-member State Visited)
  81.              (transform State State2 (cons State Visited) Moves))
  82. ;
  83. (infer (choose-move Move State1 State2)
  84.       from (suggest Move State2) (legal-move Move State1))
  85. (infer (choose-move Move State1 State2)
  86.       from (legal-move Move State1))
  87. (infer (suggest (move X Y Z) State)
  88.       from (member (on X Z) State))
  89. (infer (state1 (cons (on a b) (cons (on b table) (cons (on c a) nil)))))
  90. (infer (state2 (cons (on a b) (cons (on b c) (cons (on c table) nil)))))
  91. (infer? (state1 S1) (state2 S2) (transform S1 S2 Plan)
  92.               (print Plan))
  93. (infer? (print (cons (move c a table) (cons (move a b table) (cons (move b table c)
  94.    (cons (move a table b) nil))))))
  95. quit
  96.