+SHELL:=/bin/bash
+
all:
pdflatex -shell-escape report.tex
pdflatex -shell-escape report.tex
clean:
- rm -vf *.aux *.log *.pdf *.toc *.pyg *.out
+ rm -vf *.{aux,log,pdf,toc,pyg,out}
--- /dev/null
+\newpage
+\subsection{Assignment 1-1}
+Assignment 1 took us the entire running of the assignment minus one week. The
+assignments setup told us to first make the situation calculus and then
+implement it. However our first attempt for the situation calculus wasn't
+correct so we had to rewrite that entire section after hacking in prolog to make
+it work.
+
+\subsection{Assignment 1-2}
+Assignment 2 took us a week, it was much more difficult our knowledge of prolog
+was increased significantly so we weren't stopped by trivial prolog problems and
+could work on it much more efficiently.
+
+\subsection{General remarks}
+In our opinion the amount of information provided about the hittingset
+algorithm and situation calculus is out of proportion concidering the very
+important part it plays. For example situation calculus barely gets one page in
+the reader and hitting set is also very sparsely described.
--- /dev/null
+\begin{listing}[H]
+ \caption{Domain description task 1}
+ \label{domaintasktask1}
+ \prologcode{./src/domaintask1.pl}
+\end{listing}
+\begin{listing}[H]
+ \caption{Instance description task 4}
+ \label{instancetask4}
+ \prologcode{./src/instancetask4.pl}
+\end{listing}
+\begin{listing}[H]
+ \caption{Instance description task 5}
+ \label{instancetask5}
+ \prologcode{./src/instancetask5.pl}
+\end{listing}
+\begin{listing}[H]
+ \caption{Instance description task 6}
+ \label{instancetask6}
+ \prologcode{./src/instancetask6.pl}
+\end{listing}
+\begin{listing}[H]
+ \caption{Domain description task 6}
+ \label{domaintask6}
+ \prologcode{./src/domaintask6.pl}
+\end{listing}
+\begin{listing}[H]
+ \caption{Instance description task 7}
+ \label{instancetask7}
+ \prologcode{./src/instancetask7.pl}
+\end{listing}
+\begin{listing}[H]
+ \caption{Domain description task 7}
+ \label{domaintask7}
+ \prologcode{./src/domaintask7.pl}
+\end{listing}
\newpage
\subsection{Part 2: Implementation}
\subsubsection{Task 3: Translate Axioms}
-The only optimization added to the file is the reverse move optimization,
-disallowing the agent to reverse a move immediatly.
-\begin{listing}[H]
- \caption{Domain description task 1}
- \prologcode{./src/domaintask1.pl}
-\end{listing}
+The domain description can be found in \textit{./src/domaintask1.pl} and in
+Listing~\ref{domaintask1} and is a literal translation from logics to prolog
+code except for the visited predicate. The visited predicate disallows the
+agent to reverse it's previous move immediatly. This makes the planning much
+faster because it can cut of a lot of branches.
\subsubsection{Task 4: The Planning Problem in Figure 1}
-\begin{listing}[H]
- \caption{Instance description task 4}
- \prologcode{./src/instancetask4.pl}
-\end{listing}
+The instance description for this task can be found in
+\textit{./src/instancetask4.pl} and in Listing~\ref{instancetask4}. This is a
+literal translation of the description in logics. The goal location for the
+crates are hardcoded to increase the performance.
\subsubsection{Task 5: Crates go to Any Goal Location}
-\begin{listing}[H]
- \caption{Instance description task 5}
- \prologcode{./src/instancetask5.pl}
-\end{listing}
+The instance description for this task can be found in
+\textit{./src/instancetask5.pl} and in Listing~\ref{instancetask5}. This is an
+adaptation of Listing~\ref{instancetask4} in the sense that in the goal state
+the same goal locations for the crates apply but the crate instance does not
+matter any more. Any combination of crates on the locations will be a valid
+goal.
\subsubsection{Task 6: Inverse Problem}
-\begin{listing}[H]
- \caption{Instance description task 6}
- \prologcode{./src/instancetask6.pl}
-\end{listing}
-\begin{listing}[H]
- \caption{Domain description task 6}
- \prologcode{./src/domaintask6.pl}
-\end{listing}
+For tackling the inverse problem we have added a visited predicate that
+describes if the agent has visited that particular location. In the instance
+description found in \textit{./src/instancetask6.pl} or in
+Listing~\ref{instancetask6} we made sure to mark the starting location for the
+agent as visited because the agent does not have to revisit the starting
+location. The goal is a simple forall that will only satisfy if for all
+locations known the visited fluent is true. To generate all locations we used
+the fact that all locations are connected to some other location. This could be
+implemented more efficiently because in the current situation the locations
+sequence contains a lot of duplicate locations. We reused the domain
+description from task 4 with the visited fluent and adapted it slightly so that
+it is never unset and therefore records all locations the agent has been. The
+full ode can be found in \textit{./src/domaintask6.pl} or in
+Listing~\ref{domaintask6}.
\newpage
\subsection{Part 3: Extending the domain}
\subsubsection{Task 7: Unlocking the Crates}
-\begin{listing}[H]
- \caption{Instance description task 7}
- \prologcode{./src/instancetask7.pl}
-\end{listing}
-\begin{listing}[H]
- \caption{Domain description task 7}
- \prologcode{./src/domaintask7.pl}
-\end{listing}
+For adding keys we have added in the instance definition, found in
+\textit{./src/instancetask7.pl} or Listing~\ref{instancetask7}, new key fluents
+that define were the keys are found. We also changed the crate fluent to arity
+$4$ so that it also has a key attached to it. In the domain specification,
+found in \textit{./src/domaintask7.pl} or Listing~\ref{domaintask7}, we added a
+pickup move that allows the agent to pickup a certain key. When the agent picks
+up a key the keyinbag fluent is then set so that the possibility function for
+the push action can incorporate the fact that a key has to be picked up to push
+a certain crate.
\newpage
\subsection{Part 4: General questions}
\begin{listing}[H]
\caption{Code for generating a minimal hitting sets}
\prologcode{./src/task14part2.pl}
-\end{listing}
\ No newline at end of file
+\end{listing}
\section{Assignment 1-2}
\input{ass2.tex}
+\section{Additions}
+\input{additions.tex}
+
+\section{Appendices}
+\input{appendix.tex}
+
\end{document}
:- [domaintask4].
% --- Definition of the initial state ---------------------------------
-% north and east
connected(loc11, loc21, east).
connected(loc11, loc12, north).
connected(loc12, loc22, east).
connected(loc31, loc32, north).
connected(loc32, loc33, north).
-% The other way around, west and south
connected(loc21, loc11, west).
connected(loc12, loc11, south).
connected(loc22, loc12, west).
:- [domaintask5].
% --- Definition of the initial state ---------------------------------
-% north and east
connected(loc11, loc21, east).
connected(loc11, loc12, north).
connected(loc12, loc22, east).
connected(loc31, loc32, north).
connected(loc32, loc33, north).
-% The other way around, west and south
connected(loc21, loc11, west).
connected(loc12, loc11, south).
connected(loc22, loc12, west).
crate(crateb, loc22, s0).
crate(cratea, loc23, s0).
-target(loc12).
-target(loc13).
-target(loc11).
-
agent(loc32, s0).
% --- Goal condition that the planner will try to reach ---------------
:- [domaintask6].
% --- Definition of the initial state ---------------------------------
-% north and east
connected(loc11, loc21, east).
connected(loc11, loc12, north).
connected(loc12, loc22, east).
connected(loc31, loc32, north).
connected(loc32, loc33, north).
-% The other way around, west and south
connected(loc21, loc11, west).
connected(loc12, loc11, south).
connected(loc22, loc12, west).