# =========================================================================
# Towers of Hanoi
# =========================================================================
@prefix math: <http://www.w3.org/2000/10/swap/math#>.
@prefix list: <http://www.w3.org/2000/10/swap/list#>.
@prefix : <https://eyereasoner.github.io/eye/reasoning#>.

{ (?N ?X ?Y ?Z) :moves ?M } <= {
  ?N math:greaterThan 1.
  (?N 1) math:difference ?N1.
  (?N1 ?X ?Z ?Y) :moves ?M1.
  (?N1 ?Z ?Y ?X) :moves ?M2.
  (?M1 ((?X ?Y)) ?M2) list:append ?M.
}.
{ (1 ?X ?Y ?Z) :moves ((?X ?Y)) } <= true.
{ (3 :left :right :center) :moves ?M } => { 3 :answer ?M }.
