e08ff458275c04b622a53dac857ff0ba06059d7b
[ker1415-1.git] / report / ass1.tex
1 \subsection{Part 1: Modelling Sokoban}
2 \subsubsection{Task 1: Knowledge base}
3 \begin{itemize}
4 \item{Q1}\\
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.
9 \item{Q2}\\
10 We use the functions $agent(X, S_i), crate(cratename, X, S_i)$ and
11 $target(cratename, X)$ to easily represent the information.
12 \item{Q3}\\
13 \item{Q4}\\
14
15 \end{itemize}
16
17 \subsubsection{Task 2: Actions}
18 \begin{itemize}
19 \item{Q5}\\
20 \begin{equation}
21 \begin{split}
22 Poss(move(x, y), s) \equiv &\\
23 & (\exists z: connected(x, y, z)) \wedge\\
24 & \neg(crate(x, y, s)) \wedge
25 \end{split}
26 \end{equation}
27
28 \item{Q6}\\
29 $Poss(push(x, y), s) \equiv\\
30 agent(x, s) \wedge\\
31 (\exists z:
32 connected(x, z, y) \wedge
33 (\exists \gamma: crate(\gamma, z, s))
34 \wedge\\
35 (\exists \alpha:
36 connected(z, \alpha, y) \wedge
37 \neg (\exists \beta: crate(\beta, \alpha, s))))$
38 \item{Q7}\\
39 $agent(x, result(z, s)) \rightarrow\\
40 (\exists y: z = move(y, x)) \vee\\
41 (\exists \alpha:
42 z = push(\beta, \alpha) \wedge
43 connected(\beta, x, \alpha)) \vee\\
44 (\exists \epsilon, \gamma:
45 not(z = move(x, \epsilon)) \wedge
46 not(z = push(x, \gamma)) \wedge
47 agent(x, s))\\
48 crate(x, y, result(A, s)) \rightarrow\\
49 (\exists z,alpha:
50 A = push(z, \alpha),
51 (\exists \beta:
52 connected(z, \beta, \alpha),
53 connected(\beta, y, \alpha),
54 crate(x, \beta, s)
55 )
56 ) \vee\\
57 (\exists z,\alpha:
58 not(A = push(z, \alpha)),
59 connected(z, y, \alpha),
60 crate(x, y, s)
61 )
62 $
63 \end{itemize}
64
65 \subsection{Part 2: Implementation}
66 \subsubsection{Task 3: Translate Axioms}
67 The only optimization added to the file is the reverse move optimization,
68 disallowing the agent to reverse a move immediatly.
69 \inputminted{prolog}{./src/domaintask1.pl}
70
71 \subsubsection{Task 4: The Planning Problem in Figure 1}
72 \inputminted{prolog}{./src/instancetask4.pl}
73
74 \subsubsection{Task 5: Crates go to Any Goal Location}
75 \inputminted{prolog}{./src/instancetask5.pl}
76
77 \subsubsection{Task 6: Inverse Problem}
78
79 \subsection{Part 3: Extending the domain}
80
81 \subsection{Evaluation}
82 \begin{itemize}
83 \item{How much time did it take?}\\
84 p1t1: 45m
85 \item{What would you like to see changed?}\\
86 p1t1: There is an ambiguity in p1t1Q3, it's not clear if the starred
87 locations should be included in the initial state(therefore not only in
88 the goal state).\\
89 \end{itemize}