PREFIX math: <http://www.w3.org/2000/10/swap/math#>
PREFIX list: <http://www.w3.org/2000/10/swap/list#>
PREFIX e: <http://eulersharp.sourceforge.net/2003/03swap/log-rules#>
PREFIX : <http://josd.github.io/eye/reasoning#>
PREFIX r: <http://www.w3.org/2000/10/swap/reason#>

[] a r:Proof, r:Conjunction;
  r:component <#lemma1>;
  r:gives {
    3 :answer ((:left :right) (:left :center) (:right :center) (:left :right) (:center :left) (:center :right) (:left :right)).
  }.

<#lemma1> a r:Inference;
  r:gives {
    3 :answer ((:left :right) (:left :center) (:right :center) (:left :right) (:center :left) (:center :right) (:left :right)).
  };
  r:evidence (
    <#lemma2>
  );
  r:rule <#lemma3>.

<#lemma2> a r:Inference;
  r:gives {
    3 :answer ((:left :right) (:left :center) (:right :center) (:left :right) (:center :left) (:center :right) (:left :right)).
  };
  r:evidence (
    <#lemma4>
  );
  r:rule <#lemma5>.

<#lemma3> a r:Extraction;
  r:gives {
    {?x_1_1 ?x_0_1 ?x_2_1} => {?x_1_1 ?x_0_1 ?x_2_1}.
  };
  r:because [ a r:Parsing; r:source <http://eulersharp.sourceforge.net/2003/03swap/pass>].

<#lemma4> a r:Inference;
  r:gives {
    (3 :left :right :center) :moves ((:left :right) (:left :center) (:right :center) (:left :right) (:center :left) (:center :right) (:left :right)).
  };
  r:evidence (
    [ a r:Fact; r:gives {3 math:greaterThan 1}]
    [ a r:Fact; r:gives {(3 1) math:difference 2}]
    <#lemma6>
    <#lemma7>
    [ a r:Fact; r:gives {(((:left :right) (:left :center) (:right :center)) ((:left :right)) ((:center :left) (:center :right) (:left :right))) list:append ((:left :right) (:left :center) (:right :center) (:left :right) (:center :left) (:center :right) (:left :right))}]
  );
  r:rule <#lemma8>.

<#lemma5> a r:Extraction;
  r:gives {
    {(3 :left :right :center) :moves ?x_0_2} => {3 :answer ?x_0_2}.
  };
  r:because [ a r:Parsing; r:source <http://josd.github.io/eye/reasoning/hanoi/hanoi.n3>].

<#lemma6> a r:Inference;
  r:gives {
    (2 :left :center :right) :moves ((:left :right) (:left :center) (:right :center)).
  };
  r:evidence (
    [ a r:Fact; r:gives {2 math:greaterThan 1}]
    [ a r:Fact; r:gives {(2 1) math:difference 1}]
    <#lemma9>
    <#lemma10>
    [ a r:Fact; r:gives {(((:left :right)) ((:left :center)) ((:right :center))) list:append ((:left :right) (:left :center) (:right :center))}]
  );
  r:rule <#lemma8>.

<#lemma7> a r:Inference;
  r:gives {
    (2 :center :right :left) :moves ((:center :left) (:center :right) (:left :right)).
  };
  r:evidence (
    [ a r:Fact; r:gives {2 math:greaterThan 1}]
    [ a r:Fact; r:gives {(2 1) math:difference 1}]
    <#lemma11>
    <#lemma9>
    [ a r:Fact; r:gives {(((:center :left)) ((:center :right)) ((:left :right))) list:append ((:center :left) (:center :right) (:left :right))}]
  );
  r:rule <#lemma8>.

<#lemma8> a r:Extraction;
  r:gives {
    {(?x_0_3 ?x_2_3 ?x_4_3 ?x_3_3) :moves ?x_7_3} <= {?x_0_3 math:greaterThan 1 .
     (?x_0_3 1) math:difference ?x_1_3.
     (?x_1_3 ?x_2_3 ?x_3_3 ?x_4_3) :moves ?x_5_3.
     (?x_1_3 ?x_3_3 ?x_4_3 ?x_2_3) :moves ?x_6_3.
     (?x_5_3 ((?x_2_3 ?x_4_3)) ?x_6_3) list:append ?x_7_3}.
  };
  r:because [ a r:Parsing; r:source <http://josd.github.io/eye/reasoning/hanoi/hanoi.n3>].

<#lemma9> a r:Inference;
  r:gives {
    (1 :left :right :center) :moves ((:left :right)).
  };
  r:evidence (
    [ a r:Fact; r:gives true]
  );
  r:rule <#lemma12>.

<#lemma10> a r:Inference;
  r:gives {
    (1 :right :center :left) :moves ((:right :center)).
  };
  r:evidence (
    [ a r:Fact; r:gives true]
  );
  r:rule <#lemma12>.

<#lemma11> a r:Inference;
  r:gives {
    (1 :center :left :right) :moves ((:center :left)).
  };
  r:evidence (
    [ a r:Fact; r:gives true]
  );
  r:rule <#lemma12>.

<#lemma12> a r:Extraction;
  r:gives {
    {(1 ?x_0_4 ?x_1_4 ?x_2_4) :moves ((?x_0_4 ?x_1_4))} <= true.
  };
  r:because [ a r:Parsing; r:source <http://josd.github.io/eye/reasoning/hanoi/hanoi.n3>].

