\documentclass{article}

\newcommand{\ang}[1]{#1^{\circ}}
\newcommand{\mywhile}{{\bf while} }
\newcommand{\myif}{{\bf if} }
\newcommand{\mythen}{{\bf then} }
\newcommand{\mydo}{{\bf do} }
\newcommand{\myreturn}{{\bf return} }
\newcommand{\myfor}{{\bf for} }
\newcommand{\myuntil}{{\bf until} }
\newcommand{\myelse}{{\bf else} }
\newcommand{\mynot}{{\bf not} }
\newcommand{\myand}{{\bf and} }
\newcommand{\myor}{{\bf or} }
\newcommand{\mytrue}{{\bf true} }
\newcommand{\myfalse}{{\bf false} }
\newcommand{\myprocedure}{{\bf procedure} }
\newcommand{\mygoal}{{\bf goal state} }
\newcommand{\mycur}{{\bf current state} }
\newcommand{\mysame}{{\bf same} }
\newcommand{\ingoal}{{\bf in\_goal\_state} }
\newcommand{\incur}{{\bf in\_current\_state} }
\newcommand{\ininit}{{\bf in\_initial\_state} }
\newcommand{\suchthat}{{\bf such that} }
\newcommand{\myassign}{$\leftarrow$ }
\newcommand{\distill}{{\sc Distill} }
\newcommand{\fixme}[1]{}


\title{Example Templates}
\author{Elly Zoe Winner and Manuela Veloso}

\begin{document}

\date{}

\maketitle

\begin{table}[htb]
\hrule
{\small
\noindent\begin{tabbing}
\=~~~~~~~~~~\=\=\+\kill
\end{tabbing}
\vspace{-0.5cm}
{\small
\begin{tabbing}
\=~~~~~~\=~~~~~~\=~~~~~~\=~~~~~~\=~~~~~~\=~~~~~~\=~~~~~~\=\+\kill
\mywhile ((\incur({\sf at(v?1:obj v?2:loc)}) \myor \\
\> \> \> \incur({\sf inside(v?1:obj v?4:rocket)})) \myand \\
\> \> (\ingoal({\sf at(v?1:obj v?3:loc)}) \myor \\
\> \> \> \ingoal({\sf inside(v?1:obj v?4:rocket)}))) \mydo \\
\> \myif (\incur({\sf at(?1:obj ?2:loc)}) \myand \\
\> \> \> \incur({\sf at(?4:rocket ?5:loc)})) \mythen \\
\> \> {\sf move(?4:rocket ?5:loc ?2:loc)}\\
%\> {\sf load(?1:obj ?4:rocket ?2:loc)}\\
\> \mywhile (\incur({\sf at(v?6:obj ?2:loc)}) \myand \\
\> \> \> \incur({\sf at(?4:rocket ?2:loc)}) \myand \\
\> \> \> (\ingoal({\sf at(v?6:obj v?7:loc)}) \myor \\
\> \> \> \> \ingoal({\sf inside(v?6:obj ?4:rocket)}))) \mydo\\
\> \> {\sf load(?6:obj ?4:rocket ?2:loc)} \\
\> \mywhile (\incur({\sf inside(v?6:obj ?4:rocket)}) \myand \\
\> \> \> \incur({\sf at(?4:rocket ?2:loc)}) \myand \\
\> \> \> \ingoal({\sf at(v?6:obj ?2:loc)})) \mydo \\
\> \> {\sf unload(?6:obj ?4:rocket ?2:loc)} \\
\mywhile (\incur({\sf inside(v?1:obj v?2:rocket)}) \myand \\
\> \> \incur({\sf at(v?2:rocket v?3:loc)}) \myand \\
\> \> \ingoal({\sf at(v?1:obj v?4:loc)})) \mydo \\
\> {\sf move(?2:rocket ?3:loc ?4:loc)} \\
\> \mywhile (\incur({\sf inside(v?5:obj ?2:rocket)}) \myand \\
\> \> \> \ingoal({\sf at(v?5:obj ?4:loc)})) \mydo \\
\> \> {\sf unload(?5:obj ?2:rocket ?4:loc)} \\
\mywhile (\incur({\sf at(v?1:rocket v?2:loc)}) \myand \\
\> \> \ingoal({\sf at(v?1:rocket v?3:loc)})) \mydo \\
\> {\sf move(?1:rocket ?2:loc ?3:loc)}
\end{tabbing}
\hrule
}}
\caption{Rocket domain template}
\label{alg:rocket}
\end{table}


\begin{table}[htb]
\hrule
{\small
\noindent\begin{tabbing}
\=~~~~~~~~~~\=\=\+\kill
\end{tabbing}
\vspace{-0.5cm}
{\small
\begin{tabbing}
\=~~~~~~\=~~~~~~\=~~~~~~\=~~~~~~\=~~~~~~\=~~~~~~\=~~~~~~\=\+\kill
\mywhile (\ingoal({\sf at(?1:ball ?2:room)}) \myand \\
\> \> \incur({\sf at(?1:ball ?3:room)}) \myand \\
\> \> \mynot \mysame({\sf ?2:room ?3:room}) \myand \\
\> \> \incur({\sf at-robby(?5:room)})) \mydo \\
\> \myif (\mynot \mysame({\sf ?3:room ?5:room})) \mythen \\
\> \> {\sf move(?4 ?5 ?3)}\\
\> {\sf pick(?1 ?4 ?3)}\\
\> {\sf move(?4 ?3 ?2)}\\
\> {\sf drop(?1 ?4 ?2)}
\end{tabbing}
\hrule
}}
\caption{A simple template that solves all gripper-domain
  problems involving moving balls from one room to another.}
\label{alg:gripper-small}
\end{table}


\end{document}