# taken from http://www.csupomona.edu/~jrfisher/www/prolog_tutorial/2_3.html

@prefix math: <http://www.w3.org/2000/10/swap/math#>.
@prefix e: <http://eulersharp.sourceforge.net/2003/03swap/log-rules#>.
@prefix : <hanoi#>.

{1 :move (?X ?Y ?Z)} <=
{	("format" "# Move top disk from ~w to ~w~n" (?X ?Y)) e:derive true.
}.

{?N :move (?X ?Y ?Z)} <=
{	?N math:greaterThan 1.
	(?N 1) math:difference ?M.
	?M :move (?X ?Z ?Y).
	1 :move (?X ?Y ?U).
	?M :move (?Z ?Y ?X).
}.

{3 :move (:left :right :center)} => {3 :answer (:left :right :center)}.
