1 \subsection{Part
1: Modelling Sokoban
}
2 \subsubsection{Task
1: Knowledge base
}
5 We describe the connections using the four main directional words,
6 namely: $north,south,east,west$. We only define the connection for the
7 $north$ and $east$ directions because we can infer the $south$ and
8 $west$ directions from it.
10 We use the functions $agent(X, S_i), crate(cratename, X, S_i)$ and
11 $target(cratename, X)$ to easily represent the information.
13 \begin{lstlisting
}[language=prolog
]
14 connected(loc1-
1, loc2-
1, north),
15 connected(loc1-
1, loc1-
2, east),
16 connected(loc1-
2, loc2-
2, north),
17 connected(loc1-
2, loc1-
3, east),
18 connected(loc1-
3, loc2-
3, north),
19 connected(loc1-
3, loc1-
4, east),
20 connected(loc1-
4, loc2-
4, north),
22 connected(loc2-
1, loc3-
1, north),
23 connected(loc2-
1, loc2-
2, east),
24 connected(loc2-
2, loc3-
2, north),
25 connected(loc2-
2, loc2-
3, east),
26 connected(loc2-
3, loc3-
3, north),
27 connected(loc2-
3, loc2-
4, east),
29 connected(loc3-
1, loc3-
2, north),
30 connected(loc3-
2, loc3-
3, north),
32 (connected(X, Y, east); \+connected(Y, X, west)),
33 (connected(X, Y, north); \+connected(Y, X, south)),
35 crate(crate-c, loc2-
1, s),
36 crate(crate-b, loc2-
2, s),
37 crate(crate-a, loc2-
3, s),
39 target(crate-a, loc1-
1),
40 target(crate-b, loc1-
3),
41 target(crate-c, loc1-
2),
45 \begin{lstlisting
}[language=prolog
]
46 target(X, Y), crate(X, Y, s).
50 \subsubsection{Task
2: Actions
}
53 $Poss(move(x, y), s)
\equiv \neg(crate(x, y, s))
\wedge connected(x, y, _)$
55 $Poss(push(x, d), s)
\equiv agent(x, s)
\wedge (
\exists c,z: crate(c, z, s)
56 \wedge connected(x, z, d)
\wedge (
\exists y: connected(z, y, d)
\wedge \neg
57 (
\exists a: crate(a, z, s))))$
59 $connected(x, y, d)
\rightarrow agent(y, do(move(x, y), s))\\
60 connected(x, y, d)
\rightarrow agent(y, do(push(x, d), s))\\
61 connected(x, y, d)
\wedge connected(y, z, d)
\rightarrow
62 crate(c, z, do(push(x, d), s))$
65 \subsection{Part
2: Implementation
}
67 \subsection{Evaluation
}
69 \item{How much time did it take?
}\\
71 \item{What would you like to see changed?
}\\
72 p1t1: There is an ambiguity in p1t1Q3, it's not clear if the starred
73 locations should be included in the initial state(therefore not only in