courses:knowledge_representation_and_artificial_intelligence_systems:lab4

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
courses:knowledge_representation_and_artificial_intelligence_systems:lab4 [2019/07/24 12:16]
andrey.suchkov
courses:knowledge_representation_and_artificial_intelligence_systems:lab4 [2019/09/03 06:02]
andrey.suchkov [Общие сведения]
Line 17: Line 17:
   (slot peasant-location (type SYMBOL) (allowed-symbols shore-1 shore-2))   (slot peasant-location (type SYMBOL) (allowed-symbols shore-1 shore-2))
   (slot wolf-location (type SYMBOL) (allowed-symbols shore-1 shore-2))   (slot wolf-location (type SYMBOL) (allowed-symbols shore-1 shore-2))
-  ​(slot goat-locatio ​(type SYMBOL) (allowed-symbols shore-1 shore-2))+  (slot goat-location ​(type SYMBOL) (allowed-symbols shore-1 shore-2))
   (slot cabbage-location (type SYMBOL) (allowed-symbols shore-1 shore-2))   (slot cabbage-location (type SYMBOL) (allowed-symbols shore-1 shore-2))
   (slot parent (type FACT-ADDRESS SYMBOL) (allowed-symbols no-parent))   (slot parent (type FACT-ADDRESS SYMBOL) (allowed-symbols no-parent))
Line 26: Line 26:
 <​code>​ <​code>​
 (deffacts initial-positions (deffacts initial-positions
-  (status ​ +  (status (search-depth 1) 
-    ​(search-depth 1) +          (parent no-parent) 
-    (parent no-parent) +          (peasant-location shore-1) 
-    (peasant-location shore-1) +          (wolf-location shore-1) 
-    (wolf-location shore-1) +          (goat-location shore-1) 
-    (goat-location shore-1) +          (cabbage-location shore-1) 
-    (cabbage-location shore-1) +          (last-move no-move)))
-    (last-move no-move)))+
 </​code>​ </​code>​
 === Операторы перехода в пространстве состояний === === Операторы перехода в пространстве состояний ===
Line 149: Line 148:
        else (printout t "​Peasant moves with " ?thing " to " ?shore "​."​ t))        else (printout t "​Peasant moves with " ?thing " to " ?shore "​."​ t))
     (if (eq ?shore shore-1) ​        ; Если ?shore = shore-1     (if (eq ?shore shore-1) ​        ; Если ?shore = shore-1
-       then (bind ?shore shore-2) ​  ;?​shore = shore-2 +       then (bind ?shore shore-2) ​  ; ?shore = shore-2 
-       else (bind ?shore shore-1)) ​ ;?shore = shore-1+       else (bind ?shore shore-1)) ​ ; ?shore = shore-1
     (bind ?i (+ 1 ?​i)))) ​ ; ?i = ?i + 1     (bind ?i (+ 1 ?​i)))) ​ ; ?i = ?i + 1
 </​code>​ </​code>​
courses/knowledge_representation_and_artificial_intelligence_systems/lab4.txt · Last modified: 2022/12/10 09:08 (external edit)