a4955336fa5608d9250975bad4b3ff321a475135
[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 \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),
21
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),
28
29 connected(loc3-1, loc3-2, north),
30 connected(loc3-2, loc3-3, north),
31
32 (connected(X, Y, east); \+connected(Y, X, west)),
33 (connected(X, Y, north); \+connected(Y, X, south)),
34
35 crate(crate-c, loc2-1, s),
36 crate(crate-b, loc2-2, s),
37 crate(crate-a, loc2-3, s),
38
39 target(crate-a, loc1-1),
40 target(crate-b, loc1-3),
41 target(crate-c, loc1-2),
42 agent(loc3-2, s).$
43 \end{lstlisting}
44 \item{Q4}\\
45 \begin{lstlisting}[language=prolog]
46 target(X, Y), crate(X, Y, s).
47 \end{lstlisting}
48 \end{itemize}
49
50 \subsubsection{Task 2: Actions}
51 \begin{itemize}
52 \item{Q5}\\
53 $Poss(move(x, y), s) \equiv \neg(crate(x, y, s)) \wedge connected(x, y, _)$
54 \item{Q6}\\
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))))$
58 \item{Q7}\\
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))$
63 \end{itemize}
64
65 \subsection{Part 2: Implementation}
66 \subsubsection{Task 3: Translate Axioms}
67 \lstinputlisting[title={domaintask1.pl},language=prolog]{./src/domaintask1.pl}
68
69 \subsubsection{Task 4: The Planning Problem in Figure 1}
70 \lstinputlisting[title={instancetask1.pl},language=prolog]{./src/instancetask1.pl}
71
72 \subsubsection{Task 5: Crates go to Any Goal Location}
73 \subsubsection{Task 6: Inverse Problem}
74
75 \subsection{Part 3: Extending the domain}
76
77 \subsection{Evaluation}
78 \begin{itemize}
79 \item{How much time did it take?}\\
80 p1t1: 45m
81 \item{What would you like to see changed?}\\
82 p1t1: There is an ambiguity in p1t1Q3, it's not clear if the starred
83 locations should be included in the initial state(therefore not only in
84 the goal state).\\
85 \end{itemize}