update'
[ker1415-1.git] / report / src / domaintask5.pl
index cdbcfe6..f99e05a 100644 (file)
@@ -10,7 +10,9 @@ primitive_action(push(_, _)).
 poss(move(From, To), S) :-
        agent(From, S),
        connected(From, To, _),
-       not(crate(_, To, S)).
+       not(crate(_, To, S)),
+       not(visited(To, S)).
+
 poss(push(From, Direction), S) :-
        agent(From, S),
        connected(From, CrateLocation, Direction),
@@ -19,6 +21,9 @@ poss(push(From, Direction), S) :-
        not(crate(_, CrateTarget, S)).
 
 % --- Successor state axioms ------------------------------------------
+visited(Plek, result(A, _)) :-
+       A = move(Plek, _).
+
 agent(AgentPlek, result(A, S)) :-
        A = move(_, AgentPlek);
        A = push(OudeAgentPlek, Richting),