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

[] a r:Proof, r:Conjunction;
  r:component <#lemma1>;
  r:component <#lemma2>;
  r:component <#lemma3>;
  r:component <#lemma4>;
  r:gives {
    1 dqc:sdcoding 1 .
    3 dqc:sdcoding 3 .
    0 dqc:sdcoding 0 .
    2 dqc:sdcoding 2 .
  }.

<#lemma1> a r:Inference;
  r:gives {
    1 dqc:sdcoding 1 .
  };
  r:evidence (
    <#lemma5>
    [ a r:Fact; r:gives {((<http://josd.github.io/eye/reasoning/dqc/sdcoding-a.n3>) 1) e:findall (1 {1 dqc:sdcoding 1} (1))}]
    [ a r:Fact; r:gives {(1) math:sum 1}]
    [ a r:Fact; r:gives {(1 2) math:remainder 1}]
  );
  r:rule <#lemma6>.

<#lemma2> a r:Inference;
  r:gives {
    3 dqc:sdcoding 3 .
  };
  r:evidence (
    <#lemma7>
    [ a r:Fact; r:gives {((<http://josd.github.io/eye/reasoning/dqc/sdcoding-a.n3>) 1) e:findall (1 {3 dqc:sdcoding 3} (1))}]
    [ a r:Fact; r:gives {(1) math:sum 1}]
    [ a r:Fact; r:gives {(1 2) math:remainder 1}]
  );
  r:rule <#lemma6>.

<#lemma3> a r:Inference;
  r:gives {
    0 dqc:sdcoding 0 .
  };
  r:evidence (
    <#lemma8>
    [ a r:Fact; r:gives {((<http://josd.github.io/eye/reasoning/dqc/sdcoding-a.n3>) 1) e:findall (1 {0 dqc:sdcoding 0} (1))}]
    [ a r:Fact; r:gives {(1) math:sum 1}]
    [ a r:Fact; r:gives {(1 2) math:remainder 1}]
  );
  r:rule <#lemma6>.

<#lemma4> a r:Inference;
  r:gives {
    2 dqc:sdcoding 2 .
  };
  r:evidence (
    <#lemma9>
    [ a r:Fact; r:gives {((<http://josd.github.io/eye/reasoning/dqc/sdcoding-a.n3>) 1) e:findall (1 {2 dqc:sdcoding 2} (1))}]
    [ a r:Fact; r:gives {(1) math:sum 1}]
    [ a r:Fact; r:gives {(1 2) math:remainder 1}]
  );
  r:rule <#lemma6>.

<#lemma5> a r:Extraction;
  r:gives {
    1 dqc:sdcoding 1 .
  };
  r:because [ a r:Parsing; r:source <http://josd.github.io/eye/reasoning/dqc/sdcoding-a.n3>].

<#lemma6> a r:Extraction;
  r:gives {
    {?x_0_1 dqc:sdcoding ?x_1_1.
     ?x_2_1 e:findall (1 {?x_0_1 dqc:sdcoding ?x_1_1} ?x_3_1).
     ?x_3_1 math:sum ?x_4_1.
     (?x_4_1 2) math:remainder 1} => {?x_0_1 dqc:sdcoding ?x_1_1}.
  };
  r:because [ a r:Parsing; r:source <http://josd.github.io/eye/reasoning/dqc/sdcoding-query.n3>].

<#lemma7> a r:Extraction;
  r:gives {
    3 dqc:sdcoding 3 .
  };
  r:because [ a r:Parsing; r:source <http://josd.github.io/eye/reasoning/dqc/sdcoding-a.n3>].

<#lemma8> a r:Extraction;
  r:gives {
    0 dqc:sdcoding 0 .
  };
  r:because [ a r:Parsing; r:source <http://josd.github.io/eye/reasoning/dqc/sdcoding-a.n3>].

<#lemma9> a r:Extraction;
  r:gives {
    2 dqc:sdcoding 2 .
  };
  r:because [ a r:Parsing; r:source <http://josd.github.io/eye/reasoning/dqc/sdcoding-a.n3>].

