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{array
}{llllll
}
14 connected(loc11, loc21, east) &
\wedge &
15 connected(loc11, loc12, north) &
\wedge &
16 connected(loc12, loc22, east) &
\wedge\\
17 connected(loc12, loc13, north) &
\wedge &
18 connected(loc13, loc23, east) &
\wedge &
19 connected(loc13, loc14, north) &
\wedge\\
20 connected(loc14, loc24, east) &
\wedge &
21 connected(loc21, loc31, east) &
\wedge &
22 connected(loc21, loc22, north) &
\wedge\\
23 connected(loc22, loc32, east) &
\wedge &
24 connected(loc22, loc23, north) &
\wedge &
25 connected(loc23, loc33, east) &
\wedge\\
26 connected(loc23, loc24, north) &
\wedge &
27 connected(loc31, loc32, north) &
\wedge &
28 connected(loc32, loc33, north) &
\wedge\\
29 connected(loc21, loc11, west) &
\wedge &
30 connected(loc12, loc11, south) &
\wedge &
31 connected(loc22, loc12, west) &
\wedge\\
32 connected(loc13, loc12, south) &
\wedge &
33 connected(loc23, loc13, west) &
\wedge &
34 connected(loc14, loc13, south) &
\wedge\\
35 connected(loc24, loc14, west) &
\wedge &
36 connected(loc31, loc21, west) &
\wedge &
37 connected(loc22, loc21, south) &
\wedge\\
38 connected(loc32, loc22, west) &
\wedge &
39 connected(loc23, loc22, south) &
\wedge &
40 connected(loc33, loc23, west) &
\wedge\\
41 connected(loc24, loc23, south) &
\wedge &
42 connected(loc32, loc31, south) &
\wedge &
43 connected(loc33, loc32, south) &
\wedge\\
44 crate(cratec, loc21, s0) &
\wedge &
45 crate(crateb, loc22, s0) &
\wedge &
46 crate(cratea, loc23, s0) &
\wedge\\
47 target(cratea, loc12) &
\wedge &
48 target(crateb, loc13) &
\wedge &
49 target(cratec, loc11) &
\wedge\\
50 agent(loc32, s0) &
\wedge\\
54 crate(cratea, loc12, s)
\wedge
55 crate(crateb, loc13, s)
\wedge
56 crate(cratec, loc11, s)$
59 \subsubsection{Task
2: Actions
}
63 Poss(move(x, y), s) &
\equiv \\
64 & (
\exists z: connected(x, y, z))
\wedge\\
65 &
\neg(crate(x, y, s))
69 Poss(push(x, y), s) &
\equiv\\
70 & agent(x, s)
\wedge\\
72 connected(x, z, y)
\wedge
73 (
\exists \gamma: crate(
\gamma, z, s))
76 connected(z,
\alpha, y)
\wedge
77 (
\nexists \beta: crate(
\beta,
\alpha, s))
83 agent(x, result(z, s)) &
\rightarrow\\
84 & (
\exists y: z = move(y, x))
\vee\\
86 z = push(
\beta,
\alpha)
\wedge
87 connected(
\beta, x,
\alpha))
\vee\\
88 & (
\exists \epsilon,
\gamma:
89 z
\neq move(x,
\epsilon)
\wedge
90 z
\neq push(x,
\gamma)
\wedge
92 crate(x, y, result(A, s)) &
\rightarrow\\
96 connected(z,
\beta,
\alpha),
97 connected(
\beta, y,
\alpha),
102 A
\neq push(z,
\alpha)
\wedge
103 connected(z, y,
\alpha)
\wedge
109 \subsection{Part
2: Implementation
}
110 \subsubsection{Task
3: Translate Axioms
}
111 The only optimization added to the file is the reverse move optimization,
112 disallowing the agent to reverse a move immediatly.
114 \caption{Domain description task
1}
115 \prologcode{./src/domaintask1.pl
}
118 \subsubsection{Task
4: The Planning Problem in Figure
1}
120 \caption{Instance description task
4}
121 \prologcode{./src/instancetask4.pl
}
124 \subsubsection{Task
5: Crates go to Any Goal Location
}
126 \caption{Instance description task
5}
127 \prologcode{./src/instancetask5.pl
}
130 \subsubsection{Task
6: Inverse Problem
}
132 \subsection{Part
3: Extending the domain
}
133 \subsubsection{Task
7: Unlocking the Crates
}
135 \caption{Instance description task
7}
136 \prologcode{./src/instancetask7.pl
}
139 \caption{Domain description task
7}
140 \prologcode{./src/domaintask7.pl
}
143 \subsection{Part
4: General questions
}
144 \subsubsection{Task
10: Sitcalc expressivity
}
145 Situation calculus(sitcalc from now on) is very expressive because you can
146 express yourself very detailed without encountering the frame problem. When the
147 problem space expands the computational strength needed explodes. Sitcalc is
148 therefore not very usefull when you want to plan far behind. For comparison,
149 calculating a sokoban path
10 steps in the future already takes hours on a
152 The model is easy to extend to bigger and more complex problems, it doesn't
153 scale that well however...
155 \subsubsection{Task
11: Related work
}
156 Zhou, N. (
2013). A Tabled Prolog Program for Solving Sokoban,
124,
561–
575. doi:
10.3233/FI-
2013-
849